@almadar/std 16.146.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.
- package/behaviors/lolo/infra/atoms/std-migration-job.lolo +269 -0
- package/behaviors/lolo/infra/atoms/std-mod-queue.lolo +1 -1
- package/behaviors/lolo/ml/atoms/std-data-collector.lolo +56 -0
- package/behaviors/lolo/ml/atoms/std-graph-builder.lolo +90 -0
- package/behaviors/lolo/ml/atoms/std-tokenizer.lolo +108 -0
- package/behaviors/lolo/ml/atoms/std-weight-validator.lolo +106 -0
- package/behaviors/lolo/ui/core/atoms/std-billable-hour.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +3 -3
- package/behaviors/lolo/ui/core/atoms/std-esign-request.lolo +4 -4
- package/behaviors/lolo/ui/core/atoms/std-event-log.lolo +2 -2
- package/behaviors/lolo/ui/core/atoms/std-file-store.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-gallery.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-image-upload-multi.lolo +2 -2
- package/behaviors/lolo/ui/core/atoms/std-import.lolo +132 -0
- package/behaviors/lolo/ui/core/atoms/std-recurrence.lolo +5 -5
- package/behaviors/lolo/ui/core/atoms/std-saved-search.lolo +1 -1
- package/behaviors/lolo/ui/core/atoms/std-signature-capture.lolo +1 -1
- package/behaviors/lolo/ui/core/molecules/ui-data-grid.lolo +0 -2
- package/behaviors/lolo/ui/core/molecules/ui-data-list.lolo +0 -2
- package/behaviors/lolo/ui/core/molecules/ui-import-preview-tree.lolo +96 -0
- package/behaviors/lolo/ui/core/molecules/ui-import-progress.lolo +49 -0
- package/behaviors/lolo/ui/core/molecules/ui-import-source-picker.lolo +67 -0
- package/behaviors/lolo/ui/core/molecules/ui-table-view.lolo +0 -2
- package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +0 -2
- package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +0 -2
- package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +0 -2
- package/behaviors/lolo/ui/core/organisms/ui-timeline.lolo +0 -2
- package/behaviors/registry/factory-signatures.json +11531 -2142
- package/behaviors/registry/infra/atoms/std-migration-job.orb +1310 -0
- package/behaviors/registry/infra/atoms/std-mod-queue.orb +5 -5
- package/behaviors/registry/ml/atoms/std-data-collector.orb +324 -0
- package/behaviors/registry/ml/atoms/std-graph-builder.orb +480 -0
- package/behaviors/registry/ml/atoms/std-tokenizer.orb +570 -0
- package/behaviors/registry/ml/atoms/std-weight-validator.orb +624 -0
- package/behaviors/registry/ui/core/atoms/std-billable-hour.orb +2 -2
- package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +17 -21
- package/behaviors/registry/ui/core/atoms/std-esign-request.orb +7 -13
- package/behaviors/registry/ui/core/atoms/std-event-log.orb +2 -4
- package/behaviors/registry/ui/core/atoms/std-file-store.orb +3 -4
- package/behaviors/registry/ui/core/atoms/std-gallery.orb +11 -20
- package/behaviors/registry/ui/core/atoms/std-image-upload-multi.orb +4 -4
- package/behaviors/registry/ui/core/atoms/std-import.orb +701 -0
- package/behaviors/registry/ui/core/atoms/std-recurrence.orb +5 -10
- package/behaviors/registry/ui/core/atoms/std-saved-search.orb +2 -2
- package/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
- package/behaviors/registry/ui/core/molecules/ui-data-grid.orb +12 -25
- package/behaviors/registry/ui/core/molecules/ui-data-list.orb +13 -26
- package/behaviors/registry/ui/core/molecules/ui-import-preview-tree.orb +354 -0
- package/behaviors/registry/ui/core/molecules/ui-import-progress.orb +195 -0
- package/behaviors/registry/ui/core/molecules/ui-import-source-picker.orb +279 -0
- package/behaviors/registry/ui/core/molecules/ui-table-view.orb +12 -25
- package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +0 -13
- package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +8 -21
- package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +0 -13
- package/behaviors/registry/ui/core/organisms/ui-timeline.orb +0 -13
- package/dist/behaviors/behaviors-embeddings.json +477 -405
- package/dist/behaviors/behaviors-registry.json +7518 -3936
- package/dist/behaviors/exports-reader.js +3093 -2581
- package/dist/behaviors/functions/index.d.ts +922 -14
- package/dist/behaviors/functions/index.js +3056 -2582
- package/dist/behaviors/index.d.ts +1 -1
- package/dist/behaviors/index.js +3094 -2582
- package/dist/behaviors/knob-embeddings.json +1 -1
- package/dist/behaviors/query.js +3093 -2581
- package/dist/behaviors/registry/factory-signatures.json +11531 -2142
- package/dist/behaviors/registry/infra/atoms/std-migration-job.orb +1310 -0
- package/dist/behaviors/registry/infra/atoms/std-mod-queue.orb +5 -5
- package/dist/behaviors/registry/ml/atoms/std-data-collector.orb +324 -0
- package/dist/behaviors/registry/ml/atoms/std-graph-builder.orb +480 -0
- package/dist/behaviors/registry/ml/atoms/std-tokenizer.orb +570 -0
- package/dist/behaviors/registry/ml/atoms/std-weight-validator.orb +624 -0
- package/dist/behaviors/registry/ui/core/atoms/std-billable-hour.orb +2 -2
- package/dist/behaviors/registry/ui/core/atoms/std-esign-flow.orb +17 -21
- package/dist/behaviors/registry/ui/core/atoms/std-esign-request.orb +7 -13
- package/dist/behaviors/registry/ui/core/atoms/std-event-log.orb +2 -4
- package/dist/behaviors/registry/ui/core/atoms/std-file-store.orb +3 -4
- package/dist/behaviors/registry/ui/core/atoms/std-gallery.orb +11 -20
- package/dist/behaviors/registry/ui/core/atoms/std-image-upload-multi.orb +4 -4
- package/dist/behaviors/registry/ui/core/atoms/std-import.orb +701 -0
- package/dist/behaviors/registry/ui/core/atoms/std-recurrence.orb +5 -10
- package/dist/behaviors/registry/ui/core/atoms/std-saved-search.orb +2 -2
- package/dist/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
- package/dist/behaviors/registry/ui/core/molecules/ui-data-grid.orb +12 -25
- package/dist/behaviors/registry/ui/core/molecules/ui-data-list.orb +13 -26
- package/dist/behaviors/registry/ui/core/molecules/ui-import-preview-tree.orb +354 -0
- package/dist/behaviors/registry/ui/core/molecules/ui-import-progress.orb +195 -0
- package/dist/behaviors/registry/ui/core/molecules/ui-import-source-picker.orb +279 -0
- package/dist/behaviors/registry/ui/core/molecules/ui-table-view.orb +12 -25
- package/dist/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +0 -13
- package/dist/behaviors/registry/ui/core/organisms/ui-entity-list.orb +8 -21
- package/dist/behaviors/registry/ui/core/organisms/ui-entity-table.orb +0 -13
- package/dist/behaviors/registry/ui/core/organisms/ui-timeline.orb +0 -13
- package/dist/behaviors-embeddings.json +477 -405
- package/dist/behaviors-registry.json +7518 -3936
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3094 -2582
- package/dist/knob-embeddings.json +1 -1
- package/dist/registry/factory-signatures.json +11531 -2142
- 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 :
|
|
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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
app std-weight-validator "1.0.0"
|
|
2
|
+
"std-weight-validator — a constraint-checking atom for model weights, applying the same discipline as the zero-warning validator to weights: constrained and checked, not trusted (Almadar_Intelligence_Ladder.md §7.5). Checks a candidate weight tensor against three pure predicate constraints — magnitude bounds (every element's absolute value must clear maxMagnitude), forbidden regions (excluded [min,max] bands no weight may land in even within the magnitude bound), and a regression threshold against a baseline tensor (per-element drift must not exceed regressionThreshold; 0 disables the check) — and reports every violated check with its detail. Emits WEIGHTS_ACCEPTED when all three checks clear, or WEIGHTS_REJECTED carrying the full violations list otherwise. Pure circuit logic: predicates and comparisons only, no ML compute, no model call."
|
|
3
|
+
|
|
4
|
+
type Range = { min: float!, max: float! }
|
|
5
|
+
|
|
6
|
+
orbital MlWeightValidatorOrbital {
|
|
7
|
+
|
|
8
|
+
entity WeightValidation [runtime] {
|
|
9
|
+
weights : [float] = []
|
|
10
|
+
baseline : [float] = []
|
|
11
|
+
violations : [object] = []
|
|
12
|
+
valid : boolean = false
|
|
13
|
+
status : "idle" | "checked" = idle
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
trait WeightValidatorRun -> WeightValidation [lifecycle, instance] {
|
|
17
|
+
initial: idle
|
|
18
|
+
|
|
19
|
+
config {
|
|
20
|
+
maxMagnitude : float = 10
|
|
21
|
+
@label "Max weight magnitude"
|
|
22
|
+
@description "Every weight's absolute value must not exceed this bound"
|
|
23
|
+
@tier "policy"
|
|
24
|
+
forbiddenRegions : [Range] = []
|
|
25
|
+
@label "Forbidden regions"
|
|
26
|
+
@description "Value ranges no weight may fall inside, even within the magnitude bound"
|
|
27
|
+
@tier "domain"
|
|
28
|
+
regressionThreshold : float = 0
|
|
29
|
+
@label "Regression threshold"
|
|
30
|
+
@description "Max allowed per-element absolute drift between candidate and baseline weights; 0 disables the regression check"
|
|
31
|
+
@tier "policy"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
state idle {
|
|
35
|
+
INIT -> idle
|
|
36
|
+
(set @entity.weights [])
|
|
37
|
+
(set @entity.baseline [])
|
|
38
|
+
(set @entity.violations [])
|
|
39
|
+
(set @entity.valid false)
|
|
40
|
+
(set @entity.status idle)
|
|
41
|
+
|
|
42
|
+
VALIDATE_WEIGHTS -> checked
|
|
43
|
+
(let ((cand ?weights)
|
|
44
|
+
(base ?baseline)
|
|
45
|
+
(magnitudeHits (array/filter @cand (fn w (> (math/abs @w) @config.maxMagnitude))))
|
|
46
|
+
(regionHits (array/filter @cand (fn w (array/some @config.forbiddenRegions (fn r (and (>= @w @r.min) (<= @w @r.max)))))))
|
|
47
|
+
(regressionHits (if (> @config.regressionThreshold 0)
|
|
48
|
+
(array/filter (array/range 0 (array/len @cand))
|
|
49
|
+
(fn i (> (math/abs (- (array/nth @cand @i) (array/nth @base @i))) @config.regressionThreshold)))
|
|
50
|
+
[]))
|
|
51
|
+
(violations (array/concat
|
|
52
|
+
(array/map @magnitudeHits (fn w { check: "magnitude", value: @w }))
|
|
53
|
+
(array/map @regionHits (fn w { check: "forbidden-region", value: @w }))
|
|
54
|
+
(array/map @regressionHits (fn i { check: "regression", index: @i })))))
|
|
55
|
+
(do
|
|
56
|
+
(set @entity.weights @cand)
|
|
57
|
+
(set @entity.baseline @base)
|
|
58
|
+
(set @entity.violations @violations)
|
|
59
|
+
(if (== (array/len @violations) 0)
|
|
60
|
+
(do
|
|
61
|
+
(set @entity.valid true)
|
|
62
|
+
(set @entity.status checked)
|
|
63
|
+
(emit WEIGHTS_ACCEPTED { weights: @cand }))
|
|
64
|
+
(do
|
|
65
|
+
(set @entity.valid false)
|
|
66
|
+
(set @entity.status checked)
|
|
67
|
+
(emit WEIGHTS_REJECTED { violations: @violations, request: ?request })))))
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
state checked {
|
|
71
|
+
INIT -> checked
|
|
72
|
+
(set @entity.status checked)
|
|
73
|
+
RESET -> idle
|
|
74
|
+
(set @entity.weights [])
|
|
75
|
+
(set @entity.baseline [])
|
|
76
|
+
(set @entity.violations [])
|
|
77
|
+
(set @entity.valid false)
|
|
78
|
+
(set @entity.status idle)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
emits {
|
|
82
|
+
WEIGHTS_ACCEPTED -> external {
|
|
83
|
+
weights : [float]!
|
|
84
|
+
}
|
|
85
|
+
@description "All constraint checks passed — magnitude bounds, forbidden regions, and regression are all clear"
|
|
86
|
+
@tier "primary"
|
|
87
|
+
|
|
88
|
+
WEIGHTS_REJECTED -> external {
|
|
89
|
+
violations : [object]!
|
|
90
|
+
request : object
|
|
91
|
+
}
|
|
92
|
+
@description "At least one constraint check failed; violations lists every failing check with its detail (magnitude, forbidden-region, or regression). request echoes the originating request untouched so the next rung can project its own inputs out of it"
|
|
93
|
+
@tier "primary"
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
listens {
|
|
97
|
+
VALIDATE_WEIGHTS {
|
|
98
|
+
weights : [float]!
|
|
99
|
+
baseline : [float]
|
|
100
|
+
request : object
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
page "/ml-weight-validator" as MlWeightValidatorPage -> WeightValidatorRun
|
|
106
|
+
}
|
|
@@ -11,7 +11,7 @@ orbital BillableHourOrbital {
|
|
|
11
11
|
workerName : string @description "The name of the worker associated with the time entry." @synonyms "employee, staff, personnel" = ""
|
|
12
12
|
matterId : string @description "Unique identifier for the associated case or project." @synonyms "caseId, projectID, reference" = ""
|
|
13
13
|
projectId : string @description "Identifier for the project associated with the time entry." @synonyms "project, task, reference" = ""
|
|
14
|
-
workDate :
|
|
14
|
+
workDate : date! @description "The date on which the work was performed." @synonyms "date, transaction date, service date"
|
|
15
15
|
hours : number @description "The quantity of time recorded." @synonyms "duration, time, amount" = 0
|
|
16
16
|
rate : number @description "The hourly charge for the work performed." @synonyms "price, cost, amount" = 0
|
|
17
17
|
description : string @description "A textual explanation of the hour entry." @synonyms "explanation, notes, details, comment" = ""
|
|
@@ -18,11 +18,11 @@ orbital SignatureSessionOrbital {
|
|
|
18
18
|
documentId : string! @description "Unique identifier for the associated document." @synonyms "fileID, docID, documentReference"
|
|
19
19
|
documentName : string @description "The name of the document associated with the signature request." @synonyms "filename, document, file" = ""
|
|
20
20
|
recipientName : string! @description "The name of the recipient for the signature request." @synonyms "recipient, name, user"
|
|
21
|
-
recipientEmail :
|
|
21
|
+
recipientEmail : email! @description "The email address of the recipient." @synonyms "email, address, contact"
|
|
22
22
|
requesterName : string @description "The name of the user initiating the signature request." @synonyms "initiator, sender, originator" = ""
|
|
23
23
|
status : "draft" | "sent" | "viewed" | "signed" | "declined" @description "Current state of the signature request." @synonyms "state, condition, stage" = draft
|
|
24
|
-
sentAt :
|
|
25
|
-
signedAt :
|
|
24
|
+
sentAt : datetime @description "Timestamp indicating when the request was sent." @synonyms "sent date, submission time, dispatched"
|
|
25
|
+
signedAt : datetime @description "The date and time the signature was applied." @synonyms "signed date, completion date, signature time"
|
|
26
26
|
pendingId : string @description "Unique identifier for a pending action or task." @synonyms "taskId, pendingKey, referenceId" = ""
|
|
27
27
|
}
|
|
28
28
|
|