@almadar/std 16.145.0 → 16.147.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 (135) hide show
  1. package/behaviors/lolo/infra/atoms/std-migration-job.lolo +269 -0
  2. package/behaviors/lolo/infra/atoms/std-mod-queue.lolo +1 -1
  3. package/behaviors/lolo/ml/atoms/std-data-collector.lolo +56 -0
  4. package/behaviors/lolo/ml/atoms/std-graph-builder.lolo +90 -0
  5. package/behaviors/lolo/ml/atoms/std-ml-similarity.lolo +25 -13
  6. package/behaviors/lolo/ml/atoms/std-tokenizer.lolo +108 -0
  7. package/behaviors/lolo/ml/atoms/std-weight-validator.lolo +106 -0
  8. package/behaviors/lolo/ui/core/atoms/std-app-layout.lolo +14 -0
  9. package/behaviors/lolo/ui/core/atoms/std-billable-hour.lolo +1 -1
  10. package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +3 -3
  11. package/behaviors/lolo/ui/core/atoms/std-esign-request.lolo +4 -4
  12. package/behaviors/lolo/ui/core/atoms/std-event-log.lolo +2 -2
  13. package/behaviors/lolo/ui/core/atoms/std-file-store.lolo +1 -1
  14. package/behaviors/lolo/ui/core/atoms/std-gallery.lolo +1 -1
  15. package/behaviors/lolo/ui/core/atoms/std-image-upload-multi.lolo +2 -2
  16. package/behaviors/lolo/ui/core/atoms/std-import.lolo +132 -0
  17. package/behaviors/lolo/ui/core/atoms/std-recurrence.lolo +5 -5
  18. package/behaviors/lolo/ui/core/atoms/std-saved-search.lolo +1 -1
  19. package/behaviors/lolo/ui/core/atoms/std-signature-capture.lolo +1 -1
  20. package/behaviors/lolo/ui/core/atoms/std-stats.lolo +1 -1
  21. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +3 -3
  22. package/behaviors/lolo/ui/core/molecules/ui-data-grid.lolo +0 -2
  23. package/behaviors/lolo/ui/core/molecules/ui-data-list.lolo +0 -2
  24. package/behaviors/lolo/ui/core/molecules/ui-import-preview-tree.lolo +96 -0
  25. package/behaviors/lolo/ui/core/molecules/ui-import-progress.lolo +49 -0
  26. package/behaviors/lolo/ui/core/molecules/ui-import-source-picker.lolo +67 -0
  27. package/behaviors/lolo/ui/core/molecules/ui-table-view.lolo +0 -2
  28. package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +0 -2
  29. package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +0 -2
  30. package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +0 -2
  31. package/behaviors/lolo/ui/core/organisms/ui-timeline.lolo +0 -2
  32. package/behaviors/lolo/ui/game/atoms/std-dungeon-combat.lolo +2 -2
  33. package/behaviors/lolo/ui/game/molecules/std-worldmap-board-2d.lolo +1 -1
  34. package/behaviors/lolo/ui/game/organisms/ui-boardgame-board.lolo +2 -2
  35. package/behaviors/lolo/ui/game/organisms/ui-builder-board.lolo +2 -2
  36. package/behaviors/lolo/ui/game/organisms/ui-debugger-board.lolo +3 -3
  37. package/behaviors/lolo/ui/game/organisms/ui-physics-sandbox-board.lolo +3 -3
  38. package/behaviors/lolo/ui/game/organisms/ui-roguelike-board.lolo +1 -1
  39. package/behaviors/lolo/ui/game/organisms/ui-sequencer-board.lolo +1 -1
  40. package/behaviors/lolo/ui/learning/atoms/std-algo-heapsort.lolo +2 -2
  41. package/behaviors/lolo/ui/learning/atoms/std-algo-mst.lolo +3 -3
  42. package/behaviors/registry/factory-signatures.json +11531 -2142
  43. package/behaviors/registry/infra/atoms/std-migration-job.orb +1310 -0
  44. package/behaviors/registry/infra/atoms/std-mod-queue.orb +5 -5
  45. package/behaviors/registry/ml/atoms/std-data-collector.orb +324 -0
  46. package/behaviors/registry/ml/atoms/std-graph-builder.orb +480 -0
  47. package/behaviors/registry/ml/atoms/std-ml-similarity.orb +127 -72
  48. package/behaviors/registry/ml/atoms/std-tokenizer.orb +570 -0
  49. package/behaviors/registry/ml/atoms/std-weight-validator.orb +624 -0
  50. package/behaviors/registry/ui/core/atoms/std-app-layout.orb +33 -1
  51. package/behaviors/registry/ui/core/atoms/std-billable-hour.orb +2 -2
  52. package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +17 -21
  53. package/behaviors/registry/ui/core/atoms/std-esign-request.orb +7 -13
  54. package/behaviors/registry/ui/core/atoms/std-event-log.orb +2 -4
  55. package/behaviors/registry/ui/core/atoms/std-file-store.orb +3 -4
  56. package/behaviors/registry/ui/core/atoms/std-gallery.orb +11 -20
  57. package/behaviors/registry/ui/core/atoms/std-image-upload-multi.orb +4 -4
  58. package/behaviors/registry/ui/core/atoms/std-import.orb +701 -0
  59. package/behaviors/registry/ui/core/atoms/std-recurrence.orb +5 -10
  60. package/behaviors/registry/ui/core/atoms/std-saved-search.orb +2 -2
  61. package/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
  62. package/behaviors/registry/ui/core/molecules/ui-data-grid.orb +12 -25
  63. package/behaviors/registry/ui/core/molecules/ui-data-list.orb +13 -26
  64. package/behaviors/registry/ui/core/molecules/ui-import-preview-tree.orb +354 -0
  65. package/behaviors/registry/ui/core/molecules/ui-import-progress.orb +195 -0
  66. package/behaviors/registry/ui/core/molecules/ui-import-source-picker.orb +279 -0
  67. package/behaviors/registry/ui/core/molecules/ui-table-view.orb +12 -25
  68. package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +0 -13
  69. package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +8 -21
  70. package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +0 -13
  71. package/behaviors/registry/ui/core/organisms/ui-timeline.orb +0 -13
  72. package/behaviors/registry/ui/game/atoms/std-dungeon-combat.orb +4 -4
  73. package/behaviors/registry/ui/game/molecules/std-worldmap-board-2d.orb +6 -9
  74. package/behaviors/registry/ui/game/organisms/ui-boardgame-board.orb +4 -4
  75. package/behaviors/registry/ui/game/organisms/ui-builder-board.orb +4 -4
  76. package/behaviors/registry/ui/game/organisms/ui-debugger-board.orb +12 -12
  77. package/behaviors/registry/ui/game/organisms/ui-physics-sandbox-board.orb +19 -19
  78. package/behaviors/registry/ui/game/organisms/ui-roguelike-board.orb +1 -1
  79. package/behaviors/registry/ui/game/organisms/ui-sequencer-board.orb +2 -2
  80. package/behaviors/registry/ui/learning/atoms/std-algo-heapsort.orb +8 -8
  81. package/dist/behaviors/behaviors-embeddings.json +568 -496
  82. package/dist/behaviors/behaviors-registry.json +7518 -3936
  83. package/dist/behaviors/exports-reader.js +3093 -2581
  84. package/dist/behaviors/functions/index.d.ts +922 -14
  85. package/dist/behaviors/functions/index.js +3056 -2582
  86. package/dist/behaviors/index.d.ts +1 -1
  87. package/dist/behaviors/index.js +3094 -2582
  88. package/dist/behaviors/knob-embeddings.json +1 -1
  89. package/dist/behaviors/query.js +3093 -2581
  90. package/dist/behaviors/registry/factory-signatures.json +11531 -2142
  91. package/dist/behaviors/registry/infra/atoms/std-migration-job.orb +1310 -0
  92. package/dist/behaviors/registry/infra/atoms/std-mod-queue.orb +5 -5
  93. package/dist/behaviors/registry/ml/atoms/std-data-collector.orb +324 -0
  94. package/dist/behaviors/registry/ml/atoms/std-graph-builder.orb +480 -0
  95. package/dist/behaviors/registry/ml/atoms/std-ml-similarity.orb +127 -72
  96. package/dist/behaviors/registry/ml/atoms/std-tokenizer.orb +570 -0
  97. package/dist/behaviors/registry/ml/atoms/std-weight-validator.orb +624 -0
  98. package/dist/behaviors/registry/ui/core/atoms/std-app-layout.orb +33 -1
  99. package/dist/behaviors/registry/ui/core/atoms/std-billable-hour.orb +2 -2
  100. package/dist/behaviors/registry/ui/core/atoms/std-esign-flow.orb +17 -21
  101. package/dist/behaviors/registry/ui/core/atoms/std-esign-request.orb +7 -13
  102. package/dist/behaviors/registry/ui/core/atoms/std-event-log.orb +2 -4
  103. package/dist/behaviors/registry/ui/core/atoms/std-file-store.orb +3 -4
  104. package/dist/behaviors/registry/ui/core/atoms/std-gallery.orb +11 -20
  105. package/dist/behaviors/registry/ui/core/atoms/std-image-upload-multi.orb +4 -4
  106. package/dist/behaviors/registry/ui/core/atoms/std-import.orb +701 -0
  107. package/dist/behaviors/registry/ui/core/atoms/std-recurrence.orb +5 -10
  108. package/dist/behaviors/registry/ui/core/atoms/std-saved-search.orb +2 -2
  109. package/dist/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
  110. package/dist/behaviors/registry/ui/core/molecules/ui-data-grid.orb +12 -25
  111. package/dist/behaviors/registry/ui/core/molecules/ui-data-list.orb +13 -26
  112. package/dist/behaviors/registry/ui/core/molecules/ui-import-preview-tree.orb +354 -0
  113. package/dist/behaviors/registry/ui/core/molecules/ui-import-progress.orb +195 -0
  114. package/dist/behaviors/registry/ui/core/molecules/ui-import-source-picker.orb +279 -0
  115. package/dist/behaviors/registry/ui/core/molecules/ui-table-view.orb +12 -25
  116. package/dist/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +0 -13
  117. package/dist/behaviors/registry/ui/core/organisms/ui-entity-list.orb +8 -21
  118. package/dist/behaviors/registry/ui/core/organisms/ui-entity-table.orb +0 -13
  119. package/dist/behaviors/registry/ui/core/organisms/ui-timeline.orb +0 -13
  120. package/dist/behaviors/registry/ui/game/atoms/std-dungeon-combat.orb +4 -4
  121. package/dist/behaviors/registry/ui/game/molecules/std-worldmap-board-2d.orb +6 -9
  122. package/dist/behaviors/registry/ui/game/organisms/ui-boardgame-board.orb +4 -4
  123. package/dist/behaviors/registry/ui/game/organisms/ui-builder-board.orb +4 -4
  124. package/dist/behaviors/registry/ui/game/organisms/ui-debugger-board.orb +12 -12
  125. package/dist/behaviors/registry/ui/game/organisms/ui-physics-sandbox-board.orb +19 -19
  126. package/dist/behaviors/registry/ui/game/organisms/ui-roguelike-board.orb +1 -1
  127. package/dist/behaviors/registry/ui/game/organisms/ui-sequencer-board.orb +2 -2
  128. package/dist/behaviors/registry/ui/learning/atoms/std-algo-heapsort.orb +8 -8
  129. package/dist/behaviors-embeddings.json +568 -496
  130. package/dist/behaviors-registry.json +7518 -3936
  131. package/dist/index.d.ts +1 -1
  132. package/dist/index.js +3094 -2582
  133. package/dist/knob-embeddings.json +1 -1
  134. package/dist/registry/factory-signatures.json +11531 -2142
  135. package/package.json +2 -2
@@ -0,0 +1,269 @@
1
+ app std-migration-job "1.0.0"
2
+ "std-migration-job — one import run of external data into the host system, modeled as a persistent MigrationJob row with a lifecycle state machine: idle → fetching → mapping → reviewing → committing → done | failed. All source access goes through the migration service (call-service \"migration\" listDocuments / fetchDocument / commit) — the atom never talks to a source directly, and the host-injected service handler resolves credentials from the connectionRef knob (a reference, never the secret). Staging/mapping is host work (deterministic pipeline or agent): the atom fetches, the host stages and emits MIGRATION_STAGED, the user approves (MIGRATION_APPROVED) and only then does commit run. Terminal runs persist the job row for provenance. Rebind the entity to a host-owned job entity via linkedEntity; target and connectionRef are config knobs."
3
+ orbital MigrationJobOrbital {
4
+
5
+ entity MigrationJob [persistent: migration_jobs] {
6
+ id : string!
7
+ source : object @description "ImportSource descriptor of the run (kind + options), supplied by the host." = {}
8
+ files : [object] @description "Client-side file metadata for upload sources (name/size/type/lastModified)." = []
9
+ target : string @description "Name of the host entity this import writes into." = ""
10
+ status : "idle" | "fetching" | "mapping" | "reviewing" | "committing" | "done" | "failed" @description "Lifecycle position of the run." = idle
11
+ documents : [object] @description "Document metadata listed from the source." = []
12
+ document : object @description "Most recently fetched document content." = {}
13
+ stats : object @description "Staged/committed/failed/skipped counts." = {}
14
+ error : string @description "Failure detail when status is failed." = ""
15
+ createdAt : number @description "Run start timestamp." = 0
16
+ }
17
+
18
+ trait MigrationJobLifecycle -> @rebindable MigrationJob [lifecycle, instance] {
19
+ initial: idle
20
+
21
+ state idle {
22
+ INIT -> idle
23
+ (set @entity.status idle)
24
+ (set @entity.error "")
25
+ (set @entity.documents [])
26
+ (set @entity.document {})
27
+ (set @entity.stats {})
28
+ MIGRATION_START -> fetching
29
+ (set @entity.source ?source)
30
+ (set @entity.files ?files)
31
+ (set @entity.target @config.target)
32
+ (set @entity.status fetching)
33
+ (set @entity.createdAt (time/now))
34
+ (call-service "migration" "listDocuments" { connectionRef: @config.connectionRef, files: @entity.files, source: @entity.source }
35
+ { emit: { success: DOCUMENTS_LISTED, failure: MIGRATION_CALL_FAILED } })
36
+ }
37
+
38
+ state fetching {
39
+ DOCUMENTS_LISTED -> mapping
40
+ (set @entity.documents ?documents)
41
+ (set @entity.status mapping)
42
+ (emit MIGRATION_FETCHED { documents: @entity.documents })
43
+ ;; Self-loops so the validator sees in-atom listeners for the
44
+ ;; externally-consumed staging events.
45
+ MIGRATION_FETCHED -> mapping
46
+ MIGRATION_DOCUMENT -> mapping
47
+ MIGRATION_CALL_FAILED -> failed
48
+ (set @entity.error ?error)
49
+ (set @entity.status failed)
50
+ (persist create MigrationJob {
51
+ createdAt: @entity.createdAt
52
+ error: @entity.error
53
+ source: @entity.source
54
+ stats: @entity.stats
55
+ status: @entity.status
56
+ target: @entity.target
57
+ })
58
+ (emit MIGRATION_FAILED { error: @entity.error })
59
+ }
60
+
61
+ state mapping {
62
+ FETCH_DOCUMENT -> mapping
63
+ (call-service "migration" "fetchDocument" { connectionRef: @config.connectionRef, documentId: ?documentId, source: @entity.source }
64
+ { emit: { success: DOCUMENT_FETCHED, failure: MIGRATION_CALL_FAILED } })
65
+ DOCUMENT_FETCHED -> mapping
66
+ (set @entity.document ?document)
67
+ (emit MIGRATION_DOCUMENT { document: @entity.document })
68
+ MIGRATION_STAGED -> reviewing
69
+ (set @entity.stats ?stats)
70
+ (set @entity.status reviewing)
71
+ (emit MIGRATION_REVIEW_READY { stats: @entity.stats })
72
+ MIGRATION_DISCARDED -> idle
73
+ (set @entity.status idle)
74
+ (set @entity.documents [])
75
+ (set @entity.document {})
76
+ (set @entity.stats {})
77
+ MIGRATION_CALL_FAILED -> failed
78
+ (set @entity.error ?error)
79
+ (set @entity.status failed)
80
+ (persist create MigrationJob {
81
+ createdAt: @entity.createdAt
82
+ error: @entity.error
83
+ source: @entity.source
84
+ stats: @entity.stats
85
+ status: @entity.status
86
+ target: @entity.target
87
+ })
88
+ (emit MIGRATION_FAILED { error: @entity.error })
89
+ }
90
+
91
+ state reviewing {
92
+ MIGRATION_APPROVED -> committing
93
+ (set @entity.status committing)
94
+ (call-service "migration" "commit" { jobId: @entity.id, units: ?units }
95
+ { emit: { success: COMMITTED, failure: MIGRATION_CALL_FAILED } })
96
+ MIGRATION_REJECTED -> mapping
97
+ (set @entity.status mapping)
98
+ MIGRATION_REVIEW_READY -> reviewing
99
+ MIGRATION_DISCARDED -> idle
100
+ (set @entity.status idle)
101
+ (set @entity.documents [])
102
+ (set @entity.document {})
103
+ (set @entity.stats {})
104
+ }
105
+
106
+ state committing {
107
+ COMMITTED -> done
108
+ (set @entity.stats (object/merge @entity.stats { committed: ?committed, failed: ?failed }))
109
+ (set @entity.status done)
110
+ (persist create MigrationJob {
111
+ createdAt: @entity.createdAt
112
+ error: ""
113
+ source: @entity.source
114
+ stats: @entity.stats
115
+ status: @entity.status
116
+ target: @entity.target
117
+ })
118
+ (emit MIGRATION_COMPLETED { stats: @entity.stats })
119
+ MIGRATION_CALL_FAILED -> failed
120
+ (set @entity.error ?error)
121
+ (set @entity.status failed)
122
+ (persist create MigrationJob {
123
+ createdAt: @entity.createdAt
124
+ error: @entity.error
125
+ source: @entity.source
126
+ stats: @entity.stats
127
+ status: @entity.status
128
+ target: @entity.target
129
+ })
130
+ (emit MIGRATION_FAILED { error: @entity.error })
131
+ }
132
+
133
+ state done {
134
+ RESET -> idle
135
+ (set @entity.status idle)
136
+ (set @entity.error "")
137
+ (set @entity.documents [])
138
+ (set @entity.document {})
139
+ (set @entity.stats {})
140
+ ;; Self-loop so the validator sees an in-atom listener for the
141
+ ;; externally-consumed completion event.
142
+ MIGRATION_COMPLETED -> done
143
+ }
144
+
145
+ state failed {
146
+ MIGRATION_RETRY -> fetching
147
+ (set @entity.status fetching)
148
+ (set @entity.error "")
149
+ (call-service "migration" "listDocuments" { connectionRef: @config.connectionRef, files: @entity.files, source: @entity.source }
150
+ { emit: { success: DOCUMENTS_LISTED, failure: MIGRATION_CALL_FAILED } })
151
+ RESET -> idle
152
+ (set @entity.status idle)
153
+ (set @entity.error "")
154
+ (set @entity.documents [])
155
+ (set @entity.document {})
156
+ (set @entity.stats {})
157
+ ;; Mirrors the done self-loop: MIGRATION_FAILED is emitted for
158
+ ;; downstream consumers and listened to here for the validator.
159
+ MIGRATION_FAILED -> failed
160
+ }
161
+
162
+ emits {
163
+ DOCUMENTS_LISTED {
164
+ documents : [object]!
165
+ }
166
+ @description "migration.listDocuments service result, flattened onto the payload by the call-service effect executor"
167
+ @tier "secondary"
168
+ DOCUMENT_FETCHED {
169
+ document : object!
170
+ }
171
+ @description "migration.fetchDocument service result, flattened onto the payload by the call-service effect executor"
172
+ @tier "secondary"
173
+ COMMITTED {
174
+ committed : number!
175
+ failed : [object]!
176
+ }
177
+ @description "migration.commit service result — committed count plus per-unit failures"
178
+ @tier "secondary"
179
+ MIGRATION_CALL_FAILED {
180
+ error : string!
181
+ }
182
+ @description "migration service call failure signal — lands the run in failed, never a silent swallow"
183
+ @tier "secondary"
184
+ MIGRATION_FETCHED -> external {
185
+ documents : [object]!
186
+ }
187
+ @description "Source documents are listed and the run is ready for staging (deterministic pipeline or agent)"
188
+ @synonyms "import fetched, source listed, documents ready"
189
+ @tier "domain"
190
+ MIGRATION_DOCUMENT -> external {
191
+ document : object!
192
+ }
193
+ @description "A single fetched document's content, for the host staging layer to map into target units"
194
+ @synonyms "document loaded, content fetched"
195
+ @tier "domain"
196
+ MIGRATION_REVIEW_READY -> external {
197
+ stats : object!
198
+ }
199
+ @description "Staging is complete; the preview is ready for the approval gate"
200
+ @synonyms "preview ready, staging complete, review import"
201
+ @tier "domain"
202
+ MIGRATION_COMPLETED -> external {
203
+ stats : object!
204
+ }
205
+ @description "The commit drained through the host sink; stats carry committed and per-unit failed counts"
206
+ @synonyms "import done, migration complete, data imported"
207
+ @tier "domain"
208
+ MIGRATION_FAILED -> external {
209
+ error : string!
210
+ }
211
+ @description "The run failed; error carries the service-reported detail and the terminal job row was persisted"
212
+ @synonyms "import failed, migration error"
213
+ @tier "domain"
214
+ }
215
+
216
+ listens {
217
+ MIGRATION_START {
218
+ source : object!
219
+ files : [object]
220
+ }
221
+ @description "Starts an import run. source is the ImportSource descriptor; files carries client file metadata for upload sources. Also reached via a sibling std-import's IMPORT_REQUESTED."
222
+ @synonyms "start import, run migration, import data"
223
+ @tier "domain"
224
+ FETCH_DOCUMENT {
225
+ documentId : string!
226
+ }
227
+ @description "Fetch one document's full content from the source during staging"
228
+ @tier "internal"
229
+ MIGRATION_STAGED {
230
+ stats : object!
231
+ }
232
+ @description "Host staging finished — units are staged and validated; stats summarize staged/skipped counts for the preview"
233
+ @tier "internal"
234
+ MIGRATION_APPROVED {
235
+ units : [object]!
236
+ }
237
+ @description "The user approved the preview; units are the staged ImportUnits to commit through the host sink"
238
+ @synonyms "approve import, confirm migration"
239
+ @tier "domain"
240
+ MIGRATION_REJECTED
241
+ @description "The user sent the preview back for more staging"
242
+ @tier "internal"
243
+ MIGRATION_DISCARDED
244
+ @description "The run was discarded before commit"
245
+ @tier "internal"
246
+ MIGRATION_RETRY
247
+ @description "Re-runs the fetch after a failure, with the same source"
248
+ @tier "internal"
249
+ RESET
250
+ @description "Returns the job to idle from a terminal state"
251
+ @tier "internal"
252
+ }
253
+
254
+ config {
255
+ target : string = ""
256
+ @label "Target entity"
257
+ @description "Name of the host entity this import writes into (e.g. the organism's own entity). The migration service derives the full target descriptor from the running app's schema."
258
+ @synonyms "destination, import into, target type"
259
+ @tier "domain"
260
+ connectionRef : string = ""
261
+ @label "Connection reference"
262
+ @description "Secret-store / environment KEY holding the source credentials. The reference is stored; the secret itself never enters config, traces, or snapshots — the migration service resolves it at run time. (Typed `string` until the `secret` config-field type lands in the lolo language — tracked gap.)"
263
+ @synonyms "credential key, connection string reference, secret name"
264
+ @tier "internal"
265
+ }
266
+ }
267
+
268
+ page "/migration-job" as MigrationJobPage -> MigrationJobLifecycle
269
+ }
@@ -24,7 +24,7 @@ orbital ModQueueItemOrbital {
24
24
  flagCount : number @description "The number of times this item has been flagged." @synonyms "flags, flag_count, count"
25
25
  status : "pending" | "approved" | "rejected" | "escalated" @description "Current state of the moderation item." @synonyms "state, condition, stage" = pending
26
26
  reviewedBy : string @description "The user who performed the review action." @synonyms "reviewer, reviewerId, assignedTo"
27
- reviewedAt : string @description "Timestamp indicating when the item was last reviewed." @synonyms "review date, review time, last reviewed"
27
+ reviewedAt : datetime @description "Timestamp indicating when the item was last reviewed." @synonyms "review date, review time, last reviewed"
28
28
  notes : string @description "Free-text comments or observations related to the item." @synonyms "comment, remark, observation, details"
29
29
  }
30
30
 
@@ -0,0 +1,56 @@
1
+ app std-data-collector "1.0.0"
2
+ "std-data-collector — pure buffer-accumulation atom, parameterized for any ML domain. Collects data points into a buffer and fires BUFFER_READY with the full accumulated buffer once it reaches config.bufferSize, then resets for the next cycle. No ML compute, no model call — state machine + array operators only. Use ahead of a training loop, a batch inference call, or any downstream rung that needs a fixed-size window of accumulated observations."
3
+ orbital MlDataCollectorOrbital {
4
+
5
+ entity DataBuffer [runtime] {
6
+ buffer : [any] @description "Data points accumulated in the current cycle." = []
7
+ count : int @description "Number of points currently in the buffer." = 0
8
+ status : "idle" | "collecting" = idle
9
+ }
10
+
11
+ trait DataCollectorRun -> @rebindable DataBuffer [lifecycle, instance] {
12
+ initial: collecting
13
+
14
+ state collecting {
15
+ INIT -> collecting
16
+ (set @entity.buffer [])
17
+ (set @entity.count 0)
18
+ (set @entity.status idle)
19
+
20
+ COLLECT -> collecting
21
+ (let ((newBuffer (array/append @entity.buffer ?point))
22
+ (newCount (+ @entity.count 1)))
23
+ (if (>= @newCount @config.bufferSize)
24
+ (do
25
+ (set @entity.buffer [])
26
+ (set @entity.count 0)
27
+ (set @entity.status idle)
28
+ (emit BUFFER_READY { buffer: @newBuffer, count: @newCount }))
29
+ (do
30
+ (set @entity.buffer @newBuffer)
31
+ (set @entity.count @newCount)
32
+ (set @entity.status collecting))))
33
+ }
34
+
35
+ emits {
36
+ BUFFER_READY -> external { buffer : [any]!, count : int! }
37
+ @description "Fired when the buffer reaches config.bufferSize; carries the full accumulated buffer and its count, then the buffer resets for the next cycle."
38
+ @tier "primary"
39
+ }
40
+
41
+ listens {
42
+ COLLECT {
43
+ point : any!
44
+ }
45
+ }
46
+
47
+ config {
48
+ bufferSize : int = 100
49
+ @label "Buffer size"
50
+ @description "Number of data points collected before BUFFER_READY fires."
51
+ @tier "domain"
52
+ }
53
+ }
54
+
55
+ page "/ml-data-collector" as MlDataCollectorPage -> DataCollectorRun
56
+ }
@@ -0,0 +1,90 @@
1
+ app std-graph-builder "1.0.0"
2
+ "Graph construction atom — builds node/edge structures from an entity collection for downstream GNN pipelines; pure array/object transform, no ML compute."
3
+
4
+ orbital GraphBuilderOrbital {
5
+
6
+ entity GraphStructure [runtime] {
7
+ nodes : [object] = []
8
+ edges : [object] = []
9
+ nodeCount : int = 0
10
+ edgeCount : int = 0
11
+ status : "idle" | "built" = idle
12
+ }
13
+
14
+ trait GraphBuilderRun -> GraphStructure [lifecycle, instance] {
15
+ initial: idle
16
+
17
+ config {
18
+ edgeField : string = ""
19
+ @label "Edge field"
20
+ @description "Field on each source entity holding its adjacency — an array of target ids"
21
+ @tier "domain"
22
+ nodeFeatures : [string] = []
23
+ @label "Node features"
24
+ @description "Entity fields carried onto each node alongside id"
25
+ @tier "domain"
26
+ directed : boolean = false
27
+ @label "Directed"
28
+ @description "Carried through for downstream consumers; edges are emitted once per adjacency entry, so an undirected reader should treat each edge as bidirectional"
29
+ @tier "policy"
30
+ }
31
+
32
+ state idle {
33
+ INIT -> idle
34
+ (set @entity.nodes [])
35
+ (set @entity.edges [])
36
+ (set @entity.nodeCount 0)
37
+ (set @entity.edgeCount 0)
38
+ (set @entity.status idle)
39
+
40
+ BUILD_GRAPH -> built
41
+ (let ((nodeFields (array/unique (array/append @config.nodeFeatures "id")))
42
+ (nodes (array/map ?entities (fn e (object/pick @e @nodeFields))))
43
+ (edges (array/flatten (array/map ?entities (fn e
44
+ (array/map (object/get @e @config.edgeField [])
45
+ (fn target { source: (object/get @e "id"), target: @target })))))))
46
+ (do
47
+ (set @entity.nodes @nodes)
48
+ (set @entity.edges @edges)
49
+ (set @entity.nodeCount (array/len @nodes))
50
+ (set @entity.edgeCount (array/len @edges))
51
+ (set @entity.status built)
52
+ (emit GRAPH_READY {
53
+ nodes: @nodes,
54
+ edges: @edges,
55
+ nodeCount: (array/len @nodes),
56
+ edgeCount: (array/len @edges)
57
+ })))
58
+ }
59
+
60
+ state built {
61
+ INIT -> built
62
+ (set @entity.status built)
63
+ RESET -> idle
64
+ (set @entity.nodes [])
65
+ (set @entity.edges [])
66
+ (set @entity.nodeCount 0)
67
+ (set @entity.edgeCount 0)
68
+ (set @entity.status idle)
69
+ }
70
+
71
+ emits {
72
+ GRAPH_READY -> external {
73
+ nodes : [object]!
74
+ edges : [object]!
75
+ nodeCount : int!
76
+ edgeCount : int!
77
+ }
78
+ @description "Fired when node/edge structures have been built from the source entity collection"
79
+ @tier "primary"
80
+ }
81
+
82
+ listens {
83
+ BUILD_GRAPH {
84
+ entities : [object]!
85
+ }
86
+ }
87
+ }
88
+
89
+ page "/graph-builder" as GraphBuilderPage -> GraphBuilderRun
90
+ }
@@ -74,21 +74,33 @@ orbital MlSimilarityOrbital {
74
74
  state embedding {
75
75
  EMBEDDED -> resolved
76
76
  (set @entity.embeddings ?result)
77
- (set @entity.queryVector (array/first @entity.embeddings))
78
- (set @entity.candidateVectors (array/drop @entity.embeddings 1))
79
77
  (set @entity.status resolved)
80
- (let ((nearest (array/nearest @entity.queryVector @entity.candidateVectors)))
78
+ ;; An embed result without query + at least one candidate vector is an
79
+ ;; abstain, not a crash — the rung can prove nothing from it.
80
+ (if (< (array/len ?result) 2)
81
81
  (do
82
- (set @entity.matchIndex (object/get @nearest "index"))
83
- (set @entity.matchScore (object/get @nearest "score"))
84
- (set @entity.matchMargin (object/get @nearest "margin"))
85
- (if (and (>= @entity.matchScore @config.floor) (>= @entity.matchMargin @config.margin))
86
- (do
87
- (set @entity.reason "")
88
- (emit SIMILARITY_MATCHED { index: @entity.matchIndex, score: @entity.matchScore }))
89
- (do
90
- (set @entity.reason (if (< @entity.matchScore @config.floor) "below floor" "thin margin"))
91
- (emit SIMILARITY_ABSTAINED { reason: @entity.reason, request: @entity.request })))))
82
+ (set @entity.queryVector [])
83
+ (set @entity.candidateVectors [])
84
+ (set @entity.matchIndex 0)
85
+ (set @entity.matchScore 0)
86
+ (set @entity.matchMargin 0)
87
+ (set @entity.reason "embedding result incomplete")
88
+ (emit SIMILARITY_ABSTAINED { reason: "embedding result incomplete", request: @entity.request }))
89
+ (do
90
+ (set @entity.queryVector (array/first @entity.embeddings))
91
+ (set @entity.candidateVectors (array/drop @entity.embeddings 1))
92
+ (let ((nearest (array/nearest @entity.queryVector @entity.candidateVectors)))
93
+ (do
94
+ (set @entity.matchIndex (object/get @nearest "index"))
95
+ (set @entity.matchScore (object/get @nearest "score"))
96
+ (set @entity.matchMargin (object/get @nearest "margin"))
97
+ (if (and (>= @entity.matchScore @config.floor) (>= @entity.matchMargin @config.margin))
98
+ (do
99
+ (set @entity.reason "")
100
+ (emit SIMILARITY_MATCHED { index: @entity.matchIndex, score: @entity.matchScore }))
101
+ (do
102
+ (set @entity.reason (if (< @entity.matchScore @config.floor) "below floor" "thin margin"))
103
+ (emit SIMILARITY_ABSTAINED { reason: @entity.reason, request: @entity.request })))))))
92
104
 
93
105
  EMBED_FAILED -> resolved
94
106
  (set @entity.embeddings [])
@@ -0,0 +1,108 @@
1
+ app std-tokenizer "1.0.0"
2
+ "std-tokenizer — a text-preprocessing atom for tokenization. Splits raw text into a token sequence using a configurable method (whitespace, character, or arbitrary delimiter), normalizes and truncates the sequence, then maps each token to a vocabulary id (falling back to unkId when the token is absent from config.vocab). Feeds downstream embedding or sequence-model atoms. Pure circuit logic: str/* and array/* operators only, no ML compute, no model call."
3
+
4
+ orbital MlTokenizerOrbital {
5
+
6
+ entity TokenSequence [runtime] {
7
+ text : string = ""
8
+ tokens : [string] = []
9
+ tokenIds : [int] = []
10
+ tokenCount : int = 0
11
+ request : object = {}
12
+ status : "idle" | "checked" = idle
13
+ }
14
+
15
+ trait TokenizerRun -> TokenSequence [lifecycle, instance] {
16
+ initial: idle
17
+
18
+ config {
19
+ method : "whitespace" | "character" | "delimiter" = whitespace
20
+ @label "Method"
21
+ @description "Whitespace splits on single spaces, character splits into individual characters, delimiter splits on config.delimiter"
22
+ @tier "policy"
23
+ delimiter : string = ","
24
+ @label "Delimiter"
25
+ @description "Split delimiter used when method is delimiter; ignored otherwise"
26
+ @tier "domain"
27
+ lowercase : boolean = true
28
+ @label "Lowercase"
29
+ @description "Lowercase every token before vocabulary lookup"
30
+ @tier "policy"
31
+ trimWhitespace : boolean = true
32
+ @label "Trim whitespace"
33
+ @description "Trim each token and drop tokens that are empty afterward"
34
+ @tier "policy"
35
+ maxLength : int = 512
36
+ @label "Max length"
37
+ @description "Truncate the token sequence to at most this many tokens"
38
+ @tier "policy"
39
+ vocab : Map string int = {}
40
+ @label "Vocabulary"
41
+ @description "Token-to-id map; a token absent from this map resolves to unkId"
42
+ @tier "domain"
43
+ unkId : int = 0
44
+ @label "Unknown token id"
45
+ @description "Id assigned to a token that is not present in config.vocab"
46
+ @tier "policy"
47
+ }
48
+
49
+ state idle {
50
+ INIT -> idle
51
+ (set @entity.text "")
52
+ (set @entity.tokens [])
53
+ (set @entity.tokenIds [])
54
+ (set @entity.tokenCount 0)
55
+ (set @entity.request {})
56
+ (set @entity.status idle)
57
+
58
+ TOKENIZE -> checked
59
+ (let ((split (if (== @config.method "character")
60
+ (str/split ?text "")
61
+ (str/split ?text (if (== @config.method "delimiter") @config.delimiter " "))))
62
+ (trimmed (if @config.trimWhitespace (array/map @split (fn t (str/trim @t))) @split))
63
+ (normalized (if @config.lowercase (array/map @trimmed (fn t (str/lower @t))) @trimmed))
64
+ (nonEmpty (array/filter @normalized (fn t (> (str/len @t) 0))))
65
+ (truncated (array/slice @nonEmpty 0 @config.maxLength))
66
+ (ids (array/map @truncated (fn t (object/get @config.vocab @t @config.unkId)))))
67
+ (do
68
+ (set @entity.text ?text)
69
+ (set @entity.tokens @truncated)
70
+ (set @entity.tokenIds @ids)
71
+ (set @entity.tokenCount (array/len @truncated))
72
+ (set @entity.request ?request)
73
+ (set @entity.status checked)
74
+ (emit TOKENIZED { tokens: @entity.tokens, tokenIds: @entity.tokenIds, tokenCount: @entity.tokenCount })))
75
+ }
76
+
77
+ state checked {
78
+ INIT -> checked
79
+ (set @entity.status checked)
80
+ RESET -> idle
81
+ (set @entity.text "")
82
+ (set @entity.tokens [])
83
+ (set @entity.tokenIds [])
84
+ (set @entity.tokenCount 0)
85
+ (set @entity.request {})
86
+ (set @entity.status idle)
87
+ }
88
+
89
+ emits {
90
+ TOKENIZED -> external {
91
+ tokens : [string]!
92
+ tokenIds : [int]!
93
+ tokenCount : int!
94
+ }
95
+ @description "Text tokenized into a normalized, truncated token sequence with vocabulary ids"
96
+ @tier "primary"
97
+ }
98
+
99
+ listens {
100
+ TOKENIZE {
101
+ text : string!
102
+ request : object
103
+ }
104
+ }
105
+ }
106
+
107
+ page "/ml-tokenizer" as MlTokenizerPage -> TokenizerRun
108
+ }