@hyperscale0/hsx 1.0.0-alpha.4 → 1.0.0-alpha.6

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.
@@ -24,6 +24,14 @@
24
24
  "maxLength": 48,
25
25
  "pattern": "^[a-z][A-Za-z0-9]*$"
26
26
  },
27
+ "nounRefPath": {
28
+ "type": "string",
29
+ "pattern": "^(fields|refs)\\.[a-z][A-Za-z0-9]*$|^nounInstanceId$"
30
+ },
31
+ "instanceValuePath": {
32
+ "type": "string",
33
+ "pattern": "^(fields|refs)\\.[a-z][A-Za-z0-9]*$"
34
+ },
27
35
  "endpoint": {
28
36
  "description": "A party name, or one of the two endpoints every settlement has without declaring them: `platform` and `escrow`.",
29
37
  "type": "string",
@@ -93,6 +101,11 @@
93
101
  "description": "The settlement's own name. Settlement names are noun ids; nothing renames them.",
94
102
  "$ref": "#/$defs/snakeName"
95
103
  },
104
+ "prefix": {
105
+ "description": "Optional explicit letter-only instance id prefix for generated child nouns.",
106
+ "type": "string",
107
+ "pattern": "^[a-z]{2,8}$"
108
+ },
96
109
  "title": { "type": "string", "minLength": 1, "maxLength": 60 },
97
110
  "summary": { "type": "string", "minLength": 1, "maxLength": 200 },
98
111
  "desc": { "type": "string", "minLength": 1, "maxLength": 400 },
@@ -109,8 +122,89 @@
109
122
  "propertyNames": { "$ref": "#/$defs/snakeName" },
110
123
  "additionalProperties": { "enum": ["payer", "beneficiary", "party"] }
111
124
  },
125
+ "aggregateInvariants": {
126
+ "description": "Per-parent caps over generated child nouns, enforced under the parent lock before a child enters a counted status.",
127
+ "type": "array",
128
+ "minItems": 1,
129
+ "maxItems": 12,
130
+ "items": {
131
+ "oneOf": [
132
+ {
133
+ "type": "object",
134
+ "required": [
135
+ "childField",
136
+ "childNounId",
137
+ "childRefField",
138
+ "childStatuses",
139
+ "parentField"
140
+ ],
141
+ "additionalProperties": false,
142
+ "properties": {
143
+ "childField": { "$ref": "#/$defs/camelName" },
144
+ "childNounId": { "$ref": "#/$defs/snakeName" },
145
+ "childRefField": { "$ref": "#/$defs/camelName" },
146
+ "childStatuses": {
147
+ "type": "array",
148
+ "minItems": 1,
149
+ "maxItems": 12,
150
+ "items": { "$ref": "#/$defs/snakeName" }
151
+ },
152
+ "parentField": { "$ref": "#/$defs/camelName" }
153
+ }
154
+ },
155
+ {
156
+ "type": "object",
157
+ "required": [
158
+ "count",
159
+ "childNounId",
160
+ "childRefField",
161
+ "childStatuses",
162
+ "parentField"
163
+ ],
164
+ "additionalProperties": false,
165
+ "properties": {
166
+ "count": { "const": true },
167
+ "childNounId": { "$ref": "#/$defs/snakeName" },
168
+ "childRefField": { "$ref": "#/$defs/camelName" },
169
+ "childStatuses": {
170
+ "type": "array",
171
+ "minItems": 1,
172
+ "maxItems": 12,
173
+ "items": { "$ref": "#/$defs/snakeName" }
174
+ },
175
+ "parentField": { "$ref": "#/$defs/camelName" }
176
+ }
177
+ }
178
+ ]
179
+ }
180
+ },
181
+ "derivedAmounts": {
182
+ "description": "Machine-computed amounts derived from stored money fields. Callers never supply target fields.",
183
+ "type": "array",
184
+ "minItems": 1,
185
+ "maxItems": 4,
186
+ "items": {
187
+ "type": "object",
188
+ "required": ["field", "rounding", "rule", "sourceField"],
189
+ "additionalProperties": false,
190
+ "properties": {
191
+ "field": { "$ref": "#/$defs/camelName" },
192
+ "rounding": { "const": "floor" },
193
+ "rule": {
194
+ "type": "object",
195
+ "required": ["bps", "kind"],
196
+ "additionalProperties": false,
197
+ "properties": {
198
+ "bps": { "type": "integer", "minimum": 1, "maximum": 9999 },
199
+ "kind": { "const": "percentage_of" }
200
+ }
201
+ },
202
+ "sourceField": { "$ref": "#/$defs/camelName" }
203
+ }
204
+ }
205
+ },
112
206
  "fields": {
113
- "description": "Every value an instance stores. `money` is a positive minor-unit integer; `date` is required, `date?` optional.",
207
+ "description": "Every value an instance stores. `money` is a positive minor-unit integer; `date` is required, `date?` optional; `beneficiary` is a payout beneficiary ID; `ref:<noun>` is a required noun-instance reference.",
114
208
  "type": "object",
115
209
  "propertyNames": { "$ref": "#/$defs/camelName" },
116
210
  "additionalProperties": {
@@ -119,7 +213,24 @@
119
213
  "additionalProperties": false,
120
214
  "properties": {
121
215
  "desc": { "type": "string", "minLength": 1, "maxLength": 200 },
122
- "type": { "enum": ["money", "date", "date?"] }
216
+ "type": {
217
+ "oneOf": [
218
+ {
219
+ "enum": [
220
+ "money",
221
+ "date",
222
+ "date?",
223
+ "text",
224
+ "text?",
225
+ "currency",
226
+ "beneficiary",
227
+ "count"
228
+ ]
229
+ },
230
+ { "type": "string", "pattern": "^const:[1-9][0-9]*$" },
231
+ { "type": "string", "pattern": "^ref:[a-z][a-z0-9_]*$" }
232
+ ]
233
+ }
123
234
  }
124
235
  }
125
236
  },
@@ -161,7 +272,7 @@
161
272
  "description": "States this verb may run in. Absent on `create`.",
162
273
  "type": "array",
163
274
  "minItems": 1,
164
- "maxItems": 6,
275
+ "maxItems": 12,
165
276
  "items": { "$ref": "#/$defs/snakeName" }
166
277
  },
167
278
  "to": {
@@ -169,6 +280,10 @@
169
280
  "$ref": "#/$defs/snakeName"
170
281
  },
171
282
  "summary": { "type": "string", "minLength": 1, "maxLength": 200 },
283
+ "publicIntent": {
284
+ "description": "The stable action-first lowerCamelCase operation name exposed to callers. System due verbs omit it.",
285
+ "$ref": "#/$defs/camelName"
286
+ },
172
287
  "moneyEvent": {
173
288
  "description": "The Business Frame money event this verb's moves belong to.",
174
289
  "$ref": "#/$defs/snakeName"
@@ -180,6 +295,55 @@
180
295
  "maxItems": 12,
181
296
  "items": { "$ref": "#/$defs/move" }
182
297
  },
298
+ "requires": {
299
+ "description": "Referenced noun instances whose status and stored values gate this verb before any movement runs.",
300
+ "type": "object",
301
+ "maxProperties": 8,
302
+ "propertyNames": { "$ref": "#/$defs/camelName" },
303
+ "additionalProperties": {
304
+ "oneOf": [
305
+ {
306
+ "type": "array",
307
+ "minItems": 1,
308
+ "maxItems": 12,
309
+ "items": { "$ref": "#/$defs/snakeName" }
310
+ },
311
+ {
312
+ "type": "object",
313
+ "required": ["statuses"],
314
+ "additionalProperties": false,
315
+ "anyOf": [
316
+ { "required": ["bind"] },
317
+ { "required": ["match"] },
318
+ { "required": ["unique"] }
319
+ ],
320
+ "properties": {
321
+ "bind": {
322
+ "type": "object",
323
+ "minProperties": 1,
324
+ "maxProperties": 8,
325
+ "propertyNames": { "$ref": "#/$defs/camelName" },
326
+ "additionalProperties": { "$ref": "#/$defs/nounRefPath" }
327
+ },
328
+ "match": {
329
+ "type": "object",
330
+ "minProperties": 1,
331
+ "maxProperties": 8,
332
+ "propertyNames": { "$ref": "#/$defs/nounRefPath" },
333
+ "additionalProperties": { "$ref": "#/$defs/nounRefPath" }
334
+ },
335
+ "statuses": {
336
+ "type": "array",
337
+ "minItems": 1,
338
+ "maxItems": 12,
339
+ "items": { "$ref": "#/$defs/snakeName" }
340
+ },
341
+ "unique": { "const": true }
342
+ }
343
+ }
344
+ ]
345
+ }
346
+ },
183
347
  "due": {
184
348
  "description": "The verb runs when the stored date in `field` (plus `offset`) arrives, under the named rule.",
185
349
  "type": "object",
@@ -202,12 +366,13 @@
202
366
  }
203
367
  },
204
368
  "setsAt": {
205
- "description": "Running this verb stamps `field` with now plus `offset`, arming a later deadline.",
369
+ "description": "Running this verb stamps `field` with now plus `offset`. A marker records occurrence and cannot drive a due condition or deadline.",
206
370
  "type": "object",
207
371
  "required": ["field", "offset"],
208
372
  "additionalProperties": false,
209
373
  "properties": {
210
374
  "field": { "$ref": "#/$defs/camelName" },
375
+ "marker": { "const": true },
211
376
  "offset": { "$ref": "#/$defs/isoDuration" }
212
377
  }
213
378
  },
@@ -222,6 +387,219 @@
222
387
  "minItems": 1,
223
388
  "maxItems": 2,
224
389
  "items": { "$ref": "#/$defs/snakeName" }
390
+ },
391
+ "fields": {
392
+ "type": "object",
393
+ "maxProperties": 4,
394
+ "propertyNames": { "$ref": "#/$defs/camelName" },
395
+ "additionalProperties": { "enum": ["text"] }
396
+ }
397
+ }
398
+ },
399
+ "captureInput": {
400
+ "description": "Persist selected caller input fields under noun refs so the terminal receipt retains decision evidence.",
401
+ "type": "object",
402
+ "maxProperties": 4,
403
+ "propertyNames": { "$ref": "#/$defs/camelName" },
404
+ "additionalProperties": { "$ref": "#/$defs/camelName" }
405
+ },
406
+ "payout": {
407
+ "description": "Create one external payout instruction from stored noun values and capture its durable reference.",
408
+ "type": "object",
409
+ "required": [
410
+ "amount",
411
+ "beneficiaryField",
412
+ "beneficiaryPartyField",
413
+ "capture",
414
+ "currencyField",
415
+ "sourceAccountField",
416
+ "speed"
417
+ ],
418
+ "additionalProperties": false,
419
+ "properties": {
420
+ "amount": { "$ref": "#/$defs/instanceValuePath" },
421
+ "beneficiaryField": { "$ref": "#/$defs/camelName" },
422
+ "beneficiaryPartyField": { "$ref": "#/$defs/camelName" },
423
+ "capture": { "$ref": "#/$defs/camelName" },
424
+ "currencyField": { "$ref": "#/$defs/camelName" },
425
+ "sourceAccountField": { "$ref": "#/$defs/camelName" },
426
+ "speed": { "const": "standard" }
427
+ }
428
+ },
429
+ "requiresSettlement": {
430
+ "description": "Allow a system transition only after durable settlement evidence matches the captured payout.",
431
+ "type": "object",
432
+ "required": ["capture", "payoutRef"],
433
+ "additionalProperties": false,
434
+ "properties": {
435
+ "capture": { "$ref": "#/$defs/camelName" },
436
+ "payoutRef": { "$ref": "#/$defs/camelName" }
437
+ }
438
+ },
439
+ "signedSum": {
440
+ "description": "A machine-computed signed sum over frozen child rows. The caller cannot supply the result.",
441
+ "type": "object",
442
+ "required": ["amountRef", "onNegative", "onZero", "sources"],
443
+ "additionalProperties": false,
444
+ "properties": {
445
+ "amountRef": { "$ref": "#/$defs/camelName" },
446
+ "onNegative": { "const": "refuse" },
447
+ "onZero": { "enum": ["refuse", "skip_steps"] },
448
+ "sources": {
449
+ "type": "array",
450
+ "minItems": 1,
451
+ "maxItems": 6,
452
+ "items": {
453
+ "type": "object",
454
+ "required": [
455
+ "amountField",
456
+ "nounId",
457
+ "refField",
458
+ "sign",
459
+ "statuses",
460
+ "subtotalRef"
461
+ ],
462
+ "additionalProperties": false,
463
+ "properties": {
464
+ "amountField": { "$ref": "#/$defs/camelName" },
465
+ "nounId": { "$ref": "#/$defs/snakeName" },
466
+ "refField": { "$ref": "#/$defs/camelName" },
467
+ "sign": { "enum": ["add", "subtract"] },
468
+ "statuses": {
469
+ "type": "array",
470
+ "minItems": 1,
471
+ "maxItems": 4,
472
+ "items": { "$ref": "#/$defs/snakeName" }
473
+ },
474
+ "subtotalRef": { "$ref": "#/$defs/camelName" }
475
+ }
476
+ }
477
+ }
478
+ }
479
+ },
480
+ "distribute": {
481
+ "description": "A machine-computed deterministic largest-remainder share of a frozen parent pool.",
482
+ "type": "object",
483
+ "required": [
484
+ "amountRef",
485
+ "onZero",
486
+ "pool",
487
+ "refField",
488
+ "statuses",
489
+ "weightField"
490
+ ],
491
+ "additionalProperties": false,
492
+ "properties": {
493
+ "amountRef": { "$ref": "#/$defs/camelName" },
494
+ "onZero": { "enum": ["refuse", "skip_steps"] },
495
+ "pool": {
496
+ "type": "object",
497
+ "required": ["from", "path"],
498
+ "additionalProperties": false,
499
+ "properties": {
500
+ "from": { "const": "parent" },
501
+ "path": { "$ref": "#/$defs/nounRefPath" }
502
+ }
503
+ },
504
+ "refField": { "$ref": "#/$defs/camelName" },
505
+ "statuses": {
506
+ "type": "array",
507
+ "minItems": 1,
508
+ "maxItems": 12,
509
+ "items": { "$ref": "#/$defs/snakeName" }
510
+ },
511
+ "weightField": { "$ref": "#/$defs/camelName" }
512
+ }
513
+ },
514
+ "requiresAggregate": {
515
+ "description": "Locked aggregate conditions over child or sibling rows that must hold before the verb runs.",
516
+ "type": "array",
517
+ "minItems": 1,
518
+ "maxItems": 8,
519
+ "items": {
520
+ "type": "object",
521
+ "required": ["check", "over", "refField", "statuses"],
522
+ "additionalProperties": false,
523
+ "properties": {
524
+ "check": {
525
+ "oneOf": [
526
+ {
527
+ "type": "object",
528
+ "required": ["amountField", "kind", "targetField"],
529
+ "additionalProperties": false,
530
+ "properties": {
531
+ "amountField": { "$ref": "#/$defs/camelName" },
532
+ "kind": {
533
+ "enum": ["sum_at_least", "sum_below", "sum_exactly"]
534
+ },
535
+ "targetField": { "$ref": "#/$defs/camelName" }
536
+ }
537
+ },
538
+ {
539
+ "type": "object",
540
+ "required": ["kind"],
541
+ "additionalProperties": false,
542
+ "properties": { "kind": { "const": "all_in" } }
543
+ },
544
+ {
545
+ "type": "object",
546
+ "required": ["kind", "targetField"],
547
+ "additionalProperties": false,
548
+ "properties": {
549
+ "kind": { "const": "count_at_least" },
550
+ "targetField": { "$ref": "#/$defs/camelName" }
551
+ }
552
+ },
553
+ {
554
+ "type": "object",
555
+ "required": ["field", "kind"],
556
+ "additionalProperties": false,
557
+ "properties": {
558
+ "field": { "$ref": "#/$defs/camelName" },
559
+ "kind": { "const": "count_equals_field" }
560
+ }
561
+ }
562
+ ]
563
+ },
564
+ "nounId": { "$ref": "#/$defs/snakeName" },
565
+ "over": { "enum": ["children", "siblings"] },
566
+ "refField": { "$ref": "#/$defs/camelName" },
567
+ "statuses": {
568
+ "type": "array",
569
+ "minItems": 1,
570
+ "maxItems": 12,
571
+ "items": { "$ref": "#/$defs/snakeName" }
572
+ }
573
+ }
574
+ }
575
+ },
576
+ "requiresExposure": {
577
+ "description": "Atomic exposure caps over rows sharing one anchor. The current row contributes to the checked sum.",
578
+ "type": "array",
579
+ "minItems": 1,
580
+ "maxItems": 8,
581
+ "items": {
582
+ "type": "object",
583
+ "required": [
584
+ "amountField",
585
+ "anchorField",
586
+ "capField",
587
+ "childNounId",
588
+ "statuses"
589
+ ],
590
+ "additionalProperties": false,
591
+ "properties": {
592
+ "amountField": { "$ref": "#/$defs/camelName" },
593
+ "anchorField": { "$ref": "#/$defs/camelName" },
594
+ "capField": { "$ref": "#/$defs/camelName" },
595
+ "capOnAnchor": { "const": true },
596
+ "childNounId": { "$ref": "#/$defs/snakeName" },
597
+ "statuses": {
598
+ "type": "array",
599
+ "minItems": 1,
600
+ "maxItems": 12,
601
+ "items": { "$ref": "#/$defs/snakeName" }
602
+ }
225
603
  }
226
604
  }
227
605
  },
@@ -247,7 +625,12 @@
247
625
  "properties": {
248
626
  "operation": { "const": "create" },
249
627
  "key": { "$ref": "#/$defs/snakeName" },
250
- "amount": { "$ref": "#/$defs/camelName" },
628
+ "amount": {
629
+ "oneOf": [
630
+ { "$ref": "#/$defs/camelName" },
631
+ { "type": "string", "pattern": "^refs\\.[a-z][A-Za-z0-9]*$" }
632
+ ]
633
+ },
251
634
  "from": { "$ref": "#/$defs/endpoint" },
252
635
  "to": { "$ref": "#/$defs/endpoint" },
253
636
  "moneyEvent": { "$ref": "#/$defs/snakeName" },
@@ -265,6 +648,7 @@
265
648
  "operation": { "const": "reserve" },
266
649
  "key": { "$ref": "#/$defs/snakeName" },
267
650
  "amount": { "$ref": "#/$defs/camelName" },
651
+ "expiresAt": { "$ref": "#/$defs/camelName" },
268
652
  "from": { "$ref": "#/$defs/endpoint" },
269
653
  "to": { "$ref": "#/$defs/endpoint" },
270
654
  "moneyEvent": { "$ref": "#/$defs/snakeName" }
@@ -277,7 +661,15 @@
277
661
  "properties": {
278
662
  "operation": { "const": "post" },
279
663
  "key": { "$ref": "#/$defs/snakeName" },
280
- "reservation": { "$ref": "#/$defs/snakeName" }
664
+ "reservation": { "$ref": "#/$defs/snakeName" },
665
+ "amount": { "$ref": "#/$defs/camelName" },
666
+ "partialOnly": { "const": true },
667
+ "capture": {
668
+ "type": "object",
669
+ "maxProperties": 4,
670
+ "propertyNames": { "$ref": "#/$defs/camelName" },
671
+ "additionalProperties": { "const": "postedAmount" }
672
+ }
281
673
  }
282
674
  },
283
675
  {
@@ -468,10 +860,16 @@
468
860
  "toActor": { "$ref": "#/$defs/endpoint" },
469
861
  "occurrence": { "enum": ["once", "repeatable"] },
470
862
  "timing": { "enum": ["external_schedule", "on_lifecycle"] },
471
- "amountMode": { "const": "fixed" },
863
+ "amountMode": {
864
+ "enum": ["fixed", "runtime_bounded", "remaining_balance"]
865
+ },
472
866
  "distribution": { "const": "single" },
473
867
  "allocationTotalBps": { "const": 0 },
474
- "amountDependencies": { "type": "array", "maxItems": 0 },
868
+ "amountDependencies": {
869
+ "type": "array",
870
+ "maxItems": 11,
871
+ "items": { "$ref": "#/$defs/snakeName" }
872
+ },
475
873
  "amountSchedule": { "type": "array", "maxItems": 0 }
476
874
  }
477
875
  },