@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,669 @@
1
+ {
2
+ "description": "std-ml-posterior — the statistical rung (R2) of the intelligence ladder. Holds a Beta(alpha, beta) belief over an unknown success rate and updates it from boolean observations (Bayesian updating, knowledge tracing, Thompson-sampling prior). After each observation it draws samples from the posterior, computes a credible interval, and decides: MASTERY_REACHED when the mean clears the floor with a tight interval, REMEDIATION_NEEDED when the mean sits at or below the ceiling with the same confidence, or EVIDENCE_INSUFFICIENT — the abstain — when the interval is still too wide to trust. Use when a hand-tuned score needs to become a belief that can say 'not enough evidence yet' (mastery, skill, risk, preference, difficulty).",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01KYBM8SPD24VMR9HBQY0RM82A": {
6
+ "bakedName": "Posterior",
7
+ "curName": "Posterior",
8
+ "id": "ent_01KYBM8SPD24VMR9HBQY0RM82A",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01KYBM8SPDEVSWTYZ4MWW9NPR1": {
14
+ "bakedName": "INIT",
15
+ "curName": "INIT",
16
+ "id": "evt_01KYBM8SPDEVSWTYZ4MWW9NPR1",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01KYBM8SPDR0V9Y61Y00APN1PT",
20
+ "renames": []
21
+ },
22
+ "evt_01KYBM8SPDPGKNPVWPME4HZA7C": {
23
+ "bakedName": "MASTERY_REACHED",
24
+ "curName": "MASTERY_REACHED",
25
+ "id": "evt_01KYBM8SPDPGKNPVWPME4HZA7C",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01KYBM8SPDR0V9Y61Y00APN1PT",
29
+ "renames": []
30
+ },
31
+ "evt_01KYBM8SPDSVKBPWV2V0GTMS44": {
32
+ "bakedName": "EVIDENCE_INSUFFICIENT",
33
+ "curName": "EVIDENCE_INSUFFICIENT",
34
+ "id": "evt_01KYBM8SPDSVKBPWV2V0GTMS44",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01KYBM8SPDR0V9Y61Y00APN1PT",
38
+ "renames": []
39
+ },
40
+ "evt_01KYBM8SPDW5ZGB5SDCQD74JSB": {
41
+ "bakedName": "REMEDIATION_NEEDED",
42
+ "curName": "REMEDIATION_NEEDED",
43
+ "id": "evt_01KYBM8SPDW5ZGB5SDCQD74JSB",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01KYBM8SPDR0V9Y61Y00APN1PT",
47
+ "renames": []
48
+ },
49
+ "evt_01KYBM8SPDZNET4JJKM8MJ8TYE": {
50
+ "bakedName": "OBSERVE",
51
+ "curName": "OBSERVE",
52
+ "id": "evt_01KYBM8SPDZNET4JJKM8MJ8TYE",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01KYBM8SPDR0V9Y61Y00APN1PT",
56
+ "renames": []
57
+ },
58
+ "orb_01KYBM8SPCWYRYTP9GG343Z4JN": {
59
+ "bakedName": "MlPosteriorOrbital",
60
+ "curName": "MlPosteriorOrbital",
61
+ "id": "orb_01KYBM8SPCWYRYTP9GG343Z4JN",
62
+ "kind": "orbital",
63
+ "owner": "workspace",
64
+ "renames": []
65
+ },
66
+ "pag_01KYBM8SPEWW6AQ9C7AXCKFTJM": {
67
+ "bakedName": "MlPosteriorPage",
68
+ "curName": "MlPosteriorPage",
69
+ "id": "pag_01KYBM8SPEWW6AQ9C7AXCKFTJM",
70
+ "kind": "page",
71
+ "owner": "workspace",
72
+ "renames": []
73
+ },
74
+ "trt_01KYBM8SPDR0V9Y61Y00APN1PT": {
75
+ "bakedName": "PosteriorBelief",
76
+ "curName": "PosteriorBelief",
77
+ "id": "trt_01KYBM8SPDR0V9Y61Y00APN1PT",
78
+ "kind": "trait",
79
+ "owner": "workspace",
80
+ "renames": []
81
+ }
82
+ },
83
+ "schemaVersion": 1
84
+ },
85
+ "name": "std-ml-posterior",
86
+ "orbitals": [
87
+ {
88
+ "entity": {
89
+ "fields": [
90
+ {
91
+ "default": 1.0,
92
+ "description": "Beta distribution success count (prior + observed successes).",
93
+ "name": "alpha",
94
+ "type": "number"
95
+ },
96
+ {
97
+ "default": 1.0,
98
+ "description": "Beta distribution failure count (prior + observed failures).",
99
+ "name": "beta",
100
+ "type": "number"
101
+ },
102
+ {
103
+ "default": 0.0,
104
+ "description": "Posterior mean: alpha / (alpha + beta).",
105
+ "name": "mean",
106
+ "type": "number"
107
+ },
108
+ {
109
+ "default": 0.0,
110
+ "description": "Lower bound of the last computed credible interval.",
111
+ "name": "intervalLow",
112
+ "type": "number"
113
+ },
114
+ {
115
+ "default": 0.0,
116
+ "description": "Upper bound of the last computed credible interval.",
117
+ "name": "intervalHigh",
118
+ "type": "number"
119
+ },
120
+ {
121
+ "default": 0.0,
122
+ "description": "Number of observations folded into the posterior so far.",
123
+ "name": "observations",
124
+ "type": "number"
125
+ },
126
+ {
127
+ "default": "idle",
128
+ "name": "status",
129
+ "type": "string",
130
+ "values": [
131
+ "idle",
132
+ "insufficient",
133
+ "mastered",
134
+ "remediate"
135
+ ]
136
+ }
137
+ ],
138
+ "id": "ent_01KYBM8SPD24VMR9HBQY0RM82A",
139
+ "name": "Posterior",
140
+ "persistence": "runtime"
141
+ },
142
+ "id": "orb_01KYBM8SPCWYRYTP9GG343Z4JN",
143
+ "name": "MlPosteriorOrbital",
144
+ "pages": [
145
+ {
146
+ "id": "pag_01KYBM8SPEWW6AQ9C7AXCKFTJM",
147
+ "name": "MlPosteriorPage",
148
+ "path": "/ml-posterior",
149
+ "traits": [
150
+ {
151
+ "ref": "PosteriorBelief",
152
+ "refId": "trt_01KYBM8SPDR0V9Y61Y00APN1PT"
153
+ }
154
+ ]
155
+ }
156
+ ],
157
+ "traits": [
158
+ {
159
+ "category": "lifecycle",
160
+ "config": {
161
+ "intervalWidthMax": {
162
+ "default": 0.3,
163
+ "description": "Above this width the posterior is too uncertain to decide — abstain with EVIDENCE_INSUFFICIENT.",
164
+ "label": "Max credible-interval width",
165
+ "tier": "policy",
166
+ "type": "float"
167
+ },
168
+ "masteryFloor": {
169
+ "default": 0.8,
170
+ "description": "Posterior mean at or above this, with a tight interval, licenses MASTERY_REACHED.",
171
+ "label": "Mastery floor",
172
+ "tier": "policy",
173
+ "type": "float"
174
+ },
175
+ "priorAlpha": {
176
+ "default": 1.0,
177
+ "description": "Beta prior success pseudo-count before any observation.",
178
+ "label": "Prior alpha",
179
+ "tier": "domain",
180
+ "type": "float"
181
+ },
182
+ "priorBeta": {
183
+ "default": 1.0,
184
+ "description": "Beta prior failure pseudo-count before any observation.",
185
+ "label": "Prior beta",
186
+ "tier": "domain",
187
+ "type": "float"
188
+ },
189
+ "remediationCeiling": {
190
+ "default": 0.4,
191
+ "description": "Posterior mean at or below this, with a tight interval, licenses REMEDIATION_NEEDED.",
192
+ "label": "Remediation ceiling",
193
+ "tier": "policy",
194
+ "type": "float"
195
+ },
196
+ "sampleCount": {
197
+ "default": 200.0,
198
+ "description": "Number of Monte Carlo draws from the Beta posterior used to estimate the credible interval.",
199
+ "label": "Posterior sample count",
200
+ "tier": "infra",
201
+ "type": "int"
202
+ }
203
+ },
204
+ "emits": [
205
+ {
206
+ "description": "The posterior mean clears masteryFloor with a credible interval narrow enough to trust.",
207
+ "event": "MASTERY_REACHED",
208
+ "eventId": "evt_01KYBM8SPDPGKNPVWPME4HZA7C",
209
+ "payloadSchema": [
210
+ {
211
+ "name": "mean",
212
+ "required": true,
213
+ "type": "float"
214
+ },
215
+ {
216
+ "name": "intervalLow",
217
+ "required": true,
218
+ "type": "float"
219
+ },
220
+ {
221
+ "name": "intervalHigh",
222
+ "required": true,
223
+ "type": "float"
224
+ }
225
+ ],
226
+ "scope": "external",
227
+ "tier": "primary"
228
+ },
229
+ {
230
+ "description": "The posterior mean is at or below remediationCeiling with a credible interval narrow enough to trust.",
231
+ "event": "REMEDIATION_NEEDED",
232
+ "eventId": "evt_01KYBM8SPDW5ZGB5SDCQD74JSB",
233
+ "payloadSchema": [
234
+ {
235
+ "name": "mean",
236
+ "required": true,
237
+ "type": "float"
238
+ },
239
+ {
240
+ "name": "intervalLow",
241
+ "required": true,
242
+ "type": "float"
243
+ },
244
+ {
245
+ "name": "intervalHigh",
246
+ "required": true,
247
+ "type": "float"
248
+ }
249
+ ],
250
+ "scope": "external",
251
+ "tier": "primary"
252
+ },
253
+ {
254
+ "description": "The abstain — the credible interval is still wider than intervalWidthMax, so no verdict is licensed yet.",
255
+ "event": "EVIDENCE_INSUFFICIENT",
256
+ "eventId": "evt_01KYBM8SPDSVKBPWV2V0GTMS44",
257
+ "payloadSchema": [
258
+ {
259
+ "name": "mean",
260
+ "required": true,
261
+ "type": "float"
262
+ },
263
+ {
264
+ "name": "intervalLow",
265
+ "required": true,
266
+ "type": "float"
267
+ },
268
+ {
269
+ "name": "intervalHigh",
270
+ "required": true,
271
+ "type": "float"
272
+ }
273
+ ],
274
+ "scope": "external",
275
+ "tier": "primary"
276
+ }
277
+ ],
278
+ "entityContract": {
279
+ "provides": [
280
+ "alpha",
281
+ "beta",
282
+ "intervalHigh",
283
+ "intervalLow",
284
+ "mean",
285
+ "observations",
286
+ "status"
287
+ ],
288
+ "requires": []
289
+ },
290
+ "entityRebindable": true,
291
+ "entityRefIds": {
292
+ "Posterior": "ent_01KYBM8SPD24VMR9HBQY0RM82A"
293
+ },
294
+ "id": "trt_01KYBM8SPDR0V9Y61Y00APN1PT",
295
+ "linkedEntity": "Posterior",
296
+ "linkedEntityId": "ent_01KYBM8SPD24VMR9HBQY0RM82A",
297
+ "name": "PosteriorBelief",
298
+ "scope": "instance",
299
+ "stateMachine": {
300
+ "events": [
301
+ {
302
+ "id": "evt_01KYBM8SPDEVSWTYZ4MWW9NPR1",
303
+ "key": "INIT",
304
+ "name": "Initialize"
305
+ },
306
+ {
307
+ "id": "evt_01KYBM8SPDZNET4JJKM8MJ8TYE",
308
+ "key": "OBSERVE",
309
+ "name": "Observe",
310
+ "payloadSchema": [
311
+ {
312
+ "name": "outcome",
313
+ "required": true,
314
+ "type": "boolean"
315
+ }
316
+ ]
317
+ },
318
+ {
319
+ "description": "The posterior mean clears masteryFloor with a credible interval narrow enough to trust.",
320
+ "id": "evt_01KYBM8SPDPGKNPVWPME4HZA7C",
321
+ "key": "MASTERY_REACHED",
322
+ "name": "Mastery Reached",
323
+ "payloadSchema": [
324
+ {
325
+ "name": "mean",
326
+ "required": true,
327
+ "type": "float"
328
+ },
329
+ {
330
+ "name": "intervalLow",
331
+ "required": true,
332
+ "type": "float"
333
+ },
334
+ {
335
+ "name": "intervalHigh",
336
+ "required": true,
337
+ "type": "float"
338
+ }
339
+ ],
340
+ "tier": "primary"
341
+ },
342
+ {
343
+ "description": "The posterior mean is at or below remediationCeiling with a credible interval narrow enough to trust.",
344
+ "id": "evt_01KYBM8SPDW5ZGB5SDCQD74JSB",
345
+ "key": "REMEDIATION_NEEDED",
346
+ "name": "Remediation Needed",
347
+ "payloadSchema": [
348
+ {
349
+ "name": "mean",
350
+ "required": true,
351
+ "type": "float"
352
+ },
353
+ {
354
+ "name": "intervalLow",
355
+ "required": true,
356
+ "type": "float"
357
+ },
358
+ {
359
+ "name": "intervalHigh",
360
+ "required": true,
361
+ "type": "float"
362
+ }
363
+ ],
364
+ "tier": "primary"
365
+ },
366
+ {
367
+ "description": "The abstain — the credible interval is still wider than intervalWidthMax, so no verdict is licensed yet.",
368
+ "id": "evt_01KYBM8SPDSVKBPWV2V0GTMS44",
369
+ "key": "EVIDENCE_INSUFFICIENT",
370
+ "name": "Evidence Insufficient",
371
+ "payloadSchema": [
372
+ {
373
+ "name": "mean",
374
+ "required": true,
375
+ "type": "float"
376
+ },
377
+ {
378
+ "name": "intervalLow",
379
+ "required": true,
380
+ "type": "float"
381
+ },
382
+ {
383
+ "name": "intervalHigh",
384
+ "required": true,
385
+ "type": "float"
386
+ }
387
+ ],
388
+ "tier": "primary"
389
+ }
390
+ ],
391
+ "states": [
392
+ {
393
+ "isInitial": true,
394
+ "name": "idle"
395
+ }
396
+ ],
397
+ "transitions": [
398
+ {
399
+ "effects": [
400
+ [
401
+ "set",
402
+ "@entity.alpha",
403
+ "@config.priorAlpha"
404
+ ],
405
+ [
406
+ "set",
407
+ "@entity.beta",
408
+ "@config.priorBeta"
409
+ ],
410
+ [
411
+ "set",
412
+ "@entity.mean",
413
+ [
414
+ "/",
415
+ "@config.priorAlpha",
416
+ [
417
+ "+",
418
+ "@config.priorAlpha",
419
+ "@config.priorBeta"
420
+ ]
421
+ ]
422
+ ],
423
+ [
424
+ "set",
425
+ "@entity.intervalLow",
426
+ 0.0
427
+ ],
428
+ [
429
+ "set",
430
+ "@entity.intervalHigh",
431
+ 0.0
432
+ ],
433
+ [
434
+ "set",
435
+ "@entity.observations",
436
+ 0.0
437
+ ],
438
+ [
439
+ "set",
440
+ "@entity.status",
441
+ "idle"
442
+ ]
443
+ ],
444
+ "event": "INIT",
445
+ "eventId": "evt_01KYBM8SPDEVSWTYZ4MWW9NPR1",
446
+ "from": "idle",
447
+ "to": "idle"
448
+ },
449
+ {
450
+ "effects": [
451
+ [
452
+ "set",
453
+ "@entity.alpha",
454
+ [
455
+ "if",
456
+ "@payload.outcome",
457
+ [
458
+ "+",
459
+ "@entity.alpha",
460
+ 1.0
461
+ ],
462
+ "@entity.alpha"
463
+ ]
464
+ ],
465
+ [
466
+ "set",
467
+ "@entity.beta",
468
+ [
469
+ "if",
470
+ "@payload.outcome",
471
+ "@entity.beta",
472
+ [
473
+ "+",
474
+ "@entity.beta",
475
+ 1.0
476
+ ]
477
+ ]
478
+ ],
479
+ [
480
+ "set",
481
+ "@entity.observations",
482
+ [
483
+ "+",
484
+ "@entity.observations",
485
+ 1.0
486
+ ]
487
+ ],
488
+ [
489
+ "set",
490
+ "@entity.mean",
491
+ [
492
+ "/",
493
+ "@entity.alpha",
494
+ [
495
+ "+",
496
+ "@entity.alpha",
497
+ "@entity.beta"
498
+ ]
499
+ ]
500
+ ],
501
+ [
502
+ "let",
503
+ [
504
+ [
505
+ "samples",
506
+ [
507
+ "prob/sample",
508
+ "@config.sampleCount",
509
+ [
510
+ "prob/beta",
511
+ "@entity.alpha",
512
+ "@entity.beta"
513
+ ]
514
+ ]
515
+ ],
516
+ [
517
+ "interval",
518
+ [
519
+ "prob/credible-interval",
520
+ "@samples",
521
+ 0.05
522
+ ]
523
+ ],
524
+ [
525
+ "low",
526
+ [
527
+ "array/nth",
528
+ "@interval",
529
+ 0.0
530
+ ]
531
+ ],
532
+ [
533
+ "high",
534
+ [
535
+ "array/nth",
536
+ "@interval",
537
+ 1.0
538
+ ]
539
+ ],
540
+ [
541
+ "width",
542
+ [
543
+ "-",
544
+ "@high",
545
+ "@low"
546
+ ]
547
+ ]
548
+ ],
549
+ [
550
+ "do",
551
+ [
552
+ "set",
553
+ "@entity.intervalLow",
554
+ "@low"
555
+ ],
556
+ [
557
+ "set",
558
+ "@entity.intervalHigh",
559
+ "@high"
560
+ ],
561
+ [
562
+ "if",
563
+ [
564
+ ">",
565
+ "@width",
566
+ "@config.intervalWidthMax"
567
+ ],
568
+ [
569
+ "do",
570
+ [
571
+ "set",
572
+ "@entity.status",
573
+ "insufficient"
574
+ ],
575
+ [
576
+ "emit",
577
+ "EVIDENCE_INSUFFICIENT",
578
+ {
579
+ "intervalHigh": "@high",
580
+ "intervalLow": "@low",
581
+ "mean": "@entity.mean"
582
+ }
583
+ ]
584
+ ],
585
+ [
586
+ "if",
587
+ [
588
+ ">=",
589
+ "@entity.mean",
590
+ "@config.masteryFloor"
591
+ ],
592
+ [
593
+ "do",
594
+ [
595
+ "set",
596
+ "@entity.status",
597
+ "mastered"
598
+ ],
599
+ [
600
+ "emit",
601
+ "MASTERY_REACHED",
602
+ {
603
+ "intervalHigh": "@high",
604
+ "intervalLow": "@low",
605
+ "mean": "@entity.mean"
606
+ }
607
+ ]
608
+ ],
609
+ [
610
+ "if",
611
+ [
612
+ "<=",
613
+ "@entity.mean",
614
+ "@config.remediationCeiling"
615
+ ],
616
+ [
617
+ "do",
618
+ [
619
+ "set",
620
+ "@entity.status",
621
+ "remediate"
622
+ ],
623
+ [
624
+ "emit",
625
+ "REMEDIATION_NEEDED",
626
+ {
627
+ "intervalHigh": "@high",
628
+ "intervalLow": "@low",
629
+ "mean": "@entity.mean"
630
+ }
631
+ ]
632
+ ],
633
+ [
634
+ "do",
635
+ [
636
+ "set",
637
+ "@entity.status",
638
+ "insufficient"
639
+ ],
640
+ [
641
+ "emit",
642
+ "EVIDENCE_INSUFFICIENT",
643
+ {
644
+ "intervalHigh": "@high",
645
+ "intervalLow": "@low",
646
+ "mean": "@entity.mean"
647
+ }
648
+ ]
649
+ ]
650
+ ]
651
+ ]
652
+ ]
653
+ ]
654
+ ]
655
+ ],
656
+ "event": "OBSERVE",
657
+ "eventId": "evt_01KYBM8SPDZNET4JJKM8MJ8TYE",
658
+ "from": "idle",
659
+ "to": "idle"
660
+ }
661
+ ]
662
+ }
663
+ }
664
+ ]
665
+ }
666
+ ],
667
+ "schemaVersion": 1,
668
+ "version": "1.0.0"
669
+ }