@almadar/std 16.144.0 → 16.146.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 (124) 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 +166 -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-app-layout.lolo +14 -0
  11. package/behaviors/lolo/ui/core/atoms/std-board.lolo +20 -6
  12. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +23 -6
  13. package/behaviors/lolo/ui/core/atoms/std-calendar.lolo +80 -2
  14. package/behaviors/lolo/ui/core/atoms/std-stats.lolo +1 -1
  15. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +3 -3
  16. package/behaviors/lolo/ui/core/atoms/ui-typography.lolo +1 -1
  17. package/behaviors/lolo/ui/core/molecules/ui-calendar-grid.lolo +18 -0
  18. package/behaviors/lolo/ui/core/molecules/ui-data-grid.lolo +2 -0
  19. package/behaviors/lolo/ui/core/molecules/ui-data-list.lolo +3 -2
  20. package/behaviors/lolo/ui/core/molecules/ui-filter-group.lolo +20 -0
  21. package/behaviors/lolo/ui/core/molecules/ui-search-input.lolo +7 -2
  22. package/behaviors/lolo/ui/core/molecules/ui-table-view.lolo +3 -2
  23. package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +2 -0
  24. package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +2 -0
  25. package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +2 -0
  26. package/behaviors/lolo/ui/core/organisms/ui-timeline.lolo +2 -0
  27. package/behaviors/lolo/ui/game/atoms/std-dungeon-combat.lolo +2 -2
  28. package/behaviors/lolo/ui/game/molecules/std-worldmap-board-2d.lolo +1 -1
  29. package/behaviors/lolo/ui/game/organisms/ui-boardgame-board.lolo +2 -2
  30. package/behaviors/lolo/ui/game/organisms/ui-builder-board.lolo +2 -2
  31. package/behaviors/lolo/ui/game/organisms/ui-debugger-board.lolo +3 -3
  32. package/behaviors/lolo/ui/game/organisms/ui-physics-sandbox-board.lolo +3 -3
  33. package/behaviors/lolo/ui/game/organisms/ui-roguelike-board.lolo +1 -1
  34. package/behaviors/lolo/ui/game/organisms/ui-sequencer-board.lolo +1 -1
  35. package/behaviors/lolo/ui/learning/atoms/std-algo-heapsort.lolo +2 -2
  36. package/behaviors/lolo/ui/learning/atoms/std-algo-mst.lolo +3 -3
  37. package/behaviors/registry/factory-signatures.json +5018 -824
  38. package/behaviors/registry/ml/atoms/std-ml-classify.orb +622 -0
  39. package/behaviors/registry/ml/atoms/std-ml-exact-check.orb +505 -0
  40. package/behaviors/registry/ml/atoms/std-ml-infer.orb +770 -0
  41. package/behaviors/registry/ml/atoms/std-ml-label-capture.orb +367 -0
  42. package/behaviors/registry/ml/atoms/std-ml-lookup.orb +473 -0
  43. package/behaviors/registry/ml/atoms/std-ml-posterior.orb +669 -0
  44. package/behaviors/registry/ml/atoms/std-ml-similarity.orb +917 -0
  45. package/behaviors/registry/ml/molecules/std-escalating-decision.orb +1553 -0
  46. package/behaviors/registry/ml/molecules/std-knowledge-tracing.orb +577 -0
  47. package/behaviors/registry/ui/core/atoms/std-app-layout.orb +33 -1
  48. package/behaviors/registry/ui/core/atoms/std-board.orb +64 -20
  49. package/behaviors/registry/ui/core/atoms/std-browse.orb +83 -48
  50. package/behaviors/registry/ui/core/atoms/std-calendar.orb +213 -3
  51. package/behaviors/registry/ui/core/atoms/ui-typography.orb +1 -1
  52. package/behaviors/registry/ui/core/molecules/ui-calendar-grid.orb +27 -0
  53. package/behaviors/registry/ui/core/molecules/ui-data-grid.orb +25 -12
  54. package/behaviors/registry/ui/core/molecules/ui-data-list.orb +26 -13
  55. package/behaviors/registry/ui/core/molecules/ui-filter-group.orb +86 -0
  56. package/behaviors/registry/ui/core/molecules/ui-search-input.orb +37 -1
  57. package/behaviors/registry/ui/core/molecules/ui-table-view.orb +25 -12
  58. package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +13 -0
  59. package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +21 -8
  60. package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +13 -0
  61. package/behaviors/registry/ui/core/organisms/ui-timeline.orb +13 -0
  62. package/behaviors/registry/ui/game/atoms/std-dungeon-combat.orb +4 -4
  63. package/behaviors/registry/ui/game/molecules/std-worldmap-board-2d.orb +6 -9
  64. package/behaviors/registry/ui/game/organisms/ui-boardgame-board.orb +4 -4
  65. package/behaviors/registry/ui/game/organisms/ui-builder-board.orb +4 -4
  66. package/behaviors/registry/ui/game/organisms/ui-debugger-board.orb +12 -12
  67. package/behaviors/registry/ui/game/organisms/ui-physics-sandbox-board.orb +19 -19
  68. package/behaviors/registry/ui/game/organisms/ui-roguelike-board.orb +1 -1
  69. package/behaviors/registry/ui/game/organisms/ui-sequencer-board.orb +2 -2
  70. package/behaviors/registry/ui/learning/atoms/std-algo-heapsort.orb +8 -8
  71. package/canonical-operators.json +30 -6
  72. package/dist/behaviors/behaviors-embeddings.json +267 -267
  73. package/dist/behaviors/exports-reader.js +2462 -2080
  74. package/dist/behaviors/functions/index.d.ts +725 -1
  75. package/dist/behaviors/functions/index.js +2437 -2081
  76. package/dist/behaviors/index.d.ts +1 -1
  77. package/dist/behaviors/index.js +2463 -2081
  78. package/dist/behaviors/knob-embeddings.json +1 -1
  79. package/dist/behaviors/query.js +2462 -2080
  80. package/dist/behaviors/registry/factory-signatures.json +5018 -824
  81. package/dist/behaviors/registry/ml/atoms/std-ml-classify.orb +622 -0
  82. package/dist/behaviors/registry/ml/atoms/std-ml-exact-check.orb +505 -0
  83. package/dist/behaviors/registry/ml/atoms/std-ml-infer.orb +770 -0
  84. package/dist/behaviors/registry/ml/atoms/std-ml-label-capture.orb +367 -0
  85. package/dist/behaviors/registry/ml/atoms/std-ml-lookup.orb +473 -0
  86. package/dist/behaviors/registry/ml/atoms/std-ml-posterior.orb +669 -0
  87. package/dist/behaviors/registry/ml/atoms/std-ml-similarity.orb +917 -0
  88. package/dist/behaviors/registry/ml/molecules/std-escalating-decision.orb +1553 -0
  89. package/dist/behaviors/registry/ml/molecules/std-knowledge-tracing.orb +577 -0
  90. package/dist/behaviors/registry/ui/core/atoms/std-app-layout.orb +33 -1
  91. package/dist/behaviors/registry/ui/core/atoms/std-board.orb +64 -20
  92. package/dist/behaviors/registry/ui/core/atoms/std-browse.orb +83 -48
  93. package/dist/behaviors/registry/ui/core/atoms/std-calendar.orb +213 -3
  94. package/dist/behaviors/registry/ui/core/atoms/ui-typography.orb +1 -1
  95. package/dist/behaviors/registry/ui/core/molecules/ui-calendar-grid.orb +27 -0
  96. package/dist/behaviors/registry/ui/core/molecules/ui-data-grid.orb +25 -12
  97. package/dist/behaviors/registry/ui/core/molecules/ui-data-list.orb +26 -13
  98. package/dist/behaviors/registry/ui/core/molecules/ui-filter-group.orb +86 -0
  99. package/dist/behaviors/registry/ui/core/molecules/ui-search-input.orb +37 -1
  100. package/dist/behaviors/registry/ui/core/molecules/ui-table-view.orb +25 -12
  101. package/dist/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +13 -0
  102. package/dist/behaviors/registry/ui/core/organisms/ui-entity-list.orb +21 -8
  103. package/dist/behaviors/registry/ui/core/organisms/ui-entity-table.orb +13 -0
  104. package/dist/behaviors/registry/ui/core/organisms/ui-timeline.orb +13 -0
  105. package/dist/behaviors/registry/ui/game/atoms/std-dungeon-combat.orb +4 -4
  106. package/dist/behaviors/registry/ui/game/molecules/std-worldmap-board-2d.orb +6 -9
  107. package/dist/behaviors/registry/ui/game/organisms/ui-boardgame-board.orb +4 -4
  108. package/dist/behaviors/registry/ui/game/organisms/ui-builder-board.orb +4 -4
  109. package/dist/behaviors/registry/ui/game/organisms/ui-debugger-board.orb +12 -12
  110. package/dist/behaviors/registry/ui/game/organisms/ui-physics-sandbox-board.orb +19 -19
  111. package/dist/behaviors/registry/ui/game/organisms/ui-roguelike-board.orb +1 -1
  112. package/dist/behaviors/registry/ui/game/organisms/ui-sequencer-board.orb +2 -2
  113. package/dist/behaviors/registry/ui/learning/atoms/std-algo-heapsort.orb +8 -8
  114. package/dist/behaviors-embeddings.json +267 -267
  115. package/dist/index.d.ts +1 -1
  116. package/dist/index.js +2498 -2088
  117. package/dist/knob-embeddings.json +1 -1
  118. package/dist/modules/array.js +28 -0
  119. package/dist/modules/contract.js +4 -4
  120. package/dist/modules/data.js +3 -3
  121. package/dist/modules/index.js +35 -7
  122. package/dist/registry/factory-signatures.json +5018 -824
  123. package/dist/registry.js +35 -7
  124. package/package.json +3 -3
@@ -0,0 +1,917 @@
1
+ {
2
+ "description": "Retrieval rung (R3) — embed a candidate against references and gate on cosine floor + margin; abstains when not confident.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01KYBN0QT9997QBWPF6WFF1CMM": {
6
+ "bakedName": "SimilarityComparison",
7
+ "curName": "SimilarityComparison",
8
+ "id": "ent_01KYBN0QT9997QBWPF6WFF1CMM",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01KYBN0QT9A6WZFFTCVGBHF2BT": {
14
+ "bakedName": "RESET",
15
+ "curName": "RESET",
16
+ "id": "evt_01KYBN0QT9A6WZFFTCVGBHF2BT",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
20
+ "renames": []
21
+ },
22
+ "evt_01KYBN0QT9ACZNZH01MYKGTXYX": {
23
+ "bakedName": "EMBED_FAILED",
24
+ "curName": "EMBED_FAILED",
25
+ "id": "evt_01KYBN0QT9ACZNZH01MYKGTXYX",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
29
+ "renames": []
30
+ },
31
+ "evt_01KYBN0QT9FX93HBXP52KRNVX6": {
32
+ "bakedName": "COMPARE",
33
+ "curName": "COMPARE",
34
+ "id": "evt_01KYBN0QT9FX93HBXP52KRNVX6",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
38
+ "renames": []
39
+ },
40
+ "evt_01KYBN0QT9K8NXCX7AMQ2VTNWX": {
41
+ "bakedName": "SIMILARITY_ABSTAINED",
42
+ "curName": "SIMILARITY_ABSTAINED",
43
+ "id": "evt_01KYBN0QT9K8NXCX7AMQ2VTNWX",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
47
+ "renames": []
48
+ },
49
+ "evt_01KYBN0QT9KC3AMM14E9M55ACF": {
50
+ "bakedName": "SIMILARITY_MATCHED",
51
+ "curName": "SIMILARITY_MATCHED",
52
+ "id": "evt_01KYBN0QT9KC3AMM14E9M55ACF",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
56
+ "renames": []
57
+ },
58
+ "evt_01KYBN0QT9WZDN3FMC3T36ACHS": {
59
+ "bakedName": "EMBEDDED",
60
+ "curName": "EMBEDDED",
61
+ "id": "evt_01KYBN0QT9WZDN3FMC3T36ACHS",
62
+ "kind": "event",
63
+ "owner": "workspace",
64
+ "parent": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
65
+ "renames": []
66
+ },
67
+ "evt_01KYBN0QT9ZTTW50RCT84MH8H1": {
68
+ "bakedName": "INIT",
69
+ "curName": "INIT",
70
+ "id": "evt_01KYBN0QT9ZTTW50RCT84MH8H1",
71
+ "kind": "event",
72
+ "owner": "workspace",
73
+ "parent": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
74
+ "renames": []
75
+ },
76
+ "orb_01KYBN0QT97QXM5727TNZZSS1B": {
77
+ "bakedName": "MlSimilarityOrbital",
78
+ "curName": "MlSimilarityOrbital",
79
+ "id": "orb_01KYBN0QT97QXM5727TNZZSS1B",
80
+ "kind": "orbital",
81
+ "owner": "workspace",
82
+ "renames": []
83
+ },
84
+ "pag_01KYBN0QT9YB0Q6ZEZWC560YEN": {
85
+ "bakedName": "MlSimilarityPage",
86
+ "curName": "MlSimilarityPage",
87
+ "id": "pag_01KYBN0QT9YB0Q6ZEZWC560YEN",
88
+ "kind": "page",
89
+ "owner": "workspace",
90
+ "renames": []
91
+ },
92
+ "trt_01KYBN0QT9C1SZTVGAG9X3YA5X": {
93
+ "bakedName": "SimilarityRun",
94
+ "curName": "SimilarityRun",
95
+ "id": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
96
+ "kind": "trait",
97
+ "owner": "workspace",
98
+ "renames": []
99
+ }
100
+ },
101
+ "schemaVersion": 1
102
+ },
103
+ "name": "std-ml-similarity",
104
+ "orbitals": [
105
+ {
106
+ "entity": {
107
+ "fields": [
108
+ {
109
+ "default": "",
110
+ "name": "query",
111
+ "type": "string"
112
+ },
113
+ {
114
+ "default": [],
115
+ "items": {
116
+ "type": "string"
117
+ },
118
+ "name": "candidates",
119
+ "type": "array"
120
+ },
121
+ {
122
+ "default": [],
123
+ "items": {
124
+ "items": {
125
+ "type": "number"
126
+ },
127
+ "type": "array"
128
+ },
129
+ "name": "embeddings",
130
+ "type": "array"
131
+ },
132
+ {
133
+ "default": [],
134
+ "items": {
135
+ "type": "number"
136
+ },
137
+ "name": "queryVector",
138
+ "type": "array"
139
+ },
140
+ {
141
+ "default": [],
142
+ "items": {
143
+ "items": {
144
+ "type": "number"
145
+ },
146
+ "type": "array"
147
+ },
148
+ "name": "candidateVectors",
149
+ "type": "array"
150
+ },
151
+ {
152
+ "default": 0.0,
153
+ "name": "matchIndex",
154
+ "type": "number"
155
+ },
156
+ {
157
+ "default": 0.0,
158
+ "name": "matchScore",
159
+ "type": "number"
160
+ },
161
+ {
162
+ "default": 0.0,
163
+ "name": "matchMargin",
164
+ "type": "number"
165
+ },
166
+ {
167
+ "default": "",
168
+ "name": "reason",
169
+ "type": "string"
170
+ },
171
+ {
172
+ "default": {},
173
+ "name": "request",
174
+ "type": "object"
175
+ },
176
+ {
177
+ "default": "idle",
178
+ "name": "status",
179
+ "type": "string",
180
+ "values": [
181
+ "idle",
182
+ "embedding",
183
+ "resolved"
184
+ ]
185
+ }
186
+ ],
187
+ "id": "ent_01KYBN0QT9997QBWPF6WFF1CMM",
188
+ "name": "SimilarityComparison",
189
+ "persistence": "runtime"
190
+ },
191
+ "id": "orb_01KYBN0QT97QXM5727TNZZSS1B",
192
+ "name": "MlSimilarityOrbital",
193
+ "pages": [
194
+ {
195
+ "id": "pag_01KYBN0QT9YB0Q6ZEZWC560YEN",
196
+ "name": "MlSimilarityPage",
197
+ "path": "/ml-similarity",
198
+ "traits": [
199
+ {
200
+ "ref": "SimilarityRun",
201
+ "refId": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X"
202
+ }
203
+ ]
204
+ }
205
+ ],
206
+ "traits": [
207
+ {
208
+ "category": "lifecycle",
209
+ "config": {
210
+ "embedModel": {
211
+ "default": "",
212
+ "description": "Reserved for embedding-model selection; llm/embed takes only a texts array today, so this knob is not yet wired into the call",
213
+ "label": "Embedding model",
214
+ "tier": "infra",
215
+ "type": "string"
216
+ },
217
+ "floor": {
218
+ "default": 0.82,
219
+ "description": "Minimum cosine score for a confident match",
220
+ "label": "Match floor",
221
+ "tier": "policy",
222
+ "type": "float"
223
+ },
224
+ "margin": {
225
+ "default": 0.05,
226
+ "description": "Minimum gap between the best and second-best score required to trust the match",
227
+ "label": "Match margin",
228
+ "tier": "policy",
229
+ "type": "float"
230
+ }
231
+ },
232
+ "emits": [
233
+ {
234
+ "description": "Raw embeddings from llm/embed — query vector at index 0, candidate vectors following in input order",
235
+ "event": "EMBEDDED",
236
+ "eventId": "evt_01KYBN0QT9WZDN3FMC3T36ACHS",
237
+ "payloadSchema": [
238
+ {
239
+ "name": "result",
240
+ "required": true,
241
+ "type": "[[float]]"
242
+ }
243
+ ],
244
+ "tier": "secondary"
245
+ },
246
+ {
247
+ "description": "Candidate matched with high confidence — score at or above floor, with a clear margin over the runner-up",
248
+ "event": "SIMILARITY_MATCHED",
249
+ "eventId": "evt_01KYBN0QT9KC3AMM14E9M55ACF",
250
+ "payloadSchema": [
251
+ {
252
+ "name": "index",
253
+ "required": true,
254
+ "type": "int"
255
+ },
256
+ {
257
+ "name": "score",
258
+ "required": true,
259
+ "type": "float"
260
+ }
261
+ ],
262
+ "scope": "external",
263
+ "tier": "primary"
264
+ },
265
+ {
266
+ "description": "No confident match — reason is one of: empty candidate list, below floor, thin margin, embedding unavailable. request echoes the originating request untouched so the next rung can project its own inputs out of it",
267
+ "event": "SIMILARITY_ABSTAINED",
268
+ "eventId": "evt_01KYBN0QT9K8NXCX7AMQ2VTNWX",
269
+ "payloadSchema": [
270
+ {
271
+ "name": "reason",
272
+ "required": true,
273
+ "type": "string"
274
+ },
275
+ {
276
+ "name": "request",
277
+ "type": "object"
278
+ }
279
+ ],
280
+ "scope": "external",
281
+ "tier": "primary"
282
+ }
283
+ ],
284
+ "entityRefIds": {
285
+ "SimilarityComparison": "ent_01KYBN0QT9997QBWPF6WFF1CMM"
286
+ },
287
+ "id": "trt_01KYBN0QT9C1SZTVGAG9X3YA5X",
288
+ "linkedEntity": "SimilarityComparison",
289
+ "linkedEntityId": "ent_01KYBN0QT9997QBWPF6WFF1CMM",
290
+ "name": "SimilarityRun",
291
+ "scope": "instance",
292
+ "stateMachine": {
293
+ "events": [
294
+ {
295
+ "id": "evt_01KYBN0QT9ZTTW50RCT84MH8H1",
296
+ "key": "INIT",
297
+ "name": "Initialize"
298
+ },
299
+ {
300
+ "id": "evt_01KYBN0QT9FX93HBXP52KRNVX6",
301
+ "key": "COMPARE",
302
+ "name": "Compare",
303
+ "payloadSchema": [
304
+ {
305
+ "name": "query",
306
+ "required": true,
307
+ "type": "string"
308
+ },
309
+ {
310
+ "name": "candidates",
311
+ "required": true,
312
+ "type": "[string]"
313
+ },
314
+ {
315
+ "name": "request",
316
+ "type": "object"
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ "description": "Raw embeddings from llm/embed — query vector at index 0, candidate vectors following in input order",
322
+ "id": "evt_01KYBN0QT9WZDN3FMC3T36ACHS",
323
+ "key": "EMBEDDED",
324
+ "name": "Embedded",
325
+ "payloadSchema": [
326
+ {
327
+ "name": "result",
328
+ "required": true,
329
+ "type": "[[float]]"
330
+ }
331
+ ],
332
+ "tier": "secondary"
333
+ },
334
+ {
335
+ "id": "evt_01KYBN0QT9ACZNZH01MYKGTXYX",
336
+ "key": "EMBED_FAILED",
337
+ "name": "Embed Failed"
338
+ },
339
+ {
340
+ "id": "evt_01KYBN0QT9A6WZFFTCVGBHF2BT",
341
+ "key": "RESET",
342
+ "name": "Reset"
343
+ },
344
+ {
345
+ "description": "Candidate matched with high confidence — score at or above floor, with a clear margin over the runner-up",
346
+ "id": "evt_01KYBN0QT9KC3AMM14E9M55ACF",
347
+ "key": "SIMILARITY_MATCHED",
348
+ "name": "Similarity Matched",
349
+ "payloadSchema": [
350
+ {
351
+ "name": "index",
352
+ "required": true,
353
+ "type": "int"
354
+ },
355
+ {
356
+ "name": "score",
357
+ "required": true,
358
+ "type": "float"
359
+ }
360
+ ],
361
+ "tier": "primary"
362
+ },
363
+ {
364
+ "description": "No confident match — reason is one of: empty candidate list, below floor, thin margin, embedding unavailable. request echoes the originating request untouched so the next rung can project its own inputs out of it",
365
+ "id": "evt_01KYBN0QT9K8NXCX7AMQ2VTNWX",
366
+ "key": "SIMILARITY_ABSTAINED",
367
+ "name": "Similarity Abstained",
368
+ "payloadSchema": [
369
+ {
370
+ "name": "reason",
371
+ "required": true,
372
+ "type": "string"
373
+ },
374
+ {
375
+ "name": "request",
376
+ "type": "object"
377
+ }
378
+ ],
379
+ "tier": "primary"
380
+ }
381
+ ],
382
+ "states": [
383
+ {
384
+ "isInitial": true,
385
+ "name": "idle"
386
+ },
387
+ {
388
+ "name": "embedding"
389
+ },
390
+ {
391
+ "name": "resolved"
392
+ }
393
+ ],
394
+ "transitions": [
395
+ {
396
+ "effects": [
397
+ [
398
+ "set",
399
+ "@entity.query",
400
+ ""
401
+ ],
402
+ [
403
+ "set",
404
+ "@entity.candidates",
405
+ []
406
+ ],
407
+ [
408
+ "set",
409
+ "@entity.embeddings",
410
+ []
411
+ ],
412
+ [
413
+ "set",
414
+ "@entity.queryVector",
415
+ []
416
+ ],
417
+ [
418
+ "set",
419
+ "@entity.candidateVectors",
420
+ []
421
+ ],
422
+ [
423
+ "set",
424
+ "@entity.matchIndex",
425
+ 0.0
426
+ ],
427
+ [
428
+ "set",
429
+ "@entity.matchScore",
430
+ 0.0
431
+ ],
432
+ [
433
+ "set",
434
+ "@entity.matchMargin",
435
+ 0.0
436
+ ],
437
+ [
438
+ "set",
439
+ "@entity.reason",
440
+ ""
441
+ ],
442
+ [
443
+ "set",
444
+ "@entity.request",
445
+ {}
446
+ ],
447
+ [
448
+ "set",
449
+ "@entity.status",
450
+ "idle"
451
+ ]
452
+ ],
453
+ "event": "INIT",
454
+ "eventId": "evt_01KYBN0QT9ZTTW50RCT84MH8H1",
455
+ "from": "idle",
456
+ "to": "idle"
457
+ },
458
+ {
459
+ "effects": [
460
+ [
461
+ "set",
462
+ "@entity.query",
463
+ "@payload.query"
464
+ ],
465
+ [
466
+ "set",
467
+ "@entity.candidates",
468
+ "@payload.candidates"
469
+ ],
470
+ [
471
+ "set",
472
+ "@entity.request",
473
+ "@payload.request"
474
+ ],
475
+ [
476
+ "set",
477
+ "@entity.status",
478
+ "embedding"
479
+ ],
480
+ [
481
+ "llm/embed",
482
+ [
483
+ "array/prepend",
484
+ "@payload.candidates",
485
+ "@payload.query"
486
+ ],
487
+ {
488
+ "emit": {
489
+ "failure": "EMBED_FAILED",
490
+ "success": "EMBEDDED"
491
+ }
492
+ }
493
+ ]
494
+ ],
495
+ "event": "COMPARE",
496
+ "eventId": "evt_01KYBN0QT9FX93HBXP52KRNVX6",
497
+ "from": "idle",
498
+ "guard": [
499
+ ">",
500
+ [
501
+ "array/len",
502
+ "@payload.candidates"
503
+ ],
504
+ 0.0
505
+ ],
506
+ "to": "embedding"
507
+ },
508
+ {
509
+ "effects": [
510
+ [
511
+ "set",
512
+ "@entity.query",
513
+ "@payload.query"
514
+ ],
515
+ [
516
+ "set",
517
+ "@entity.candidates",
518
+ []
519
+ ],
520
+ [
521
+ "set",
522
+ "@entity.embeddings",
523
+ []
524
+ ],
525
+ [
526
+ "set",
527
+ "@entity.queryVector",
528
+ []
529
+ ],
530
+ [
531
+ "set",
532
+ "@entity.candidateVectors",
533
+ []
534
+ ],
535
+ [
536
+ "set",
537
+ "@entity.matchIndex",
538
+ 0.0
539
+ ],
540
+ [
541
+ "set",
542
+ "@entity.matchScore",
543
+ 0.0
544
+ ],
545
+ [
546
+ "set",
547
+ "@entity.matchMargin",
548
+ 0.0
549
+ ],
550
+ [
551
+ "set",
552
+ "@entity.reason",
553
+ "empty candidate list"
554
+ ],
555
+ [
556
+ "set",
557
+ "@entity.request",
558
+ "@payload.request"
559
+ ],
560
+ [
561
+ "set",
562
+ "@entity.status",
563
+ "resolved"
564
+ ],
565
+ [
566
+ "emit",
567
+ "SIMILARITY_ABSTAINED",
568
+ {
569
+ "reason": "empty candidate list",
570
+ "request": "@entity.request"
571
+ }
572
+ ]
573
+ ],
574
+ "event": "COMPARE",
575
+ "eventId": "evt_01KYBN0QT9FX93HBXP52KRNVX6",
576
+ "from": "idle",
577
+ "guard": [
578
+ "==",
579
+ [
580
+ "array/len",
581
+ "@payload.candidates"
582
+ ],
583
+ 0.0
584
+ ],
585
+ "to": "resolved"
586
+ },
587
+ {
588
+ "effects": [
589
+ [
590
+ "set",
591
+ "@entity.embeddings",
592
+ "@payload.result"
593
+ ],
594
+ [
595
+ "set",
596
+ "@entity.status",
597
+ "resolved"
598
+ ],
599
+ [
600
+ "if",
601
+ [
602
+ "<",
603
+ [
604
+ "array/len",
605
+ "@payload.result"
606
+ ],
607
+ 2.0
608
+ ],
609
+ [
610
+ "do",
611
+ [
612
+ "set",
613
+ "@entity.queryVector",
614
+ []
615
+ ],
616
+ [
617
+ "set",
618
+ "@entity.candidateVectors",
619
+ []
620
+ ],
621
+ [
622
+ "set",
623
+ "@entity.matchIndex",
624
+ 0.0
625
+ ],
626
+ [
627
+ "set",
628
+ "@entity.matchScore",
629
+ 0.0
630
+ ],
631
+ [
632
+ "set",
633
+ "@entity.matchMargin",
634
+ 0.0
635
+ ],
636
+ [
637
+ "set",
638
+ "@entity.reason",
639
+ "embedding result incomplete"
640
+ ],
641
+ [
642
+ "emit",
643
+ "SIMILARITY_ABSTAINED",
644
+ {
645
+ "reason": "embedding result incomplete",
646
+ "request": "@entity.request"
647
+ }
648
+ ]
649
+ ],
650
+ [
651
+ "do",
652
+ [
653
+ "set",
654
+ "@entity.queryVector",
655
+ [
656
+ "array/first",
657
+ "@entity.embeddings"
658
+ ]
659
+ ],
660
+ [
661
+ "set",
662
+ "@entity.candidateVectors",
663
+ [
664
+ "array/drop",
665
+ "@entity.embeddings",
666
+ 1.0
667
+ ]
668
+ ],
669
+ [
670
+ "let",
671
+ [
672
+ [
673
+ "nearest",
674
+ [
675
+ "array/nearest",
676
+ "@entity.queryVector",
677
+ "@entity.candidateVectors"
678
+ ]
679
+ ]
680
+ ],
681
+ [
682
+ "do",
683
+ [
684
+ "set",
685
+ "@entity.matchIndex",
686
+ [
687
+ "object/get",
688
+ "@nearest",
689
+ "index"
690
+ ]
691
+ ],
692
+ [
693
+ "set",
694
+ "@entity.matchScore",
695
+ [
696
+ "object/get",
697
+ "@nearest",
698
+ "score"
699
+ ]
700
+ ],
701
+ [
702
+ "set",
703
+ "@entity.matchMargin",
704
+ [
705
+ "object/get",
706
+ "@nearest",
707
+ "margin"
708
+ ]
709
+ ],
710
+ [
711
+ "if",
712
+ [
713
+ "and",
714
+ [
715
+ ">=",
716
+ "@entity.matchScore",
717
+ "@config.floor"
718
+ ],
719
+ [
720
+ ">=",
721
+ "@entity.matchMargin",
722
+ "@config.margin"
723
+ ]
724
+ ],
725
+ [
726
+ "do",
727
+ [
728
+ "set",
729
+ "@entity.reason",
730
+ ""
731
+ ],
732
+ [
733
+ "emit",
734
+ "SIMILARITY_MATCHED",
735
+ {
736
+ "index": "@entity.matchIndex",
737
+ "score": "@entity.matchScore"
738
+ }
739
+ ]
740
+ ],
741
+ [
742
+ "do",
743
+ [
744
+ "set",
745
+ "@entity.reason",
746
+ [
747
+ "if",
748
+ [
749
+ "<",
750
+ "@entity.matchScore",
751
+ "@config.floor"
752
+ ],
753
+ "below floor",
754
+ "thin margin"
755
+ ]
756
+ ],
757
+ [
758
+ "emit",
759
+ "SIMILARITY_ABSTAINED",
760
+ {
761
+ "reason": "@entity.reason",
762
+ "request": "@entity.request"
763
+ }
764
+ ]
765
+ ]
766
+ ]
767
+ ]
768
+ ]
769
+ ]
770
+ ]
771
+ ],
772
+ "event": "EMBEDDED",
773
+ "eventId": "evt_01KYBN0QT9WZDN3FMC3T36ACHS",
774
+ "from": "embedding",
775
+ "to": "resolved"
776
+ },
777
+ {
778
+ "effects": [
779
+ [
780
+ "set",
781
+ "@entity.embeddings",
782
+ []
783
+ ],
784
+ [
785
+ "set",
786
+ "@entity.queryVector",
787
+ []
788
+ ],
789
+ [
790
+ "set",
791
+ "@entity.candidateVectors",
792
+ []
793
+ ],
794
+ [
795
+ "set",
796
+ "@entity.matchIndex",
797
+ 0.0
798
+ ],
799
+ [
800
+ "set",
801
+ "@entity.matchScore",
802
+ 0.0
803
+ ],
804
+ [
805
+ "set",
806
+ "@entity.matchMargin",
807
+ 0.0
808
+ ],
809
+ [
810
+ "set",
811
+ "@entity.reason",
812
+ "embedding unavailable"
813
+ ],
814
+ [
815
+ "set",
816
+ "@entity.status",
817
+ "resolved"
818
+ ],
819
+ [
820
+ "emit",
821
+ "SIMILARITY_ABSTAINED",
822
+ {
823
+ "reason": "embedding unavailable",
824
+ "request": "@entity.request"
825
+ }
826
+ ]
827
+ ],
828
+ "event": "EMBED_FAILED",
829
+ "eventId": "evt_01KYBN0QT9ACZNZH01MYKGTXYX",
830
+ "from": "embedding",
831
+ "to": "resolved"
832
+ },
833
+ {
834
+ "effects": [
835
+ [
836
+ "set",
837
+ "@entity.status",
838
+ "resolved"
839
+ ]
840
+ ],
841
+ "event": "INIT",
842
+ "eventId": "evt_01KYBN0QT9ZTTW50RCT84MH8H1",
843
+ "from": "resolved",
844
+ "to": "resolved"
845
+ },
846
+ {
847
+ "effects": [
848
+ [
849
+ "set",
850
+ "@entity.query",
851
+ ""
852
+ ],
853
+ [
854
+ "set",
855
+ "@entity.candidates",
856
+ []
857
+ ],
858
+ [
859
+ "set",
860
+ "@entity.embeddings",
861
+ []
862
+ ],
863
+ [
864
+ "set",
865
+ "@entity.queryVector",
866
+ []
867
+ ],
868
+ [
869
+ "set",
870
+ "@entity.candidateVectors",
871
+ []
872
+ ],
873
+ [
874
+ "set",
875
+ "@entity.matchIndex",
876
+ 0.0
877
+ ],
878
+ [
879
+ "set",
880
+ "@entity.matchScore",
881
+ 0.0
882
+ ],
883
+ [
884
+ "set",
885
+ "@entity.matchMargin",
886
+ 0.0
887
+ ],
888
+ [
889
+ "set",
890
+ "@entity.reason",
891
+ ""
892
+ ],
893
+ [
894
+ "set",
895
+ "@entity.request",
896
+ {}
897
+ ],
898
+ [
899
+ "set",
900
+ "@entity.status",
901
+ "idle"
902
+ ]
903
+ ],
904
+ "event": "RESET",
905
+ "eventId": "evt_01KYBN0QT9A6WZFFTCVGBHF2BT",
906
+ "from": "resolved",
907
+ "to": "idle"
908
+ }
909
+ ]
910
+ }
911
+ }
912
+ ]
913
+ }
914
+ ],
915
+ "schemaVersion": 1,
916
+ "version": "1.0.0"
917
+ }