@almadar/std 16.173.0 → 16.175.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 (220) hide show
  1. package/behaviors/lolo/infra/atoms/std-cross-reference.lolo +2 -4
  2. package/behaviors/lolo/ui/core/atoms/std-board.lolo +5 -9
  3. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +8 -1
  4. package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +2 -2
  5. package/behaviors/lolo/ui/core/atoms/std-event-log.lolo +3 -7
  6. package/behaviors/lolo/ui/core/atoms/std-form-advanced.lolo +1 -1
  7. package/behaviors/lolo/ui/core/atoms/std-image-upload-multi.lolo +1 -1
  8. package/behaviors/lolo/ui/core/atoms/std-list.lolo +3 -3
  9. package/behaviors/lolo/ui/core/atoms/std-modal.lolo +2 -2
  10. package/behaviors/lolo/ui/core/atoms/std-multi-party-flow.lolo +2 -4
  11. package/behaviors/lolo/ui/core/atoms/std-rating-review.lolo +5 -13
  12. package/behaviors/lolo/ui/core/atoms/std-recurrence.lolo +3 -7
  13. package/behaviors/lolo/ui/core/atoms/std-saved-search.lolo +1 -1
  14. package/behaviors/lolo/ui/core/atoms/std-signature-capture.lolo +2 -2
  15. package/behaviors/lolo/ui/core/atoms/std-step-flow.lolo +2 -4
  16. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +1 -1
  17. package/behaviors/lolo/ui/core/atoms/std-thread.lolo +2 -2
  18. package/behaviors/lolo/ui/core/atoms/std-vote.lolo +2 -2
  19. package/behaviors/lolo/ui/core/atoms/std-wizard.lolo +3 -7
  20. package/behaviors/lolo/ui/core/atoms/ui-atlas-image.lolo +1 -1
  21. package/behaviors/lolo/ui/core/atoms/ui-atlas-panel.lolo +1 -1
  22. package/behaviors/lolo/ui/core/atoms/ui-center.lolo +1 -1
  23. package/behaviors/lolo/ui/core/atoms/ui-hstack.lolo +1 -1
  24. package/behaviors/lolo/ui/core/atoms/ui-icon.lolo +1 -1
  25. package/behaviors/lolo/ui/core/atoms/ui-stack.lolo +1 -1
  26. package/behaviors/lolo/ui/core/atoms/ui-typography.lolo +1 -1
  27. package/behaviors/lolo/ui/core/atoms/ui-vstack.lolo +1 -1
  28. package/behaviors/lolo/ui/core/molecules/ui-content-renderer.lolo +1 -1
  29. package/behaviors/lolo/ui/core/molecules/ui-form-layout.lolo +1 -1
  30. package/behaviors/lolo/ui/core/molecules/ui-grid.lolo +1 -1
  31. package/behaviors/lolo/ui/core/molecules/ui-table-view.lolo +4 -9
  32. package/behaviors/lolo/ui/core/organisms/ui-chat-bar.lolo +1 -1
  33. package/behaviors/lolo/ui/core/organisms/ui-dashboard-grid.lolo +1 -1
  34. package/behaviors/lolo/ui/core/organisms/ui-detail-panel.lolo +1 -1
  35. package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +1 -1
  36. package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +1 -1
  37. package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +1 -1
  38. package/behaviors/lolo/ui/core/organisms/ui-form-section.lolo +9 -3
  39. package/behaviors/lolo/ui/core/organisms/ui-form.lolo +9 -3
  40. package/behaviors/lolo/ui/core/organisms/ui-master-detail.lolo +1 -1
  41. package/behaviors/lolo/ui/core/organisms/ui-media-gallery.lolo +1 -1
  42. package/behaviors/lolo/ui/core/organisms/ui-segment-renderer.lolo +7 -1
  43. package/behaviors/lolo/ui/core/organisms/ui-stat-card.lolo +1 -1
  44. package/behaviors/lolo/ui/core/organisms/ui-subagent-trace-panel.lolo +1 -1
  45. package/behaviors/lolo/ui/game/atoms/ui-action-tile.lolo +1 -1
  46. package/behaviors/lolo/ui/game/atoms/ui-draw-shape-layer.lolo +41 -9
  47. package/behaviors/lolo/ui/game/atoms/ui-draw-shape.lolo +40 -8
  48. package/behaviors/lolo/ui/game/atoms/ui-draw-sprite-layer.lolo +13 -3
  49. package/behaviors/lolo/ui/game/atoms/ui-draw-sprite.lolo +12 -2
  50. package/behaviors/lolo/ui/game/atoms/ui-draw-text-layer.lolo +3 -3
  51. package/behaviors/lolo/ui/game/atoms/ui-draw-text.lolo +2 -2
  52. package/behaviors/lolo/ui/game/organisms/std-tactics-board-3d.lolo +32 -2
  53. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +133 -23
  54. package/behaviors/lolo/ui/learning/atoms/std-learn-compare.lolo +397 -0
  55. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +537 -0
  56. package/behaviors/lolo/ui/learning/atoms/std-learn-derivation.lolo +428 -0
  57. package/behaviors/lolo/ui/learning/atoms/std-learn-doser.lolo +520 -0
  58. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +419 -0
  59. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +591 -0
  60. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +425 -0
  61. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +398 -0
  62. package/behaviors/lolo/ui/learning/atoms/std-learn-measure.lolo +325 -0
  63. package/behaviors/lolo/ui/learning/atoms/std-learn-perturb.lolo +494 -0
  64. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +408 -0
  65. package/behaviors/lolo/ui/learning/atoms/std-learn-scatter-fit.lolo +805 -0
  66. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +307 -0
  67. package/behaviors/lolo/ui/learning/atoms/std-learn-sim-3d.lolo +318 -0
  68. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +336 -0
  69. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +409 -0
  70. package/behaviors/lolo/ui/learning/atoms/std-learn-transport.lolo +186 -0
  71. package/behaviors/lolo/ui/learning/atoms/std-learn-tree.lolo +522 -0
  72. package/behaviors/lolo/ui/learning/atoms/ui-algo-graph-canvas.lolo +192 -0
  73. package/behaviors/lolo/ui/learning/atoms/ui-algorithm-canvas.lolo +111 -2
  74. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +193 -5
  75. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +173 -5
  76. package/behaviors/lolo/ui/learning/atoms/ui-learning-canvas.lolo +48 -1
  77. package/behaviors/lolo/ui/learning/atoms/ui-math-canvas.lolo +141 -1
  78. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +242 -5
  79. package/behaviors/lolo/ui/marketing/organisms/ui-book-viewer.lolo +1 -1
  80. package/behaviors/lolo/ui/marketing/organisms/ui-case-study-organism.lolo +1 -1
  81. package/behaviors/lolo/ui/marketing/organisms/ui-feature-grid-organism.lolo +1 -1
  82. package/behaviors/lolo/ui/marketing/organisms/ui-hero-organism.lolo +1 -1
  83. package/behaviors/lolo/ui/marketing/organisms/ui-pricing-organism.lolo +1 -1
  84. package/behaviors/lolo/ui/marketing/organisms/ui-showcase-organism.lolo +1 -1
  85. package/behaviors/lolo/ui/marketing/organisms/ui-stats-organism.lolo +1 -1
  86. package/behaviors/lolo/ui/marketing/organisms/ui-step-flow-organism.lolo +1 -1
  87. package/behaviors/lolo/ui/marketing/organisms/ui-team-organism.lolo +1 -1
  88. package/behaviors/registry/agent/atoms/std-agent-session.orb +22 -1
  89. package/behaviors/registry/agent/atoms/std-agent-tool-call.orb +38 -2
  90. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +38 -2
  91. package/behaviors/registry/agent/organisms/std-agent-rabit.orb +23 -1
  92. package/behaviors/registry/infra/atoms/std-approval-gate.orb +8 -16
  93. package/behaviors/registry/infra/atoms/std-cache-aside.orb +31 -62
  94. package/behaviors/registry/infra/atoms/std-circuit-breaker.orb +16 -32
  95. package/behaviors/registry/infra/atoms/std-cross-reference.orb +32 -4
  96. package/behaviors/registry/infra/atoms/std-data-erasure.orb +8 -16
  97. package/behaviors/registry/infra/atoms/std-mod-queue.orb +8 -16
  98. package/behaviors/registry/infra/atoms/std-rate-limiter.orb +14 -28
  99. package/behaviors/registry/infra/atoms/std-row-access-control.orb +30 -2
  100. package/behaviors/registry/ui/core/atoms/std-billable-hour.orb +1 -2
  101. package/behaviors/registry/ui/core/atoms/std-board.orb +19 -5
  102. package/behaviors/registry/ui/core/atoms/std-browse.orb +29 -7
  103. package/behaviors/registry/ui/core/atoms/std-dashboard-grid-embedded.orb +1 -2
  104. package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +3 -5
  105. package/behaviors/registry/ui/core/atoms/std-esign-request.orb +3 -6
  106. package/behaviors/registry/ui/core/atoms/std-event-log.orb +17 -3
  107. package/behaviors/registry/ui/core/atoms/std-export.orb +2 -4
  108. package/behaviors/registry/ui/core/atoms/std-form-advanced.orb +1 -1
  109. package/behaviors/registry/ui/core/atoms/std-gallery.orb +9 -18
  110. package/behaviors/registry/ui/core/atoms/std-graphs.orb +15 -1
  111. package/behaviors/registry/ui/core/atoms/std-import.orb +2 -4
  112. package/behaviors/registry/ui/core/atoms/std-list.orb +4 -6
  113. package/behaviors/registry/ui/core/atoms/std-modal.orb +2 -2
  114. package/behaviors/registry/ui/core/atoms/std-multi-party-flow.orb +16 -2
  115. package/behaviors/registry/ui/core/atoms/std-pagination.orb +15 -1
  116. package/behaviors/registry/ui/core/atoms/std-rating-review.orb +19 -5
  117. package/behaviors/registry/ui/core/atoms/std-recurrence.orb +17 -3
  118. package/behaviors/registry/ui/core/atoms/std-rich-editor.orb +15 -1
  119. package/behaviors/registry/ui/core/atoms/std-scatter.orb +15 -1
  120. package/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
  121. package/behaviors/registry/ui/core/atoms/std-stats.orb +15 -1
  122. package/behaviors/registry/ui/core/atoms/std-step-flow.orb +16 -2
  123. package/behaviors/registry/ui/core/atoms/std-thread.orb +2 -2
  124. package/behaviors/registry/ui/core/atoms/std-vote.orb +2 -2
  125. package/behaviors/registry/ui/core/atoms/std-wizard.orb +17 -3
  126. package/behaviors/registry/ui/core/atoms/ui-atlas-image.orb +4 -1
  127. package/behaviors/registry/ui/core/atoms/ui-atlas-panel.orb +4 -1
  128. package/behaviors/registry/ui/core/atoms/ui-center.orb +4 -1
  129. package/behaviors/registry/ui/core/atoms/ui-hstack.orb +4 -1
  130. package/behaviors/registry/ui/core/atoms/ui-icon.orb +4 -1
  131. package/behaviors/registry/ui/core/atoms/ui-stack.orb +4 -1
  132. package/behaviors/registry/ui/core/atoms/ui-typography.orb +4 -1
  133. package/behaviors/registry/ui/core/atoms/ui-vstack.orb +4 -1
  134. package/behaviors/registry/ui/core/molecules/ui-accordion.orb +3 -3
  135. package/behaviors/registry/ui/core/molecules/ui-content-renderer.orb +4 -1
  136. package/behaviors/registry/ui/core/molecules/ui-form-layout.orb +4 -1
  137. package/behaviors/registry/ui/core/molecules/ui-grid.orb +4 -1
  138. package/behaviors/registry/ui/core/molecules/ui-table-view.orb +4 -39
  139. package/behaviors/registry/ui/core/molecules/ui-tabs.orb +2 -2
  140. package/behaviors/registry/ui/core/molecules/ui-wizard-container.orb +1 -1
  141. package/behaviors/registry/ui/core/organisms/ui-chat-bar.orb +4 -1
  142. package/behaviors/registry/ui/core/organisms/ui-dashboard-grid.orb +5 -2
  143. package/behaviors/registry/ui/core/organisms/ui-detail-panel.orb +5 -2
  144. package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +4 -1
  145. package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +4 -1
  146. package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +4 -1
  147. package/behaviors/registry/ui/core/organisms/ui-form-section.orb +34 -2
  148. package/behaviors/registry/ui/core/organisms/ui-form.orb +34 -2
  149. package/behaviors/registry/ui/core/organisms/ui-master-detail.orb +4 -1
  150. package/behaviors/registry/ui/core/organisms/ui-media-gallery.orb +4 -1
  151. package/behaviors/registry/ui/core/organisms/ui-segment-renderer.orb +24 -2
  152. package/behaviors/registry/ui/core/organisms/ui-stat-card.orb +4 -1
  153. package/behaviors/registry/ui/core/organisms/ui-subagent-trace-panel.orb +4 -1
  154. package/behaviors/registry/ui/core/organisms/ui-tabbed-container.orb +1 -1
  155. package/behaviors/registry/ui/core/organisms/ui-ui-slot-renderer.orb +1 -1
  156. package/behaviors/registry/ui/game/atoms/std-fx-particles.orb +35 -1
  157. package/behaviors/registry/ui/game/atoms/ui-action-tile.orb +4 -1
  158. package/behaviors/registry/ui/game/atoms/ui-draw-shape-layer.orb +183 -13
  159. package/behaviors/registry/ui/game/atoms/ui-draw-shape.orb +104 -9
  160. package/behaviors/registry/ui/game/atoms/ui-draw-sprite-layer.orb +56 -2
  161. package/behaviors/registry/ui/game/atoms/ui-draw-sprite.orb +36 -4
  162. package/behaviors/registry/ui/game/atoms/ui-draw-text-layer.orb +21 -2
  163. package/behaviors/registry/ui/game/atoms/ui-draw-text.orb +19 -4
  164. package/behaviors/registry/ui/game/organisms/std-tactics-board-3d.orb +173 -2
  165. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1288 -197
  166. package/behaviors/registry/ui/learning/atoms/std-learn-compare.orb +2814 -0
  167. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +3183 -0
  168. package/behaviors/registry/ui/learning/atoms/std-learn-derivation.orb +2512 -0
  169. package/behaviors/registry/ui/learning/atoms/std-learn-doser.orb +3678 -0
  170. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +2394 -0
  171. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +3951 -0
  172. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +3458 -0
  173. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +2646 -0
  174. package/behaviors/registry/ui/learning/atoms/std-learn-measure.orb +1979 -0
  175. package/behaviors/registry/ui/learning/atoms/std-learn-perturb.orb +2994 -0
  176. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +2682 -0
  177. package/behaviors/registry/ui/learning/atoms/std-learn-scatter-fit.orb +6539 -0
  178. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +1842 -0
  179. package/behaviors/registry/ui/learning/atoms/std-learn-sim-3d.orb +1648 -0
  180. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +2307 -0
  181. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +3118 -0
  182. package/behaviors/registry/ui/learning/atoms/std-learn-transport.orb +986 -0
  183. package/behaviors/registry/ui/learning/atoms/std-learn-tree.orb +3333 -0
  184. package/behaviors/registry/ui/learning/atoms/ui-algo-graph-canvas.orb +716 -0
  185. package/behaviors/registry/ui/learning/atoms/ui-algorithm-canvas.orb +679 -5
  186. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +962 -18
  187. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +919 -30
  188. package/behaviors/registry/ui/learning/atoms/ui-learning-canvas.orb +372 -1
  189. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +936 -16
  190. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +1328 -43
  191. package/behaviors/registry/ui/marketing/atoms/std-marketing-article.orb +1 -2
  192. package/behaviors/registry/ui/marketing/atoms/std-marketing-footer.orb +1 -2
  193. package/behaviors/registry/ui/marketing/atoms/std-marketing-split.orb +1 -2
  194. package/behaviors/registry/ui/marketing/atoms/std-marketing-stats.orb +1 -2
  195. package/behaviors/registry/ui/marketing/atoms/std-marketing-steps.orb +1 -2
  196. package/behaviors/registry/ui/marketing/atoms/std-marketing-team.orb +1 -2
  197. package/behaviors/registry/ui/marketing/organisms/ui-book-viewer.orb +4 -1
  198. package/behaviors/registry/ui/marketing/organisms/ui-case-study-organism.orb +4 -1
  199. package/behaviors/registry/ui/marketing/organisms/ui-feature-grid-organism.orb +4 -1
  200. package/behaviors/registry/ui/marketing/organisms/ui-hero-organism.orb +4 -1
  201. package/behaviors/registry/ui/marketing/organisms/ui-pricing-organism.orb +4 -1
  202. package/behaviors/registry/ui/marketing/organisms/ui-showcase-organism.orb +4 -1
  203. package/behaviors/registry/ui/marketing/organisms/ui-stats-organism.orb +4 -1
  204. package/behaviors/registry/ui/marketing/organisms/ui-step-flow-organism.orb +4 -1
  205. package/behaviors/registry/ui/marketing/organisms/ui-team-organism.orb +4 -1
  206. package/dist/behaviors/exports-reader.js +3704 -2189
  207. package/dist/behaviors/functions/index.d.ts +2638 -254
  208. package/dist/behaviors/functions/index.js +3648 -2190
  209. package/dist/behaviors/index.d.ts +1 -1
  210. package/dist/behaviors/index.js +3705 -2190
  211. package/dist/behaviors/query.js +3704 -2189
  212. package/dist/behaviors-embeddings.hash.json +3 -3
  213. package/dist/behaviors-embeddings.json +289 -213
  214. package/dist/behaviors-registry.json +7900 -587
  215. package/dist/index.d.ts +1 -1
  216. package/dist/index.js +3705 -2190
  217. package/dist/knob-embeddings.hash.json +3 -3
  218. package/dist/knob-embeddings.json +1 -1
  219. package/dist/registry/factory-signatures.json +1 -1
  220. package/package.json +2 -2
@@ -0,0 +1,2512 @@
1
+ {
2
+ "description": "Generic goal-directed derivation/proof-builder instrument — config-declared starting lines (facts and two-sided links) sit in a scrollable derivation panel with per-line badges, a roster of config-declared candidate steps render as buttons, and picking one dynamically matches it against the CURRENT lines (a left/right side of some link plus a same/opposite negation sense) to derive a new line, appending it with config-declared badge styling on success or surfacing a config-declared feedback string on failure; an inline clock can auto-apply the first applicable candidate every autoApplyIntervalMs while running, a Reset restores the starting lines, and the goal is reached when a derived line's label matches the config-declared goal label. Left/right and same/opposite are structural roles, not domain vocabulary, so the same matching mechanism serves propositional inference, chained implications, precursor/product chemistry, or any other two-sided-relation derivation on a biology-canvas-free text panel. Standalone by default; behind a lab router set matchMode and it renders only when MODE_SELECTED matches.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01M0CGJFW9Z93KB1TW33WPHER1": {
6
+ "bakedName": "LearnDerivationScene",
7
+ "curName": "LearnDerivationScene",
8
+ "id": "ent_01M0CGJFW9Z93KB1TW33WPHER1",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01M0CGJFW96K8FBC6WV4D341YQ": {
14
+ "bakedName": "MODE_SELECTED",
15
+ "curName": "MODE_SELECTED",
16
+ "id": "evt_01M0CGJFW96K8FBC6WV4D341YQ",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH",
20
+ "renames": []
21
+ },
22
+ "evt_01M0CGJFW98W2XTBPXCK1DWBHW": {
23
+ "bakedName": "RESET",
24
+ "curName": "RESET",
25
+ "id": "evt_01M0CGJFW98W2XTBPXCK1DWBHW",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH",
29
+ "renames": []
30
+ },
31
+ "evt_01M0CGJFW9AA9N4C7ADX4VGB15": {
32
+ "bakedName": "APPLY_STEP",
33
+ "curName": "APPLY_STEP",
34
+ "id": "evt_01M0CGJFW9AA9N4C7ADX4VGB15",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH",
38
+ "renames": []
39
+ },
40
+ "evt_01M0CGJFW9FJVWEPW6PZH91R9A": {
41
+ "bakedName": "INIT",
42
+ "curName": "INIT",
43
+ "id": "evt_01M0CGJFW9FJVWEPW6PZH91R9A",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH",
47
+ "renames": []
48
+ },
49
+ "evt_01M0CGJFW9HC02BTAY2QGW6ZNE": {
50
+ "bakedName": "DERIVATION_UPDATED",
51
+ "curName": "DERIVATION_UPDATED",
52
+ "id": "evt_01M0CGJFW9HC02BTAY2QGW6ZNE",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH",
56
+ "renames": []
57
+ },
58
+ "evt_01M0CGJFW9S6N0YP8GJFD54KXA": {
59
+ "bakedName": "TOGGLE_RUN",
60
+ "curName": "TOGGLE_RUN",
61
+ "id": "evt_01M0CGJFW9S6N0YP8GJFD54KXA",
62
+ "kind": "event",
63
+ "owner": "workspace",
64
+ "parent": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH",
65
+ "renames": []
66
+ },
67
+ "orb_01M0CGJFW9KQ380JGA7R8T6ZCR": {
68
+ "bakedName": "LearnDerivationOrbital",
69
+ "curName": "LearnDerivationOrbital",
70
+ "id": "orb_01M0CGJFW9KQ380JGA7R8T6ZCR",
71
+ "kind": "orbital",
72
+ "owner": "workspace",
73
+ "renames": []
74
+ },
75
+ "pag_01M0CGJFW9TZY33G343TZGVYYT": {
76
+ "bakedName": "LearnDerivationPage",
77
+ "curName": "LearnDerivationPage",
78
+ "id": "pag_01M0CGJFW9TZY33G343TZGVYYT",
79
+ "kind": "page",
80
+ "owner": "workspace",
81
+ "renames": []
82
+ },
83
+ "trt_01M0CGJFW9PRAPQTAZS9GBDEVH": {
84
+ "bakedName": "LearnDerivationSim",
85
+ "curName": "LearnDerivationSim",
86
+ "id": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH",
87
+ "kind": "trait",
88
+ "owner": "workspace",
89
+ "renames": []
90
+ }
91
+ },
92
+ "schemaVersion": 1
93
+ },
94
+ "name": "std-learn-derivation",
95
+ "orbitals": [
96
+ {
97
+ "entity": {
98
+ "fields": [
99
+ {
100
+ "name": "id",
101
+ "required": true,
102
+ "type": "string"
103
+ },
104
+ {
105
+ "default": false,
106
+ "name": "active",
107
+ "type": "boolean"
108
+ },
109
+ {
110
+ "name": "title",
111
+ "type": "string"
112
+ },
113
+ {
114
+ "items": {
115
+ "properties": {
116
+ "badgeLabel": {
117
+ "name": "badgeLabel",
118
+ "required": false,
119
+ "type": "string"
120
+ },
121
+ "badgeVariant": {
122
+ "name": "badgeVariant",
123
+ "required": false,
124
+ "type": "string"
125
+ },
126
+ "id": {
127
+ "name": "id",
128
+ "required": true,
129
+ "type": "string"
130
+ },
131
+ "kind": {
132
+ "name": "kind",
133
+ "required": true,
134
+ "type": "string",
135
+ "values": [
136
+ "fact",
137
+ "link"
138
+ ]
139
+ },
140
+ "label": {
141
+ "name": "label",
142
+ "required": true,
143
+ "type": "string"
144
+ },
145
+ "leftNegated": {
146
+ "name": "leftNegated",
147
+ "required": false,
148
+ "type": "boolean"
149
+ },
150
+ "leftSubject": {
151
+ "name": "leftSubject",
152
+ "required": false,
153
+ "type": "string"
154
+ },
155
+ "negated": {
156
+ "name": "negated",
157
+ "required": false,
158
+ "type": "boolean"
159
+ },
160
+ "rightNegated": {
161
+ "name": "rightNegated",
162
+ "required": false,
163
+ "type": "boolean"
164
+ },
165
+ "rightSubject": {
166
+ "name": "rightSubject",
167
+ "required": false,
168
+ "type": "string"
169
+ },
170
+ "subject": {
171
+ "name": "subject",
172
+ "required": false,
173
+ "type": "string"
174
+ }
175
+ },
176
+ "type": "object"
177
+ },
178
+ "name": "lines",
179
+ "type": "array"
180
+ },
181
+ {
182
+ "name": "feedback",
183
+ "type": "string"
184
+ },
185
+ {
186
+ "default": false,
187
+ "name": "goalReached",
188
+ "type": "boolean"
189
+ },
190
+ {
191
+ "default": false,
192
+ "name": "running",
193
+ "type": "boolean"
194
+ },
195
+ {
196
+ "default": 0.0,
197
+ "name": "elapsedMs",
198
+ "type": "number"
199
+ },
200
+ {
201
+ "name": "narration",
202
+ "type": "string"
203
+ },
204
+ {
205
+ "items": {
206
+ "type": "node"
207
+ },
208
+ "name": "renderChildren",
209
+ "type": "array"
210
+ }
211
+ ],
212
+ "id": "ent_01M0CGJFW9Z93KB1TW33WPHER1",
213
+ "name": "LearnDerivationScene",
214
+ "persistence": "runtime"
215
+ },
216
+ "id": "orb_01M0CGJFW9KQ380JGA7R8T6ZCR",
217
+ "name": "LearnDerivationOrbital",
218
+ "pages": [
219
+ {
220
+ "id": "pag_01M0CGJFW9TZY33G343TZGVYYT",
221
+ "name": "LearnDerivationPage",
222
+ "path": "/learn-derivation",
223
+ "traits": [
224
+ {
225
+ "ref": "LearnDerivationSim",
226
+ "refId": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH"
227
+ }
228
+ ]
229
+ }
230
+ ],
231
+ "traits": [
232
+ {
233
+ "category": "interaction",
234
+ "config": {
235
+ "autoApplyIntervalMs": {
236
+ "default": 800.0,
237
+ "description": "Milliseconds of running clock per automatic candidate application — the 32ms base tick accumulates elapsed time and applies the first applicable candidate each time this interval elapses.",
238
+ "label": "Auto-Apply Interval (ms)",
239
+ "tier": "domain",
240
+ "type": "number"
241
+ },
242
+ "autoRun": {
243
+ "default": false,
244
+ "description": "When true, INIT/MODE_SELECTED/Reset start the tick auto-applying candidates; toggle live with the Run/Pause button.",
245
+ "label": "Auto Run",
246
+ "tier": "domain",
247
+ "type": "boolean"
248
+ },
249
+ "autoRunOffMessage": {
250
+ "default": "Paused — apply steps manually.",
251
+ "description": "Feedback shown when Run is toggled off (Pause).",
252
+ "label": "Auto Run Off Message",
253
+ "tier": "presentation",
254
+ "type": "string"
255
+ },
256
+ "autoRunOnMessage": {
257
+ "default": "Auto-stepping — tick applies the next available step.",
258
+ "description": "Feedback shown when Run is toggled on.",
259
+ "label": "Auto Run On Message",
260
+ "tier": "presentation",
261
+ "type": "string"
262
+ },
263
+ "candidates": {
264
+ "default": [
265
+ {
266
+ "deriveNegationMode": "same",
267
+ "deriveSide": "right",
268
+ "key": "FORWARD",
269
+ "label": "Forward Rule",
270
+ "matchNegationMode": "same",
271
+ "matchSide": "left",
272
+ "noMatchFeedback": "No matching premises yet for the forward rule.",
273
+ "resultBadgeLabel": "DERIVED",
274
+ "resultBadgeVariant": "success"
275
+ },
276
+ {
277
+ "deriveNegationMode": "invert",
278
+ "deriveSide": "left",
279
+ "key": "BACKWARD",
280
+ "label": "Backward Rule",
281
+ "matchNegationMode": "opposite",
282
+ "matchSide": "right",
283
+ "noMatchFeedback": "No matching premises yet for the backward rule.",
284
+ "resultBadgeLabel": "DERIVED",
285
+ "resultBadgeVariant": "success"
286
+ }
287
+ ],
288
+ "description": "Candidate steps offered as buttons. Each declares which side of a link it matches against a current fact (matchSide/matchNegationMode) and which side it derives (deriveSide/deriveNegationMode) — left/right and same/opposite/invert are structural roles, not domain vocabulary, so the same two candidates can encode modus ponens/modus tollens, a forward/backward chemical rule, or any other two-sided derivation pair.",
289
+ "items": {
290
+ "properties": {
291
+ "deriveNegationMode": {
292
+ "name": "deriveNegationMode",
293
+ "required": true,
294
+ "type": "string",
295
+ "values": [
296
+ "same",
297
+ "invert"
298
+ ]
299
+ },
300
+ "deriveSide": {
301
+ "name": "deriveSide",
302
+ "required": true,
303
+ "type": "string",
304
+ "values": [
305
+ "left",
306
+ "right"
307
+ ]
308
+ },
309
+ "key": {
310
+ "name": "key",
311
+ "required": true,
312
+ "type": "string"
313
+ },
314
+ "label": {
315
+ "name": "label",
316
+ "required": true,
317
+ "type": "string"
318
+ },
319
+ "matchNegationMode": {
320
+ "name": "matchNegationMode",
321
+ "required": true,
322
+ "type": "string",
323
+ "values": [
324
+ "same",
325
+ "opposite"
326
+ ]
327
+ },
328
+ "matchSide": {
329
+ "name": "matchSide",
330
+ "required": true,
331
+ "type": "string",
332
+ "values": [
333
+ "left",
334
+ "right"
335
+ ]
336
+ },
337
+ "noMatchFeedback": {
338
+ "name": "noMatchFeedback",
339
+ "required": false,
340
+ "type": "string"
341
+ },
342
+ "resultBadgeLabel": {
343
+ "name": "resultBadgeLabel",
344
+ "required": false,
345
+ "type": "string"
346
+ },
347
+ "resultBadgeVariant": {
348
+ "name": "resultBadgeVariant",
349
+ "required": false,
350
+ "type": "string"
351
+ }
352
+ },
353
+ "type": "object"
354
+ },
355
+ "label": "Candidates",
356
+ "synonyms": "candidate, rule, step, inference rule, derivation rule, deduction rule",
357
+ "tier": "domain",
358
+ "type": "[LearnDerivationCandidate]"
359
+ },
360
+ "goalLabel": {
361
+ "default": "B",
362
+ "description": "The line label the learner is trying to derive; goalReached fires when a newly derived line's label equals this.",
363
+ "label": "Goal",
364
+ "synonyms": "target, goal, derivation target, conclusion",
365
+ "tier": "domain",
366
+ "type": "string"
367
+ },
368
+ "goalPrefix": {
369
+ "default": "Goal: derive ",
370
+ "description": "Text prepended to goalLabel to form the goal caption shown above the derivation panel.",
371
+ "label": "Goal Caption Prefix",
372
+ "tier": "presentation",
373
+ "type": "string"
374
+ },
375
+ "goalReachedMessage": {
376
+ "default": "Goal reached.",
377
+ "description": "Caption shown once goalReached is true.",
378
+ "label": "Goal Reached Message",
379
+ "tier": "presentation",
380
+ "type": "string"
381
+ },
382
+ "height": {
383
+ "default": 400.0,
384
+ "description": "Maximum height of the scrollable derivation panel, in pixels.",
385
+ "label": "Height",
386
+ "tier": "presentation",
387
+ "type": "number"
388
+ },
389
+ "matchMode": {
390
+ "default": "",
391
+ "description": "When composed behind a lab router, the MODE_SELECTED mode value this instrument responds to. Empty string means standalone — render immediately on INIT.",
392
+ "label": "Match Mode",
393
+ "tier": "presentation",
394
+ "type": "string"
395
+ },
396
+ "negationSymbol": {
397
+ "default": "¬",
398
+ "description": "Prefix prepended to a derived line's label when it is negated.",
399
+ "label": "Negation Symbol",
400
+ "tier": "presentation",
401
+ "type": "string"
402
+ },
403
+ "noStepAvailableMessage": {
404
+ "default": "No further steps are available yet.",
405
+ "description": "Feedback shown when the auto-apply tick finds no applicable candidate.",
406
+ "label": "No Step Available Message",
407
+ "tier": "presentation",
408
+ "type": "string"
409
+ },
410
+ "premises": {
411
+ "default": [
412
+ {
413
+ "badgeLabel": "GIVEN",
414
+ "badgeVariant": "neutral",
415
+ "id": "given-a",
416
+ "kind": "fact",
417
+ "label": "A",
418
+ "negated": false,
419
+ "subject": "A"
420
+ },
421
+ {
422
+ "badgeLabel": "RULE",
423
+ "badgeVariant": "info",
424
+ "id": "given-a-implies-b",
425
+ "kind": "link",
426
+ "label": "A → B",
427
+ "leftNegated": false,
428
+ "leftSubject": "A",
429
+ "rightNegated": false,
430
+ "rightSubject": "B"
431
+ }
432
+ ],
433
+ "description": "The starting lines of the derivation: plain facts (subject/negated) and two-sided links (leftSubject/leftNegated/rightSubject/rightNegated) the learner combines with candidate steps. Each line carries its own badgeLabel/badgeVariant.",
434
+ "items": {
435
+ "properties": {
436
+ "badgeLabel": {
437
+ "name": "badgeLabel",
438
+ "required": false,
439
+ "type": "string"
440
+ },
441
+ "badgeVariant": {
442
+ "name": "badgeVariant",
443
+ "required": false,
444
+ "type": "string"
445
+ },
446
+ "id": {
447
+ "name": "id",
448
+ "required": true,
449
+ "type": "string"
450
+ },
451
+ "kind": {
452
+ "name": "kind",
453
+ "required": true,
454
+ "type": "string",
455
+ "values": [
456
+ "fact",
457
+ "link"
458
+ ]
459
+ },
460
+ "label": {
461
+ "name": "label",
462
+ "required": true,
463
+ "type": "string"
464
+ },
465
+ "leftNegated": {
466
+ "name": "leftNegated",
467
+ "required": false,
468
+ "type": "boolean"
469
+ },
470
+ "leftSubject": {
471
+ "name": "leftSubject",
472
+ "required": false,
473
+ "type": "string"
474
+ },
475
+ "negated": {
476
+ "name": "negated",
477
+ "required": false,
478
+ "type": "boolean"
479
+ },
480
+ "rightNegated": {
481
+ "name": "rightNegated",
482
+ "required": false,
483
+ "type": "boolean"
484
+ },
485
+ "rightSubject": {
486
+ "name": "rightSubject",
487
+ "required": false,
488
+ "type": "string"
489
+ },
490
+ "subject": {
491
+ "name": "subject",
492
+ "required": false,
493
+ "type": "string"
494
+ }
495
+ },
496
+ "type": "object"
497
+ },
498
+ "label": "Premises",
499
+ "synonyms": "premise, given, starting line, hypothesis, starting statement",
500
+ "tier": "domain",
501
+ "type": "[LearnDerivationLine]"
502
+ },
503
+ "resetLabel": {
504
+ "default": "Reset",
505
+ "description": "Label text for the button that restores the starting premises.",
506
+ "label": "Reset Button Label",
507
+ "tier": "presentation",
508
+ "type": "string"
509
+ },
510
+ "title": {
511
+ "default": "Derivation Lab",
512
+ "description": "Title shown above the derivation panel.",
513
+ "label": "Title",
514
+ "tier": "presentation",
515
+ "type": "string"
516
+ },
517
+ "width": {
518
+ "default": 600.0,
519
+ "description": "Maximum width of the panel, in pixels.",
520
+ "label": "Width",
521
+ "tier": "presentation",
522
+ "type": "number"
523
+ }
524
+ },
525
+ "emits": [
526
+ {
527
+ "description": "The derivation state after each learner action — a composed listener (readout, grader) can subscribe; a harmless no-op when the atom runs standalone.",
528
+ "event": "DERIVATION_UPDATED",
529
+ "eventId": "evt_01M0CGJFW9HC02BTAY2QGW6ZNE",
530
+ "payloadSchema": [
531
+ {
532
+ "name": "feedback",
533
+ "type": "string"
534
+ },
535
+ {
536
+ "name": "goalReached",
537
+ "type": "boolean"
538
+ },
539
+ {
540
+ "name": "lineCount",
541
+ "type": "number"
542
+ },
543
+ {
544
+ "name": "narration",
545
+ "type": "string"
546
+ }
547
+ ],
548
+ "scope": "external",
549
+ "synonyms": "derivation update, proof step, derived line, candidate applied, goal reached",
550
+ "tier": "domain"
551
+ }
552
+ ],
553
+ "entityContract": {
554
+ "provides": [
555
+ "active",
556
+ "elapsedMs",
557
+ "feedback",
558
+ "goalReached",
559
+ "lines",
560
+ "narration",
561
+ "renderChildren",
562
+ "running",
563
+ "title"
564
+ ],
565
+ "requires": []
566
+ },
567
+ "entityRebindable": true,
568
+ "entityRefIds": {
569
+ "LearnDerivationScene": "ent_01M0CGJFW9Z93KB1TW33WPHER1"
570
+ },
571
+ "id": "trt_01M0CGJFW9PRAPQTAZS9GBDEVH",
572
+ "linkedEntity": "LearnDerivationScene",
573
+ "linkedEntityId": "ent_01M0CGJFW9Z93KB1TW33WPHER1",
574
+ "name": "LearnDerivationSim",
575
+ "scope": "instance",
576
+ "stateMachine": {
577
+ "events": [
578
+ {
579
+ "id": "evt_01M0CGJFW9FJVWEPW6PZH91R9A",
580
+ "key": "INIT",
581
+ "name": "Initialize"
582
+ },
583
+ {
584
+ "description": "Lab router broadcast naming the active mode; this instrument renders when the mode equals matchMode, otherwise renders null.",
585
+ "id": "evt_01M0CGJFW96K8FBC6WV4D341YQ",
586
+ "key": "MODE_SELECTED",
587
+ "name": "Mode Selected",
588
+ "payloadSchema": [
589
+ {
590
+ "name": "mode",
591
+ "type": "string"
592
+ }
593
+ ],
594
+ "tier": "domain"
595
+ },
596
+ {
597
+ "description": "Learner clicked a candidate-step button to try to derive the next line: the candidate's matchSide/matchNegationMode is matched against the current lines, and on success its deriveSide/deriveNegationMode determines the appended line.",
598
+ "id": "evt_01M0CGJFW9AA9N4C7ADX4VGB15",
599
+ "key": "APPLY_STEP",
600
+ "name": "Apply Step",
601
+ "payloadSchema": [
602
+ {
603
+ "name": "candidateKey",
604
+ "type": "string"
605
+ }
606
+ ],
607
+ "tier": "domain"
608
+ },
609
+ {
610
+ "description": "Learner toggled auto-derive: while running, the tick applies the first applicable candidate automatically every autoApplyIntervalMs.",
611
+ "id": "evt_01M0CGJFW9S6N0YP8GJFD54KXA",
612
+ "key": "TOGGLE_RUN",
613
+ "name": "Toggle Run",
614
+ "tier": "domain"
615
+ },
616
+ {
617
+ "description": "Learner reset the derivation: lines restore to the config-declared starting premises, feedback/narration clear, and goalReached/running reset.",
618
+ "id": "evt_01M0CGJFW98W2XTBPXCK1DWBHW",
619
+ "key": "RESET",
620
+ "name": "Reset",
621
+ "tier": "domain"
622
+ },
623
+ {
624
+ "description": "The derivation state after each learner action — a composed listener (readout, grader) can subscribe; a harmless no-op when the atom runs standalone.",
625
+ "id": "evt_01M0CGJFW9HC02BTAY2QGW6ZNE",
626
+ "key": "DERIVATION_UPDATED",
627
+ "name": "Derivation Updated",
628
+ "payloadSchema": [
629
+ {
630
+ "name": "feedback",
631
+ "type": "string"
632
+ },
633
+ {
634
+ "name": "goalReached",
635
+ "type": "boolean"
636
+ },
637
+ {
638
+ "name": "lineCount",
639
+ "type": "number"
640
+ },
641
+ {
642
+ "name": "narration",
643
+ "type": "string"
644
+ }
645
+ ],
646
+ "synonyms": "derivation update, proof step, derived line, candidate applied, goal reached",
647
+ "tier": "domain"
648
+ }
649
+ ],
650
+ "states": [
651
+ {
652
+ "isInitial": true,
653
+ "name": "idle"
654
+ }
655
+ ],
656
+ "transitions": [
657
+ {
658
+ "effects": [
659
+ [
660
+ "set",
661
+ "@entity.active",
662
+ true
663
+ ],
664
+ [
665
+ "set",
666
+ "@entity.title",
667
+ "@config.title"
668
+ ],
669
+ [
670
+ "set",
671
+ "@entity.feedback",
672
+ ""
673
+ ],
674
+ [
675
+ "set",
676
+ "@entity.narration",
677
+ ""
678
+ ],
679
+ [
680
+ "set",
681
+ "@entity.goalReached",
682
+ false
683
+ ],
684
+ [
685
+ "set",
686
+ "@entity.running",
687
+ "@config.autoRun"
688
+ ],
689
+ [
690
+ "set",
691
+ "@entity.elapsedMs",
692
+ 0.0
693
+ ],
694
+ [
695
+ "set",
696
+ "@entity.lines",
697
+ "@config.premises"
698
+ ],
699
+ [
700
+ "set",
701
+ "@entity.renderChildren",
702
+ [
703
+ {
704
+ "content": "@entity.title",
705
+ "type": "typography",
706
+ "variant": "h4"
707
+ },
708
+ {
709
+ "content": [
710
+ "str/concat",
711
+ "@config.goalPrefix",
712
+ "@config.goalLabel"
713
+ ],
714
+ "type": "typography",
715
+ "variant": "body"
716
+ },
717
+ {
718
+ "children": [
719
+ "array/map",
720
+ "@entity.lines",
721
+ [
722
+ "fn",
723
+ "line",
724
+ {
725
+ "children": [
726
+ {
727
+ "label": "@line.badgeLabel",
728
+ "type": "badge",
729
+ "variant": "@line.badgeVariant"
730
+ },
731
+ {
732
+ "content": "@line.label",
733
+ "type": "typography",
734
+ "variant": "body"
735
+ }
736
+ ],
737
+ "direction": "horizontal",
738
+ "gap": "sm",
739
+ "type": "stack"
740
+ }
741
+ ]
742
+ ],
743
+ "direction": "vertical",
744
+ "gap": "xs",
745
+ "style": {
746
+ "maxHeight": [
747
+ "str/concat",
748
+ "@config.height",
749
+ "px"
750
+ ],
751
+ "overflowY": "auto"
752
+ },
753
+ "type": "stack"
754
+ },
755
+ {
756
+ "children": [
757
+ "array/map",
758
+ "@config.candidates",
759
+ [
760
+ "fn",
761
+ "c",
762
+ {
763
+ "action": "APPLY_STEP",
764
+ "actionPayload": {
765
+ "candidateKey": "@c.key"
766
+ },
767
+ "label": "@c.label",
768
+ "type": "button",
769
+ "variant": "primary"
770
+ }
771
+ ]
772
+ ],
773
+ "direction": "horizontal",
774
+ "gap": "sm",
775
+ "type": "stack"
776
+ },
777
+ {
778
+ "children": [
779
+ {
780
+ "action": "TOGGLE_RUN",
781
+ "label": [
782
+ "if",
783
+ "@entity.running",
784
+ "Pause",
785
+ "Run"
786
+ ],
787
+ "type": "button",
788
+ "variant": "secondary"
789
+ },
790
+ {
791
+ "action": "RESET",
792
+ "label": "@config.resetLabel",
793
+ "type": "button",
794
+ "variant": "ghost"
795
+ }
796
+ ],
797
+ "direction": "horizontal",
798
+ "gap": "sm",
799
+ "type": "stack"
800
+ },
801
+ {
802
+ "content": "@entity.narration",
803
+ "type": "typography",
804
+ "variant": "caption"
805
+ },
806
+ {
807
+ "content": [
808
+ "if",
809
+ "@entity.goalReached",
810
+ "@config.goalReachedMessage",
811
+ ""
812
+ ],
813
+ "type": "typography",
814
+ "variant": "caption"
815
+ }
816
+ ]
817
+ ],
818
+ [
819
+ "render-ui",
820
+ "main",
821
+ {
822
+ "children": [
823
+ {
824
+ "children": "@entity.renderChildren",
825
+ "direction": "vertical",
826
+ "gap": "md",
827
+ "type": "stack"
828
+ }
829
+ ],
830
+ "maxWidth": [
831
+ "str/concat",
832
+ "@config.width",
833
+ "px"
834
+ ],
835
+ "padding": "md",
836
+ "type": "box"
837
+ }
838
+ ]
839
+ ],
840
+ "event": "INIT",
841
+ "eventId": "evt_01M0CGJFW9FJVWEPW6PZH91R9A",
842
+ "from": "idle",
843
+ "guard": [
844
+ "==",
845
+ "@config.matchMode",
846
+ ""
847
+ ],
848
+ "to": "idle"
849
+ },
850
+ {
851
+ "effects": [
852
+ [
853
+ "set",
854
+ "@entity.active",
855
+ true
856
+ ],
857
+ [
858
+ "set",
859
+ "@entity.title",
860
+ "@config.title"
861
+ ],
862
+ [
863
+ "set",
864
+ "@entity.feedback",
865
+ ""
866
+ ],
867
+ [
868
+ "set",
869
+ "@entity.narration",
870
+ ""
871
+ ],
872
+ [
873
+ "set",
874
+ "@entity.goalReached",
875
+ false
876
+ ],
877
+ [
878
+ "set",
879
+ "@entity.running",
880
+ "@config.autoRun"
881
+ ],
882
+ [
883
+ "set",
884
+ "@entity.elapsedMs",
885
+ 0.0
886
+ ],
887
+ [
888
+ "set",
889
+ "@entity.lines",
890
+ "@config.premises"
891
+ ],
892
+ [
893
+ "set",
894
+ "@entity.renderChildren",
895
+ [
896
+ {
897
+ "content": "@entity.title",
898
+ "type": "typography",
899
+ "variant": "h4"
900
+ },
901
+ {
902
+ "content": [
903
+ "str/concat",
904
+ "@config.goalPrefix",
905
+ "@config.goalLabel"
906
+ ],
907
+ "type": "typography",
908
+ "variant": "body"
909
+ },
910
+ {
911
+ "children": [
912
+ "array/map",
913
+ "@entity.lines",
914
+ [
915
+ "fn",
916
+ "line",
917
+ {
918
+ "children": [
919
+ {
920
+ "label": "@line.badgeLabel",
921
+ "type": "badge",
922
+ "variant": "@line.badgeVariant"
923
+ },
924
+ {
925
+ "content": "@line.label",
926
+ "type": "typography",
927
+ "variant": "body"
928
+ }
929
+ ],
930
+ "direction": "horizontal",
931
+ "gap": "sm",
932
+ "type": "stack"
933
+ }
934
+ ]
935
+ ],
936
+ "direction": "vertical",
937
+ "gap": "xs",
938
+ "style": {
939
+ "maxHeight": [
940
+ "str/concat",
941
+ "@config.height",
942
+ "px"
943
+ ],
944
+ "overflowY": "auto"
945
+ },
946
+ "type": "stack"
947
+ },
948
+ {
949
+ "children": [
950
+ "array/map",
951
+ "@config.candidates",
952
+ [
953
+ "fn",
954
+ "c",
955
+ {
956
+ "action": "APPLY_STEP",
957
+ "actionPayload": {
958
+ "candidateKey": "@c.key"
959
+ },
960
+ "label": "@c.label",
961
+ "type": "button",
962
+ "variant": "primary"
963
+ }
964
+ ]
965
+ ],
966
+ "direction": "horizontal",
967
+ "gap": "sm",
968
+ "type": "stack"
969
+ },
970
+ {
971
+ "children": [
972
+ {
973
+ "action": "TOGGLE_RUN",
974
+ "label": [
975
+ "if",
976
+ "@entity.running",
977
+ "Pause",
978
+ "Run"
979
+ ],
980
+ "type": "button",
981
+ "variant": "secondary"
982
+ },
983
+ {
984
+ "action": "RESET",
985
+ "label": "@config.resetLabel",
986
+ "type": "button",
987
+ "variant": "ghost"
988
+ }
989
+ ],
990
+ "direction": "horizontal",
991
+ "gap": "sm",
992
+ "type": "stack"
993
+ },
994
+ {
995
+ "content": "@entity.narration",
996
+ "type": "typography",
997
+ "variant": "caption"
998
+ },
999
+ {
1000
+ "content": [
1001
+ "if",
1002
+ "@entity.goalReached",
1003
+ "@config.goalReachedMessage",
1004
+ ""
1005
+ ],
1006
+ "type": "typography",
1007
+ "variant": "caption"
1008
+ }
1009
+ ]
1010
+ ],
1011
+ [
1012
+ "render-ui",
1013
+ "main",
1014
+ {
1015
+ "children": [
1016
+ {
1017
+ "children": "@entity.renderChildren",
1018
+ "direction": "vertical",
1019
+ "gap": "md",
1020
+ "type": "stack"
1021
+ }
1022
+ ],
1023
+ "maxWidth": [
1024
+ "str/concat",
1025
+ "@config.width",
1026
+ "px"
1027
+ ],
1028
+ "padding": "md",
1029
+ "type": "box"
1030
+ }
1031
+ ]
1032
+ ],
1033
+ "event": "MODE_SELECTED",
1034
+ "eventId": "evt_01M0CGJFW96K8FBC6WV4D341YQ",
1035
+ "from": "idle",
1036
+ "guard": [
1037
+ "==",
1038
+ "@payload.mode",
1039
+ "@config.matchMode"
1040
+ ],
1041
+ "to": "idle"
1042
+ },
1043
+ {
1044
+ "effects": [
1045
+ [
1046
+ "let",
1047
+ [
1048
+ [
1049
+ "candidate",
1050
+ [
1051
+ "array/first",
1052
+ [
1053
+ "array/filter",
1054
+ "@config.candidates",
1055
+ [
1056
+ "fn",
1057
+ "c",
1058
+ [
1059
+ "==",
1060
+ "@c.key",
1061
+ "@payload.candidateKey"
1062
+ ]
1063
+ ]
1064
+ ]
1065
+ ]
1066
+ ],
1067
+ [
1068
+ "links",
1069
+ [
1070
+ "array/filter",
1071
+ "@entity.lines",
1072
+ [
1073
+ "fn",
1074
+ "l",
1075
+ [
1076
+ "==",
1077
+ "@l.kind",
1078
+ "link"
1079
+ ]
1080
+ ]
1081
+ ]
1082
+ ],
1083
+ [
1084
+ "facts",
1085
+ [
1086
+ "array/filter",
1087
+ "@entity.lines",
1088
+ [
1089
+ "fn",
1090
+ "l",
1091
+ [
1092
+ "==",
1093
+ "@l.kind",
1094
+ "fact"
1095
+ ]
1096
+ ]
1097
+ ]
1098
+ ],
1099
+ [
1100
+ "wantLeft",
1101
+ [
1102
+ "==",
1103
+ "@candidate.matchSide",
1104
+ "left"
1105
+ ]
1106
+ ],
1107
+ [
1108
+ "matchSense",
1109
+ [
1110
+ "==",
1111
+ "@candidate.matchNegationMode",
1112
+ "same"
1113
+ ]
1114
+ ],
1115
+ [
1116
+ "activeLink",
1117
+ [
1118
+ "array/first",
1119
+ [
1120
+ "array/filter",
1121
+ "@links",
1122
+ [
1123
+ "fn",
1124
+ "l",
1125
+ [
1126
+ "let",
1127
+ [
1128
+ [
1129
+ "linkSubject",
1130
+ [
1131
+ "if",
1132
+ "@wantLeft",
1133
+ "@l.leftSubject",
1134
+ "@l.rightSubject"
1135
+ ]
1136
+ ],
1137
+ [
1138
+ "linkNegated",
1139
+ [
1140
+ "if",
1141
+ "@wantLeft",
1142
+ "@l.leftNegated",
1143
+ "@l.rightNegated"
1144
+ ]
1145
+ ],
1146
+ [
1147
+ "requiredNegated",
1148
+ [
1149
+ "if",
1150
+ "@matchSense",
1151
+ "@linkNegated",
1152
+ [
1153
+ "not",
1154
+ "@linkNegated"
1155
+ ]
1156
+ ]
1157
+ ]
1158
+ ],
1159
+ [
1160
+ "array/some",
1161
+ "@facts",
1162
+ [
1163
+ "fn",
1164
+ "f",
1165
+ [
1166
+ "and",
1167
+ [
1168
+ "==",
1169
+ "@f.subject",
1170
+ "@linkSubject"
1171
+ ],
1172
+ [
1173
+ "==",
1174
+ "@f.negated",
1175
+ "@requiredNegated"
1176
+ ]
1177
+ ]
1178
+ ]
1179
+ ]
1180
+ ]
1181
+ ]
1182
+ ]
1183
+ ]
1184
+ ],
1185
+ [
1186
+ "deriveLeft",
1187
+ [
1188
+ "==",
1189
+ "@candidate.deriveSide",
1190
+ "left"
1191
+ ]
1192
+ ],
1193
+ [
1194
+ "deriveSense",
1195
+ [
1196
+ "==",
1197
+ "@candidate.deriveNegationMode",
1198
+ "same"
1199
+ ]
1200
+ ],
1201
+ [
1202
+ "derivedSubject",
1203
+ [
1204
+ "if",
1205
+ [
1206
+ "!=",
1207
+ "@activeLink",
1208
+ null
1209
+ ],
1210
+ [
1211
+ "if",
1212
+ "@deriveLeft",
1213
+ "@activeLink.leftSubject",
1214
+ "@activeLink.rightSubject"
1215
+ ],
1216
+ ""
1217
+ ]
1218
+ ],
1219
+ [
1220
+ "derivedSideNegated",
1221
+ [
1222
+ "if",
1223
+ [
1224
+ "!=",
1225
+ "@activeLink",
1226
+ null
1227
+ ],
1228
+ [
1229
+ "if",
1230
+ "@deriveLeft",
1231
+ "@activeLink.leftNegated",
1232
+ "@activeLink.rightNegated"
1233
+ ],
1234
+ false
1235
+ ]
1236
+ ],
1237
+ [
1238
+ "derivedNegated",
1239
+ [
1240
+ "if",
1241
+ "@deriveSense",
1242
+ "@derivedSideNegated",
1243
+ [
1244
+ "not",
1245
+ "@derivedSideNegated"
1246
+ ]
1247
+ ]
1248
+ ],
1249
+ [
1250
+ "derivedLabel",
1251
+ [
1252
+ "if",
1253
+ [
1254
+ "!=",
1255
+ "@activeLink",
1256
+ null
1257
+ ],
1258
+ [
1259
+ "if",
1260
+ "@derivedNegated",
1261
+ [
1262
+ "str/concat",
1263
+ "@config.negationSymbol",
1264
+ "@derivedSubject"
1265
+ ],
1266
+ "@derivedSubject"
1267
+ ],
1268
+ ""
1269
+ ]
1270
+ ],
1271
+ [
1272
+ "alreadyPresent",
1273
+ [
1274
+ "array/some",
1275
+ "@entity.lines",
1276
+ [
1277
+ "fn",
1278
+ "l",
1279
+ [
1280
+ "==",
1281
+ "@l.label",
1282
+ "@derivedLabel"
1283
+ ]
1284
+ ]
1285
+ ]
1286
+ ],
1287
+ [
1288
+ "canDerive",
1289
+ [
1290
+ "and",
1291
+ [
1292
+ "!=",
1293
+ "@activeLink",
1294
+ null
1295
+ ],
1296
+ [
1297
+ "not",
1298
+ "@alreadyPresent"
1299
+ ]
1300
+ ]
1301
+ ]
1302
+ ],
1303
+ [
1304
+ "do",
1305
+ [
1306
+ "set",
1307
+ "@entity.lines",
1308
+ [
1309
+ "if",
1310
+ "@canDerive",
1311
+ [
1312
+ "array/concat",
1313
+ "@entity.lines",
1314
+ [
1315
+ {
1316
+ "badgeLabel": "@candidate.resultBadgeLabel",
1317
+ "badgeVariant": "@candidate.resultBadgeVariant",
1318
+ "id": [
1319
+ "str/concat",
1320
+ "line-",
1321
+ [
1322
+ "array/len",
1323
+ "@entity.lines"
1324
+ ]
1325
+ ],
1326
+ "kind": "fact",
1327
+ "label": "@derivedLabel",
1328
+ "negated": "@derivedNegated",
1329
+ "subject": "@derivedSubject"
1330
+ }
1331
+ ]
1332
+ ],
1333
+ "@entity.lines"
1334
+ ]
1335
+ ],
1336
+ [
1337
+ "set",
1338
+ "@entity.feedback",
1339
+ [
1340
+ "if",
1341
+ "@canDerive",
1342
+ [
1343
+ "str/concat",
1344
+ "Derived ",
1345
+ "@derivedLabel",
1346
+ " via ",
1347
+ "@candidate.label",
1348
+ "."
1349
+ ],
1350
+ [
1351
+ "if",
1352
+ "@alreadyPresent",
1353
+ [
1354
+ "str/concat",
1355
+ "@derivedLabel",
1356
+ " is already in the derivation."
1357
+ ],
1358
+ "@candidate.noMatchFeedback"
1359
+ ]
1360
+ ]
1361
+ ],
1362
+ [
1363
+ "set",
1364
+ "@entity.goalReached",
1365
+ [
1366
+ "if",
1367
+ "@canDerive",
1368
+ [
1369
+ "==",
1370
+ "@derivedLabel",
1371
+ "@config.goalLabel"
1372
+ ],
1373
+ "@entity.goalReached"
1374
+ ]
1375
+ ],
1376
+ [
1377
+ "set",
1378
+ "@entity.narration",
1379
+ "@entity.feedback"
1380
+ ]
1381
+ ]
1382
+ ],
1383
+ [
1384
+ "set",
1385
+ "@entity.renderChildren",
1386
+ [
1387
+ {
1388
+ "content": "@entity.title",
1389
+ "type": "typography",
1390
+ "variant": "h4"
1391
+ },
1392
+ {
1393
+ "content": [
1394
+ "str/concat",
1395
+ "@config.goalPrefix",
1396
+ "@config.goalLabel"
1397
+ ],
1398
+ "type": "typography",
1399
+ "variant": "body"
1400
+ },
1401
+ {
1402
+ "children": [
1403
+ "array/map",
1404
+ "@entity.lines",
1405
+ [
1406
+ "fn",
1407
+ "line",
1408
+ {
1409
+ "children": [
1410
+ {
1411
+ "label": "@line.badgeLabel",
1412
+ "type": "badge",
1413
+ "variant": "@line.badgeVariant"
1414
+ },
1415
+ {
1416
+ "content": "@line.label",
1417
+ "type": "typography",
1418
+ "variant": "body"
1419
+ }
1420
+ ],
1421
+ "direction": "horizontal",
1422
+ "gap": "sm",
1423
+ "type": "stack"
1424
+ }
1425
+ ]
1426
+ ],
1427
+ "direction": "vertical",
1428
+ "gap": "xs",
1429
+ "style": {
1430
+ "maxHeight": [
1431
+ "str/concat",
1432
+ "@config.height",
1433
+ "px"
1434
+ ],
1435
+ "overflowY": "auto"
1436
+ },
1437
+ "type": "stack"
1438
+ },
1439
+ {
1440
+ "children": [
1441
+ "array/map",
1442
+ "@config.candidates",
1443
+ [
1444
+ "fn",
1445
+ "c",
1446
+ {
1447
+ "action": "APPLY_STEP",
1448
+ "actionPayload": {
1449
+ "candidateKey": "@c.key"
1450
+ },
1451
+ "label": "@c.label",
1452
+ "type": "button",
1453
+ "variant": "primary"
1454
+ }
1455
+ ]
1456
+ ],
1457
+ "direction": "horizontal",
1458
+ "gap": "sm",
1459
+ "type": "stack"
1460
+ },
1461
+ {
1462
+ "children": [
1463
+ {
1464
+ "action": "TOGGLE_RUN",
1465
+ "label": [
1466
+ "if",
1467
+ "@entity.running",
1468
+ "Pause",
1469
+ "Run"
1470
+ ],
1471
+ "type": "button",
1472
+ "variant": "secondary"
1473
+ },
1474
+ {
1475
+ "action": "RESET",
1476
+ "label": "@config.resetLabel",
1477
+ "type": "button",
1478
+ "variant": "ghost"
1479
+ }
1480
+ ],
1481
+ "direction": "horizontal",
1482
+ "gap": "sm",
1483
+ "type": "stack"
1484
+ },
1485
+ {
1486
+ "content": "@entity.narration",
1487
+ "type": "typography",
1488
+ "variant": "caption"
1489
+ },
1490
+ {
1491
+ "content": [
1492
+ "if",
1493
+ "@entity.goalReached",
1494
+ "@config.goalReachedMessage",
1495
+ ""
1496
+ ],
1497
+ "type": "typography",
1498
+ "variant": "caption"
1499
+ }
1500
+ ]
1501
+ ],
1502
+ [
1503
+ "render-ui",
1504
+ "main",
1505
+ {
1506
+ "children": [
1507
+ {
1508
+ "children": "@entity.renderChildren",
1509
+ "direction": "vertical",
1510
+ "gap": "md",
1511
+ "type": "stack"
1512
+ }
1513
+ ],
1514
+ "maxWidth": [
1515
+ "str/concat",
1516
+ "@config.width",
1517
+ "px"
1518
+ ],
1519
+ "padding": "md",
1520
+ "type": "box"
1521
+ }
1522
+ ],
1523
+ [
1524
+ "emit",
1525
+ "DERIVATION_UPDATED",
1526
+ {
1527
+ "feedback": "@entity.feedback",
1528
+ "goalReached": "@entity.goalReached",
1529
+ "lineCount": [
1530
+ "array/len",
1531
+ "@entity.lines"
1532
+ ],
1533
+ "narration": "@entity.narration"
1534
+ }
1535
+ ]
1536
+ ],
1537
+ "event": "APPLY_STEP",
1538
+ "eventId": "evt_01M0CGJFW9AA9N4C7ADX4VGB15",
1539
+ "from": "idle",
1540
+ "guard": [
1541
+ "==",
1542
+ "@entity.active",
1543
+ true
1544
+ ],
1545
+ "to": "idle"
1546
+ },
1547
+ {
1548
+ "effects": [
1549
+ [
1550
+ "set",
1551
+ "@entity.running",
1552
+ [
1553
+ "not",
1554
+ "@entity.running"
1555
+ ]
1556
+ ],
1557
+ [
1558
+ "set",
1559
+ "@entity.feedback",
1560
+ [
1561
+ "if",
1562
+ "@entity.running",
1563
+ "@config.autoRunOnMessage",
1564
+ "@config.autoRunOffMessage"
1565
+ ]
1566
+ ],
1567
+ [
1568
+ "set",
1569
+ "@entity.narration",
1570
+ "@entity.feedback"
1571
+ ],
1572
+ [
1573
+ "set",
1574
+ "@entity.renderChildren",
1575
+ [
1576
+ {
1577
+ "content": "@entity.title",
1578
+ "type": "typography",
1579
+ "variant": "h4"
1580
+ },
1581
+ {
1582
+ "content": [
1583
+ "str/concat",
1584
+ "@config.goalPrefix",
1585
+ "@config.goalLabel"
1586
+ ],
1587
+ "type": "typography",
1588
+ "variant": "body"
1589
+ },
1590
+ {
1591
+ "children": [
1592
+ "array/map",
1593
+ "@entity.lines",
1594
+ [
1595
+ "fn",
1596
+ "line",
1597
+ {
1598
+ "children": [
1599
+ {
1600
+ "label": "@line.badgeLabel",
1601
+ "type": "badge",
1602
+ "variant": "@line.badgeVariant"
1603
+ },
1604
+ {
1605
+ "content": "@line.label",
1606
+ "type": "typography",
1607
+ "variant": "body"
1608
+ }
1609
+ ],
1610
+ "direction": "horizontal",
1611
+ "gap": "sm",
1612
+ "type": "stack"
1613
+ }
1614
+ ]
1615
+ ],
1616
+ "direction": "vertical",
1617
+ "gap": "xs",
1618
+ "style": {
1619
+ "maxHeight": [
1620
+ "str/concat",
1621
+ "@config.height",
1622
+ "px"
1623
+ ],
1624
+ "overflowY": "auto"
1625
+ },
1626
+ "type": "stack"
1627
+ },
1628
+ {
1629
+ "children": [
1630
+ "array/map",
1631
+ "@config.candidates",
1632
+ [
1633
+ "fn",
1634
+ "c",
1635
+ {
1636
+ "action": "APPLY_STEP",
1637
+ "actionPayload": {
1638
+ "candidateKey": "@c.key"
1639
+ },
1640
+ "label": "@c.label",
1641
+ "type": "button",
1642
+ "variant": "primary"
1643
+ }
1644
+ ]
1645
+ ],
1646
+ "direction": "horizontal",
1647
+ "gap": "sm",
1648
+ "type": "stack"
1649
+ },
1650
+ {
1651
+ "children": [
1652
+ {
1653
+ "action": "TOGGLE_RUN",
1654
+ "label": [
1655
+ "if",
1656
+ "@entity.running",
1657
+ "Pause",
1658
+ "Run"
1659
+ ],
1660
+ "type": "button",
1661
+ "variant": "secondary"
1662
+ },
1663
+ {
1664
+ "action": "RESET",
1665
+ "label": "@config.resetLabel",
1666
+ "type": "button",
1667
+ "variant": "ghost"
1668
+ }
1669
+ ],
1670
+ "direction": "horizontal",
1671
+ "gap": "sm",
1672
+ "type": "stack"
1673
+ },
1674
+ {
1675
+ "content": "@entity.narration",
1676
+ "type": "typography",
1677
+ "variant": "caption"
1678
+ },
1679
+ {
1680
+ "content": [
1681
+ "if",
1682
+ "@entity.goalReached",
1683
+ "@config.goalReachedMessage",
1684
+ ""
1685
+ ],
1686
+ "type": "typography",
1687
+ "variant": "caption"
1688
+ }
1689
+ ]
1690
+ ],
1691
+ [
1692
+ "render-ui",
1693
+ "main",
1694
+ {
1695
+ "children": [
1696
+ {
1697
+ "children": "@entity.renderChildren",
1698
+ "direction": "vertical",
1699
+ "gap": "md",
1700
+ "type": "stack"
1701
+ }
1702
+ ],
1703
+ "maxWidth": [
1704
+ "str/concat",
1705
+ "@config.width",
1706
+ "px"
1707
+ ],
1708
+ "padding": "md",
1709
+ "type": "box"
1710
+ }
1711
+ ],
1712
+ [
1713
+ "emit",
1714
+ "DERIVATION_UPDATED",
1715
+ {
1716
+ "feedback": "@entity.feedback",
1717
+ "goalReached": "@entity.goalReached",
1718
+ "lineCount": [
1719
+ "array/len",
1720
+ "@entity.lines"
1721
+ ],
1722
+ "narration": "@entity.narration"
1723
+ }
1724
+ ]
1725
+ ],
1726
+ "event": "TOGGLE_RUN",
1727
+ "eventId": "evt_01M0CGJFW9S6N0YP8GJFD54KXA",
1728
+ "from": "idle",
1729
+ "guard": [
1730
+ "==",
1731
+ "@entity.active",
1732
+ true
1733
+ ],
1734
+ "to": "idle"
1735
+ },
1736
+ {
1737
+ "effects": [
1738
+ [
1739
+ "set",
1740
+ "@entity.lines",
1741
+ "@config.premises"
1742
+ ],
1743
+ [
1744
+ "set",
1745
+ "@entity.feedback",
1746
+ ""
1747
+ ],
1748
+ [
1749
+ "set",
1750
+ "@entity.narration",
1751
+ ""
1752
+ ],
1753
+ [
1754
+ "set",
1755
+ "@entity.goalReached",
1756
+ false
1757
+ ],
1758
+ [
1759
+ "set",
1760
+ "@entity.running",
1761
+ "@config.autoRun"
1762
+ ],
1763
+ [
1764
+ "set",
1765
+ "@entity.elapsedMs",
1766
+ 0.0
1767
+ ],
1768
+ [
1769
+ "set",
1770
+ "@entity.renderChildren",
1771
+ [
1772
+ {
1773
+ "content": "@entity.title",
1774
+ "type": "typography",
1775
+ "variant": "h4"
1776
+ },
1777
+ {
1778
+ "content": [
1779
+ "str/concat",
1780
+ "@config.goalPrefix",
1781
+ "@config.goalLabel"
1782
+ ],
1783
+ "type": "typography",
1784
+ "variant": "body"
1785
+ },
1786
+ {
1787
+ "children": [
1788
+ "array/map",
1789
+ "@entity.lines",
1790
+ [
1791
+ "fn",
1792
+ "line",
1793
+ {
1794
+ "children": [
1795
+ {
1796
+ "label": "@line.badgeLabel",
1797
+ "type": "badge",
1798
+ "variant": "@line.badgeVariant"
1799
+ },
1800
+ {
1801
+ "content": "@line.label",
1802
+ "type": "typography",
1803
+ "variant": "body"
1804
+ }
1805
+ ],
1806
+ "direction": "horizontal",
1807
+ "gap": "sm",
1808
+ "type": "stack"
1809
+ }
1810
+ ]
1811
+ ],
1812
+ "direction": "vertical",
1813
+ "gap": "xs",
1814
+ "style": {
1815
+ "maxHeight": [
1816
+ "str/concat",
1817
+ "@config.height",
1818
+ "px"
1819
+ ],
1820
+ "overflowY": "auto"
1821
+ },
1822
+ "type": "stack"
1823
+ },
1824
+ {
1825
+ "children": [
1826
+ "array/map",
1827
+ "@config.candidates",
1828
+ [
1829
+ "fn",
1830
+ "c",
1831
+ {
1832
+ "action": "APPLY_STEP",
1833
+ "actionPayload": {
1834
+ "candidateKey": "@c.key"
1835
+ },
1836
+ "label": "@c.label",
1837
+ "type": "button",
1838
+ "variant": "primary"
1839
+ }
1840
+ ]
1841
+ ],
1842
+ "direction": "horizontal",
1843
+ "gap": "sm",
1844
+ "type": "stack"
1845
+ },
1846
+ {
1847
+ "children": [
1848
+ {
1849
+ "action": "TOGGLE_RUN",
1850
+ "label": [
1851
+ "if",
1852
+ "@entity.running",
1853
+ "Pause",
1854
+ "Run"
1855
+ ],
1856
+ "type": "button",
1857
+ "variant": "secondary"
1858
+ },
1859
+ {
1860
+ "action": "RESET",
1861
+ "label": "@config.resetLabel",
1862
+ "type": "button",
1863
+ "variant": "ghost"
1864
+ }
1865
+ ],
1866
+ "direction": "horizontal",
1867
+ "gap": "sm",
1868
+ "type": "stack"
1869
+ },
1870
+ {
1871
+ "content": "@entity.narration",
1872
+ "type": "typography",
1873
+ "variant": "caption"
1874
+ },
1875
+ {
1876
+ "content": [
1877
+ "if",
1878
+ "@entity.goalReached",
1879
+ "@config.goalReachedMessage",
1880
+ ""
1881
+ ],
1882
+ "type": "typography",
1883
+ "variant": "caption"
1884
+ }
1885
+ ]
1886
+ ],
1887
+ [
1888
+ "render-ui",
1889
+ "main",
1890
+ {
1891
+ "children": [
1892
+ {
1893
+ "children": "@entity.renderChildren",
1894
+ "direction": "vertical",
1895
+ "gap": "md",
1896
+ "type": "stack"
1897
+ }
1898
+ ],
1899
+ "maxWidth": [
1900
+ "str/concat",
1901
+ "@config.width",
1902
+ "px"
1903
+ ],
1904
+ "padding": "md",
1905
+ "type": "box"
1906
+ }
1907
+ ],
1908
+ [
1909
+ "emit",
1910
+ "DERIVATION_UPDATED",
1911
+ {
1912
+ "feedback": "@entity.feedback",
1913
+ "goalReached": "@entity.goalReached",
1914
+ "lineCount": [
1915
+ "array/len",
1916
+ "@entity.lines"
1917
+ ],
1918
+ "narration": "@entity.narration"
1919
+ }
1920
+ ]
1921
+ ],
1922
+ "event": "RESET",
1923
+ "eventId": "evt_01M0CGJFW98W2XTBPXCK1DWBHW",
1924
+ "from": "idle",
1925
+ "guard": [
1926
+ "==",
1927
+ "@entity.active",
1928
+ true
1929
+ ],
1930
+ "to": "idle"
1931
+ }
1932
+ ]
1933
+ },
1934
+ "ticks": [
1935
+ {
1936
+ "effects": [
1937
+ [
1938
+ "set",
1939
+ "@entity.elapsedMs",
1940
+ [
1941
+ "+",
1942
+ "@entity.elapsedMs",
1943
+ 32.0
1944
+ ]
1945
+ ],
1946
+ [
1947
+ "when",
1948
+ [
1949
+ ">=",
1950
+ "@entity.elapsedMs",
1951
+ "@config.autoApplyIntervalMs"
1952
+ ],
1953
+ [
1954
+ "do",
1955
+ [
1956
+ "set",
1957
+ "@entity.elapsedMs",
1958
+ 0.0
1959
+ ],
1960
+ [
1961
+ "let",
1962
+ [
1963
+ [
1964
+ "links",
1965
+ [
1966
+ "array/filter",
1967
+ "@entity.lines",
1968
+ [
1969
+ "fn",
1970
+ "l",
1971
+ [
1972
+ "==",
1973
+ "@l.kind",
1974
+ "link"
1975
+ ]
1976
+ ]
1977
+ ]
1978
+ ],
1979
+ [
1980
+ "facts",
1981
+ [
1982
+ "array/filter",
1983
+ "@entity.lines",
1984
+ [
1985
+ "fn",
1986
+ "l",
1987
+ [
1988
+ "==",
1989
+ "@l.kind",
1990
+ "fact"
1991
+ ]
1992
+ ]
1993
+ ]
1994
+ ],
1995
+ [
1996
+ "evaluated",
1997
+ [
1998
+ "array/map",
1999
+ "@config.candidates",
2000
+ [
2001
+ "fn",
2002
+ "c",
2003
+ [
2004
+ "let",
2005
+ [
2006
+ [
2007
+ "wantLeft",
2008
+ [
2009
+ "==",
2010
+ "@c.matchSide",
2011
+ "left"
2012
+ ]
2013
+ ],
2014
+ [
2015
+ "matchSense",
2016
+ [
2017
+ "==",
2018
+ "@c.matchNegationMode",
2019
+ "same"
2020
+ ]
2021
+ ],
2022
+ [
2023
+ "activeLink",
2024
+ [
2025
+ "array/first",
2026
+ [
2027
+ "array/filter",
2028
+ "@links",
2029
+ [
2030
+ "fn",
2031
+ "l",
2032
+ [
2033
+ "let",
2034
+ [
2035
+ [
2036
+ "linkSubject",
2037
+ [
2038
+ "if",
2039
+ "@wantLeft",
2040
+ "@l.leftSubject",
2041
+ "@l.rightSubject"
2042
+ ]
2043
+ ],
2044
+ [
2045
+ "linkNegated",
2046
+ [
2047
+ "if",
2048
+ "@wantLeft",
2049
+ "@l.leftNegated",
2050
+ "@l.rightNegated"
2051
+ ]
2052
+ ],
2053
+ [
2054
+ "requiredNegated",
2055
+ [
2056
+ "if",
2057
+ "@matchSense",
2058
+ "@linkNegated",
2059
+ [
2060
+ "not",
2061
+ "@linkNegated"
2062
+ ]
2063
+ ]
2064
+ ]
2065
+ ],
2066
+ [
2067
+ "array/some",
2068
+ "@facts",
2069
+ [
2070
+ "fn",
2071
+ "f",
2072
+ [
2073
+ "and",
2074
+ [
2075
+ "==",
2076
+ "@f.subject",
2077
+ "@linkSubject"
2078
+ ],
2079
+ [
2080
+ "==",
2081
+ "@f.negated",
2082
+ "@requiredNegated"
2083
+ ]
2084
+ ]
2085
+ ]
2086
+ ]
2087
+ ]
2088
+ ]
2089
+ ]
2090
+ ]
2091
+ ],
2092
+ [
2093
+ "deriveLeft",
2094
+ [
2095
+ "==",
2096
+ "@c.deriveSide",
2097
+ "left"
2098
+ ]
2099
+ ],
2100
+ [
2101
+ "deriveSense",
2102
+ [
2103
+ "==",
2104
+ "@c.deriveNegationMode",
2105
+ "same"
2106
+ ]
2107
+ ],
2108
+ [
2109
+ "derivedSubject",
2110
+ [
2111
+ "if",
2112
+ [
2113
+ "!=",
2114
+ "@activeLink",
2115
+ null
2116
+ ],
2117
+ [
2118
+ "if",
2119
+ "@deriveLeft",
2120
+ "@activeLink.leftSubject",
2121
+ "@activeLink.rightSubject"
2122
+ ],
2123
+ ""
2124
+ ]
2125
+ ],
2126
+ [
2127
+ "derivedSideNegated",
2128
+ [
2129
+ "if",
2130
+ [
2131
+ "!=",
2132
+ "@activeLink",
2133
+ null
2134
+ ],
2135
+ [
2136
+ "if",
2137
+ "@deriveLeft",
2138
+ "@activeLink.leftNegated",
2139
+ "@activeLink.rightNegated"
2140
+ ],
2141
+ false
2142
+ ]
2143
+ ],
2144
+ [
2145
+ "derivedNegated",
2146
+ [
2147
+ "if",
2148
+ "@deriveSense",
2149
+ "@derivedSideNegated",
2150
+ [
2151
+ "not",
2152
+ "@derivedSideNegated"
2153
+ ]
2154
+ ]
2155
+ ],
2156
+ [
2157
+ "derivedLabel",
2158
+ [
2159
+ "if",
2160
+ [
2161
+ "!=",
2162
+ "@activeLink",
2163
+ null
2164
+ ],
2165
+ [
2166
+ "if",
2167
+ "@derivedNegated",
2168
+ [
2169
+ "str/concat",
2170
+ "@config.negationSymbol",
2171
+ "@derivedSubject"
2172
+ ],
2173
+ "@derivedSubject"
2174
+ ],
2175
+ ""
2176
+ ]
2177
+ ],
2178
+ [
2179
+ "alreadyPresent",
2180
+ [
2181
+ "array/some",
2182
+ "@entity.lines",
2183
+ [
2184
+ "fn",
2185
+ "l",
2186
+ [
2187
+ "==",
2188
+ "@l.label",
2189
+ "@derivedLabel"
2190
+ ]
2191
+ ]
2192
+ ]
2193
+ ],
2194
+ [
2195
+ "applicable",
2196
+ [
2197
+ "and",
2198
+ [
2199
+ "!=",
2200
+ "@activeLink",
2201
+ null
2202
+ ],
2203
+ [
2204
+ "not",
2205
+ "@alreadyPresent"
2206
+ ]
2207
+ ]
2208
+ ]
2209
+ ],
2210
+ {
2211
+ "applicable": "@applicable",
2212
+ "derivedLabel": "@derivedLabel",
2213
+ "derivedNegated": "@derivedNegated",
2214
+ "derivedSubject": "@derivedSubject",
2215
+ "label": "@c.label",
2216
+ "resultBadgeLabel": "@c.resultBadgeLabel",
2217
+ "resultBadgeVariant": "@c.resultBadgeVariant"
2218
+ }
2219
+ ]
2220
+ ]
2221
+ ]
2222
+ ],
2223
+ [
2224
+ "match",
2225
+ [
2226
+ "array/first",
2227
+ [
2228
+ "array/filter",
2229
+ "@evaluated",
2230
+ [
2231
+ "fn",
2232
+ "e",
2233
+ [
2234
+ "==",
2235
+ "@e.applicable",
2236
+ true
2237
+ ]
2238
+ ]
2239
+ ]
2240
+ ]
2241
+ ],
2242
+ [
2243
+ "found",
2244
+ [
2245
+ "!=",
2246
+ "@match",
2247
+ null
2248
+ ]
2249
+ ]
2250
+ ],
2251
+ [
2252
+ "do",
2253
+ [
2254
+ "set",
2255
+ "@entity.lines",
2256
+ [
2257
+ "if",
2258
+ "@found",
2259
+ [
2260
+ "array/concat",
2261
+ "@entity.lines",
2262
+ [
2263
+ {
2264
+ "badgeLabel": "@match.resultBadgeLabel",
2265
+ "badgeVariant": "@match.resultBadgeVariant",
2266
+ "id": [
2267
+ "str/concat",
2268
+ "line-",
2269
+ [
2270
+ "array/len",
2271
+ "@entity.lines"
2272
+ ]
2273
+ ],
2274
+ "kind": "fact",
2275
+ "label": "@match.derivedLabel",
2276
+ "negated": "@match.derivedNegated",
2277
+ "subject": "@match.derivedSubject"
2278
+ }
2279
+ ]
2280
+ ],
2281
+ "@entity.lines"
2282
+ ]
2283
+ ],
2284
+ [
2285
+ "set",
2286
+ "@entity.feedback",
2287
+ [
2288
+ "if",
2289
+ "@found",
2290
+ [
2291
+ "str/concat",
2292
+ "Derived ",
2293
+ "@match.derivedLabel",
2294
+ " via ",
2295
+ "@match.label",
2296
+ "."
2297
+ ],
2298
+ "@config.noStepAvailableMessage"
2299
+ ]
2300
+ ],
2301
+ [
2302
+ "set",
2303
+ "@entity.goalReached",
2304
+ [
2305
+ "if",
2306
+ "@found",
2307
+ [
2308
+ "==",
2309
+ "@match.derivedLabel",
2310
+ "@config.goalLabel"
2311
+ ],
2312
+ "@entity.goalReached"
2313
+ ]
2314
+ ],
2315
+ [
2316
+ "set",
2317
+ "@entity.narration",
2318
+ "@entity.feedback"
2319
+ ]
2320
+ ]
2321
+ ],
2322
+ [
2323
+ "set",
2324
+ "@entity.renderChildren",
2325
+ [
2326
+ {
2327
+ "content": "@entity.title",
2328
+ "type": "typography",
2329
+ "variant": "h4"
2330
+ },
2331
+ {
2332
+ "content": [
2333
+ "str/concat",
2334
+ "@config.goalPrefix",
2335
+ "@config.goalLabel"
2336
+ ],
2337
+ "type": "typography",
2338
+ "variant": "body"
2339
+ },
2340
+ {
2341
+ "children": [
2342
+ "array/map",
2343
+ "@entity.lines",
2344
+ [
2345
+ "fn",
2346
+ "line",
2347
+ {
2348
+ "children": [
2349
+ {
2350
+ "label": "@line.badgeLabel",
2351
+ "type": "badge",
2352
+ "variant": "@line.badgeVariant"
2353
+ },
2354
+ {
2355
+ "content": "@line.label",
2356
+ "type": "typography",
2357
+ "variant": "body"
2358
+ }
2359
+ ],
2360
+ "direction": "horizontal",
2361
+ "gap": "sm",
2362
+ "type": "stack"
2363
+ }
2364
+ ]
2365
+ ],
2366
+ "direction": "vertical",
2367
+ "gap": "xs",
2368
+ "style": {
2369
+ "maxHeight": [
2370
+ "str/concat",
2371
+ "@config.height",
2372
+ "px"
2373
+ ],
2374
+ "overflowY": "auto"
2375
+ },
2376
+ "type": "stack"
2377
+ },
2378
+ {
2379
+ "children": [
2380
+ "array/map",
2381
+ "@config.candidates",
2382
+ [
2383
+ "fn",
2384
+ "c",
2385
+ {
2386
+ "action": "APPLY_STEP",
2387
+ "actionPayload": {
2388
+ "candidateKey": "@c.key"
2389
+ },
2390
+ "label": "@c.label",
2391
+ "type": "button",
2392
+ "variant": "primary"
2393
+ }
2394
+ ]
2395
+ ],
2396
+ "direction": "horizontal",
2397
+ "gap": "sm",
2398
+ "type": "stack"
2399
+ },
2400
+ {
2401
+ "children": [
2402
+ {
2403
+ "action": "TOGGLE_RUN",
2404
+ "label": [
2405
+ "if",
2406
+ "@entity.running",
2407
+ "Pause",
2408
+ "Run"
2409
+ ],
2410
+ "type": "button",
2411
+ "variant": "secondary"
2412
+ },
2413
+ {
2414
+ "action": "RESET",
2415
+ "label": "@config.resetLabel",
2416
+ "type": "button",
2417
+ "variant": "ghost"
2418
+ }
2419
+ ],
2420
+ "direction": "horizontal",
2421
+ "gap": "sm",
2422
+ "type": "stack"
2423
+ },
2424
+ {
2425
+ "content": "@entity.narration",
2426
+ "type": "typography",
2427
+ "variant": "caption"
2428
+ },
2429
+ {
2430
+ "content": [
2431
+ "if",
2432
+ "@entity.goalReached",
2433
+ "@config.goalReachedMessage",
2434
+ ""
2435
+ ],
2436
+ "type": "typography",
2437
+ "variant": "caption"
2438
+ }
2439
+ ]
2440
+ ],
2441
+ [
2442
+ "render-ui",
2443
+ "main",
2444
+ {
2445
+ "children": [
2446
+ {
2447
+ "children": "@entity.renderChildren",
2448
+ "direction": "vertical",
2449
+ "gap": "md",
2450
+ "type": "stack"
2451
+ }
2452
+ ],
2453
+ "maxWidth": [
2454
+ "str/concat",
2455
+ "@config.width",
2456
+ "px"
2457
+ ],
2458
+ "padding": "md",
2459
+ "type": "box"
2460
+ }
2461
+ ],
2462
+ [
2463
+ "emit",
2464
+ "DERIVATION_UPDATED",
2465
+ {
2466
+ "feedback": "@entity.feedback",
2467
+ "goalReached": "@entity.goalReached",
2468
+ "lineCount": [
2469
+ "array/len",
2470
+ "@entity.lines"
2471
+ ],
2472
+ "narration": "@entity.narration"
2473
+ }
2474
+ ]
2475
+ ]
2476
+ ]
2477
+ ],
2478
+ "guard": [
2479
+ "and",
2480
+ [
2481
+ "==",
2482
+ "@entity.active",
2483
+ true
2484
+ ],
2485
+ [
2486
+ "and",
2487
+ [
2488
+ "==",
2489
+ "@entity.running",
2490
+ true
2491
+ ],
2492
+ [
2493
+ "not",
2494
+ [
2495
+ "==",
2496
+ "@entity.goalReached",
2497
+ true
2498
+ ]
2499
+ ]
2500
+ ]
2501
+ ],
2502
+ "interval": 32.0,
2503
+ "name": "derivationTick"
2504
+ }
2505
+ ]
2506
+ }
2507
+ ]
2508
+ }
2509
+ ],
2510
+ "schemaVersion": 1,
2511
+ "version": "1.0.0"
2512
+ }