@hyperscale0/hsx 1.0.0 → 2.0.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 (166) hide show
  1. package/CHANGELOG.md +15 -4
  2. package/README.md +58 -38
  3. package/dist/src/ast.d.ts +4 -2
  4. package/dist/src/ast.d.ts.map +1 -1
  5. package/dist/src/cli.d.ts +1 -1
  6. package/dist/src/cli.js.map +1 -1
  7. package/dist/src/compile.d.ts +8 -2
  8. package/dist/src/compile.d.ts.map +1 -1
  9. package/dist/src/compile.js +8 -1
  10. package/dist/src/compile.js.map +1 -1
  11. package/dist/src/cost.d.ts +3 -1
  12. package/dist/src/cost.d.ts.map +1 -1
  13. package/dist/src/cost.js +124 -94
  14. package/dist/src/cost.js.map +1 -1
  15. package/dist/src/diagnostics.d.ts.map +1 -1
  16. package/dist/src/diagnostics.js +89 -5
  17. package/dist/src/diagnostics.js.map +1 -1
  18. package/dist/src/emit.d.ts +3 -1
  19. package/dist/src/emit.d.ts.map +1 -1
  20. package/dist/src/emit.js +27 -10
  21. package/dist/src/emit.js.map +1 -1
  22. package/dist/src/format.js.map +1 -1
  23. package/dist/src/index.d.ts +2 -2
  24. package/dist/src/index.d.ts.map +1 -1
  25. package/dist/src/index.js +1 -1
  26. package/dist/src/index.js.map +1 -1
  27. package/dist/src/ir.d.ts.map +1 -1
  28. package/dist/src/lex.d.ts.map +1 -1
  29. package/dist/src/lsp/server.js.map +1 -1
  30. package/dist/src/modules.js +7 -3
  31. package/dist/src/modules.js.map +1 -1
  32. package/dist/src/parse.js +3 -3
  33. package/dist/src/parse.js.map +1 -1
  34. package/dist/src/std-bundle.js +41 -41
  35. package/dist/src/std-bundle.js.map +1 -1
  36. package/dist/src/std-library.js +2 -2
  37. package/dist/src/typecheck.d.ts.map +1 -1
  38. package/dist/src/typecheck.js +859 -156
  39. package/dist/src/typecheck.js.map +1 -1
  40. package/dist/src/version.d.ts +1 -1
  41. package/dist/src/version.js +1 -1
  42. package/docs/README.md +10 -1
  43. package/docs/assets/hsx.svg +18 -0
  44. package/docs/guide/01-first-program.md +1 -1
  45. package/docs/guide/02-money.md +1 -1
  46. package/docs/guide/03-instruments.md +44 -3
  47. package/docs/guide/04-lifecycles.md +18 -3
  48. package/docs/guide/05-fees-and-splits.md +2 -2
  49. package/docs/guide/06-schedules.md +1 -1
  50. package/docs/guide/07-composition.md +8 -2
  51. package/docs/guide/08-writing-a-module.md +13 -2
  52. package/docs/guide/09-cost.md +3 -3
  53. package/docs/guide/10-diagnostics.md +1 -1
  54. package/docs/llms-full.txt +453 -190
  55. package/docs/llms.txt +2 -2
  56. package/docs/playground.md +4 -3
  57. package/docs/reference/cli.md +2 -2
  58. package/docs/reference/diagnostics.md +223 -37
  59. package/docs/reference/grammar.md +2 -2
  60. package/docs/reference/std/advance.md +2 -2
  61. package/docs/reference/std/cancellable_booking.md +10 -10
  62. package/docs/reference/std/captured_payment.md +14 -14
  63. package/docs/reference/std/conditional_disbursement.md +3 -3
  64. package/docs/reference/std/credit_facility.md +2 -2
  65. package/docs/reference/std/held_payment.md +37 -33
  66. package/docs/reference/std/instant_transfer.md +8 -8
  67. package/docs/reference/std/metered.md +2 -2
  68. package/docs/reference/std/pooled_split.md +2 -2
  69. package/docs/reference/std/premium_forward.md +13 -13
  70. package/docs/reference/std/reconciled_payout.md +2 -2
  71. package/docs/reference/std/recurring_collection.md +2 -2
  72. package/docs/reference/std/rotating_pool.md +2 -2
  73. package/docs/reference/std/scheduled.md +18 -18
  74. package/docs/reference/std/security_deposit.md +14 -14
  75. package/docs/reference/std/settlement_batch.md +2 -2
  76. package/docs/reference/std/swap.md +18 -18
  77. package/docs/reference/std/threshold_pool.md +2 -2
  78. package/docs/reference/std/weighted_distribution.md +2 -2
  79. package/docs/reference/types.md +1 -1
  80. package/docs/reference/udl-output.md +1 -1
  81. package/examples/01-first-program/README.md +1 -1
  82. package/examples/01-first-program/tip-jar.hsx +1 -1
  83. package/examples/02-imports-and-archetypes/photo-booth.hsx +1 -1
  84. package/examples/03-diagnostics/corner-shop-fixed.hsx +1 -1
  85. package/examples/03-diagnostics/corner-shop.hsx +1 -1
  86. package/examples/04-complete-product/study-hall.hsx +1 -1
  87. package/examples/05-watch-club/README.md +0 -3
  88. package/examples/05-watch-club/watch-club.hsx +1 -1
  89. package/examples/README.md +35 -4
  90. package/examples/advance/advance.hsx +1 -1
  91. package/examples/advance/advance.udl +10 -5
  92. package/examples/cancellable_booking/cancellable_booking.hsx +1 -1
  93. package/examples/cancellable_booking/cancellable_booking.udl +3 -1
  94. package/examples/captured_payment/captured_payment.hsx +1 -1
  95. package/examples/captured_payment/captured_payment.udl +4 -1
  96. package/examples/conditional_disbursement/conditional_disbursement.hsx +1 -1
  97. package/examples/conditional_disbursement/conditional_disbursement.udl +5 -3
  98. package/examples/cost-table.json +1602 -382
  99. package/examples/credit_facility/credit_facility.hsx +1 -1
  100. package/examples/credit_facility/credit_facility.udl +16 -9
  101. package/examples/held_payment/held_payment.hsx +1 -1
  102. package/examples/held_payment/held_payment.udl +38 -3
  103. package/examples/instant_transfer/instant_transfer.hsx +1 -1
  104. package/examples/instant_transfer/instant_transfer.udl +11 -5
  105. package/examples/metered/metered.hsx +1 -1
  106. package/examples/metered/metered.udl +4 -2
  107. package/examples/pooled_split/pooled_split.hsx +1 -1
  108. package/examples/pooled_split/pooled_split.udl +6 -3
  109. package/examples/premium_forward/premium_forward.hsx +1 -1
  110. package/examples/premium_forward/premium_forward.udl +10 -4
  111. package/examples/reconciled_payout/reconciled_payout.hsx +1 -1
  112. package/examples/reconciled_payout/reconciled_payout.udl +4 -2
  113. package/examples/recurring_collection/recurring_collection.hsx +1 -1
  114. package/examples/recurring_collection/recurring_collection.udl +12 -7
  115. package/examples/rotating_pool/rotating_pool.hsx +1 -1
  116. package/examples/rotating_pool/rotating_pool.udl +14 -4
  117. package/examples/scheduled/scheduled.hsx +1 -1
  118. package/examples/scheduled/scheduled.udl +9 -4
  119. package/examples/security_deposit/security_deposit.hsx +1 -1
  120. package/examples/security_deposit/security_deposit.udl +17 -3
  121. package/examples/settlement_batch/settlement_batch.hsx +1 -1
  122. package/examples/swap/swap.hsx +1 -1
  123. package/examples/swap/swap.udl +12 -6
  124. package/examples/threshold_pool/threshold_pool.hsx +1 -1
  125. package/examples/threshold_pool/threshold_pool.udl +4 -2
  126. package/examples/weighted_distribution/weighted_distribution.hsx +1 -1
  127. package/examples/weighted_distribution/weighted_distribution.udl +4 -2
  128. package/package.json +6 -5
  129. package/skills/hsx/SKILL.md +26 -26
  130. package/src/ast.ts +4 -2
  131. package/src/cli.ts +4 -4
  132. package/src/compile.ts +14 -3
  133. package/src/cost.ts +176 -104
  134. package/src/diagnostics.ts +89 -4
  135. package/src/emit.ts +32 -18
  136. package/src/index.ts +2 -1
  137. package/src/modules.ts +9 -3
  138. package/src/parse.ts +3 -3
  139. package/src/std-bundle.ts +41 -41
  140. package/src/std-library.ts +2 -2
  141. package/src/typecheck.ts +1147 -235
  142. package/src/version.ts +1 -1
  143. package/std/SEMANTICS.md +12 -3
  144. package/std/{settlements → money_flows}/advance.hsx +1 -1
  145. package/std/{settlements → money_flows}/cancellable_booking.hsx +4 -3
  146. package/std/{settlements → money_flows}/captured_payment.hsx +35 -6
  147. package/std/{settlements → money_flows}/conditional_disbursement.hsx +17 -16
  148. package/std/{settlements → money_flows}/credit_facility.hsx +1 -2
  149. package/std/{settlements → money_flows}/held_payment.hsx +59 -25
  150. package/std/money_flows/index.hsx +3 -0
  151. package/std/{settlements → money_flows}/instant_transfer.hsx +2 -3
  152. package/std/{settlements → money_flows}/metered.hsx +1 -1
  153. package/std/{settlements → money_flows}/pooled_split.hsx +3 -3
  154. package/std/{settlements → money_flows}/premium_forward.hsx +22 -23
  155. package/std/{settlements → money_flows}/reconciled_payout.hsx +3 -3
  156. package/std/{settlements → money_flows}/recurring_collection.hsx +1 -1
  157. package/std/{settlements → money_flows}/rotating_pool.hsx +8 -6
  158. package/std/{settlements → money_flows}/scheduled.hsx +22 -27
  159. package/std/{settlements → money_flows}/security_deposit.hsx +38 -14
  160. package/std/{settlements → money_flows}/settlement_batch.hsx +3 -3
  161. package/std/{settlements → money_flows}/swap.hsx +41 -16
  162. package/std/{settlements → money_flows}/threshold_pool.hsx +5 -5
  163. package/std/{settlements → money_flows}/weighted_distribution.hsx +6 -6
  164. package/docs/sessions/2026-09-02-two-instruments.hsx +0 -21
  165. package/docs/sessions/2026-09-02-two-instruments.md +0 -41
  166. package/std/settlements/index.hsx +0 -3
package/docs/llms.txt CHANGED
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # HSX documentation
4
4
 
5
- > Repository guide and generated compiler reference for HSX 1.0.0.
5
+ > Repository guide and generated compiler reference for HSX 2.0.0.
6
6
 
7
7
  ## Guide
8
8
 
@@ -2,7 +2,8 @@
2
2
 
3
3
  The HSX playground is a static browser application for authoring, editing,
4
4
  and inspecting HSX programs without a server. It runs the compiler directly
5
- in the browser client.
5
+ in the browser client. The hosted playground is served at
6
+ https://hyperscale0.ai/playground.
6
7
 
7
8
  ## What it provides
8
9
 
@@ -35,8 +36,8 @@ bun run --cwd open/hsx playground:check
35
36
 
36
37
  ## Serve locally
37
38
 
38
- The deliverable is the static directory under `open/hsx/playground/dist/`.
39
- Hosting infrastructure is owner-owed. To run the playground locally, serve
39
+ The hosted playground is served at https://hyperscale0.ai/playground.
40
+ To run the playground locally from `open/hsx/playground/dist/`, serve
40
41
  the output directory with any local static file server.
41
42
 
42
43
  Using Bun:
@@ -1,9 +1,9 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # CLI
4
4
 
5
5
  ```text
6
- hsx 1.0.0, the HSX compiler
6
+ hsx 2.0.0, the HSX compiler
7
7
 
8
8
  Usage:
9
9
  hsx check <file.hsx> [--strict]
@@ -1,4 +1,4 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # Diagnostics
4
4
 
@@ -32,9 +32,13 @@ Fix: Keep exactly one program declaration.
32
32
  ```hsx expect=HSX1002
33
33
  program catalog_probe "Catalog probe"
34
34
  instrument probe {
35
- fields {}
35
+ agent_description: "Probe instrument for catalog diagnostics.";
36
+ fields { }
36
37
  lifecycle { states created; initial created; }
37
- action create { steps: []; }
38
+ action create {
39
+ agent_description: "Create a probe instance.";
40
+ steps: [];
41
+ }
38
42
 
39
43
  }
40
44
  program second "Second"
@@ -59,9 +63,13 @@ Fix: Keep one declaration or give each declaration a distinct name.
59
63
  ```hsx expect=HSX1004
60
64
  program catalog_probe "Catalog probe"
61
65
  instrument probe {
62
- fields {}
66
+ agent_description: "Probe instrument for catalog diagnostics.";
67
+ fields { }
63
68
  lifecycle { states created; initial created; }
64
- action create { steps: []; }
69
+ action create {
70
+ agent_description: "Create a probe instance.";
71
+ steps: [];
72
+ }
65
73
 
66
74
  }
67
75
  instrument probe { fields {}; lifecycle { states created; initial created; }; action create { steps: []; }; }
@@ -107,9 +115,13 @@ Fix: Complete the declaration and bind every referenced decision port.
107
115
  ```hsx expect=HSX1008
108
116
  program catalog_probe "Catalog probe"
109
117
  instrument probe {
110
- fields {}
118
+ agent_description: "Probe instrument for catalog diagnostics.";
119
+ fields { }
111
120
  lifecycle { states created; initial created; }
112
- action create { steps: []; }
121
+ action create {
122
+ agent_description: "Create a probe instance.";
123
+ steps: [];
124
+ }
113
125
 
114
126
  }
115
127
  subject vehicle { title: "Vehicle"; }
@@ -232,11 +244,11 @@ Fix: Expose an action on an explicitly used published instrument.
232
244
 
233
245
  No source-only witness exists. This refusal requires a compiler-host published catalog.
234
246
 
235
- ## HSX1022: Authored instrument in a composition
247
+ ## HSX1022: Authored instrument collides with published catalog
236
248
 
237
249
  Stage: `typecheck`
238
250
 
239
- Fix: Publish the instrument separately, then select it with use.
251
+ Fix: Rename the authored instrument to avoid colliding with published catalog instruments.
240
252
 
241
253
  No source-only witness exists. This refusal requires a compiler-host published catalog.
242
254
 
@@ -249,13 +261,61 @@ Fix: List declared, non-optional field names once each.
249
261
  ```hsx expect=HSX1023
250
262
  program catalog_probe "Catalog probe"
251
263
  instrument probe {
252
- fields {}
264
+ agent_description: "Probe instrument for catalog diagnostics.";
265
+ fields { }
253
266
  lifecycle { states created; initial created; }
254
- action create { steps: []; }
267
+ action create {
268
+ agent_description: "Create a probe instance.";
269
+ steps: [];
270
+ }
255
271
  required: missing;
256
272
  }
257
273
  ```
258
274
 
275
+ ## HSX1024: Decision party has no matching account binding
276
+
277
+ Stage: `typecheck`
278
+
279
+ Fix: Bind the allowed party to an account field and use that binding in the decision action.
280
+
281
+ ```hsx expect=HSX1024
282
+ program decision_binding "Decision binding"
283
+ party buyer: person
284
+ party seller: business
285
+ port approve { allowed: [buyer] }
286
+ instrument gated(decision: condition) {
287
+ fields {}
288
+ parties { payer: seller }
289
+ lifecycle { states created done; initial created; on approve: created -> done; }
290
+ action create { steps: []; }
291
+ action [decision] { steps: []; port { allowed_parties: [payer]; } }
292
+ }
293
+ instrument gate = gated(decision: port approve)
294
+ ```
295
+
296
+ ## HSX1025: Unknown decision port shape type
297
+
298
+ Stage: `typecheck`
299
+
300
+ Fix: Declare the shape field as text, money(CUR), date, integer, boolean, account(CUR), ref<instrument_id>, id(instrument_id), bps, or percent.
301
+
302
+ ```hsx expect=HSX1025
303
+ program catalog_probe "Catalog probe"
304
+ import { security_deposit } from "std/money_flows"
305
+ party buyer: person
306
+ party seller: business
307
+ settlement hold = security_deposit {
308
+ payer: buyer
309
+ holder: seller
310
+ amount: depositAmount: money(SAR)
311
+ claim: port report_damage
312
+ claim_amount: { field: damageAmount, bound: depositAmount, remainder: return }
313
+ return: port pass_inspection
314
+ }
315
+ port report_damage { allowed: [seller] shape { damageAmount: money(SAR) } }
316
+ port pass_inspection { allowed: [seller] shape { invalidField: mystery_type } }
317
+ ```
318
+
259
319
  ## HSX1101: Currency mismatch
260
320
 
261
321
  Stage: `typecheck`
@@ -265,9 +325,13 @@ Fix: Use the declared currency because money values never coerce.
265
325
  ```hsx expect=HSX1101
266
326
  program catalog_probe "Catalog probe"
267
327
  instrument probe {
268
- fields {}
328
+ agent_description: "Probe instrument for catalog diagnostics.";
329
+ fields { }
269
330
  lifecycle { states created; initial created; }
270
- action create { steps: []; }
331
+ action create {
332
+ agent_description: "Create a probe instance.";
333
+ steps: [];
334
+ }
271
335
 
272
336
  }
273
337
  const fee: money<SAR> = USD 1.00
@@ -282,9 +346,13 @@ Fix: Round the literal to the currency's minor-unit precision.
282
346
  ```hsx expect=HSX1102
283
347
  program catalog_probe "Catalog probe"
284
348
  instrument probe {
285
- fields {}
349
+ agent_description: "Probe instrument for catalog diagnostics.";
350
+ fields { }
286
351
  lifecycle { states created; initial created; }
287
- action create { steps: []; }
352
+ action create {
353
+ agent_description: "Create a probe instance.";
354
+ steps: [];
355
+ }
288
356
 
289
357
  }
290
358
  const fee: money<SAR> = SAR 1.001
@@ -299,9 +367,13 @@ Fix: Use an integer, percent, bps, or valid fixed-money binding.
299
367
  ```hsx expect=HSX1103
300
368
  program catalog_probe "Catalog probe"
301
369
  instrument probe {
302
- fields {}
370
+ agent_description: "Probe instrument for catalog diagnostics.";
371
+ fields { }
303
372
  lifecycle { states created; initial created; }
304
- action create { steps: []; }
373
+ action create {
374
+ agent_description: "Create a probe instance.";
375
+ steps: [];
376
+ }
305
377
  summary: 1.5;
306
378
  }
307
379
  ```
@@ -315,9 +387,13 @@ Fix: Pass the type declared by the parameter or UDL slot.
315
387
  ```hsx expect=HSX1104
316
388
  program catalog_probe "Catalog probe"
317
389
  instrument probe {
318
- fields {}
390
+ agent_description: "Probe instrument for catalog diagnostics.";
391
+ fields { }
319
392
  lifecycle { states created; initial created; }
320
- action create { steps: []; }
393
+ action create {
394
+ agent_description: "Create a probe instance.";
395
+ steps: [];
396
+ }
321
397
  summary: money(SAR, 2500);
322
398
  }
323
399
  ```
@@ -348,9 +424,13 @@ Fix: Leave exactly one sink for each produced money value.
348
424
  ```hsx expect=HSX1201
349
425
  program catalog_probe "Catalog probe"
350
426
  instrument probe {
351
- fields {}
427
+ agent_description: "Probe instrument for catalog diagnostics.";
428
+ fields { }
352
429
  lifecycle { states created; initial created; }
353
- action create { steps: []; }
430
+ action create {
431
+ agent_description: "Create a probe instance.";
432
+ steps: [];
433
+ }
354
434
  fields { amount: money<SAR>; }
355
435
  action pay { computes remainder rest { amount_ref: total; on_zero: refuse; total_path: fields.amount; }; moves: [{ amount: rest; }, { amount: rest; }]; }
356
436
  }
@@ -365,9 +445,13 @@ Fix: Route each produced money value to one explicit sink.
365
445
  ```hsx expect=HSX1202
366
446
  program catalog_probe "Catalog probe"
367
447
  instrument probe {
368
- fields {}
448
+ agent_description: "Probe instrument for catalog diagnostics.";
449
+ fields { }
369
450
  lifecycle { states created; initial created; }
370
- action create { steps: []; }
451
+ action create {
452
+ agent_description: "Create a probe instance.";
453
+ steps: [];
454
+ }
371
455
  fields { amount: money<SAR>; }
372
456
  action pay { computes remainder rest { amount_ref: total; on_zero: refuse; total_path: fields.amount; }; }
373
457
  }
@@ -382,9 +466,13 @@ Fix: Supply a versioned cost table with a row for every emitted effect.
382
466
  ```hsx expect=HSX1301
383
467
  program catalog_probe "Catalog probe"
384
468
  instrument probe {
385
- fields {}
469
+ agent_description: "Probe instrument for catalog diagnostics.";
470
+ fields { }
386
471
  lifecycle { states created; initial created; }
387
- action create { steps: []; }
472
+ action create {
473
+ agent_description: "Create a probe instance.";
474
+ steps: [];
475
+ }
388
476
 
389
477
  }
390
478
  ```
@@ -405,6 +493,46 @@ Fix: Use the supported uppercase cost-table currency.
405
493
 
406
494
  No source-only witness exists. This refusal requires an invalid compiler-host cost-table currency.
407
495
 
496
+ ## HSX1304: Unpriced ledger currency
497
+
498
+ Stage: `typecheck`
499
+
500
+ Fix: Move money in a currency the shipped cost tables price.
501
+
502
+ ```hsx expect=HSX1304
503
+ program catalog_probe "Catalog probe"
504
+ instrument probe {
505
+ agent_description: "Probe instrument for catalog diagnostics.";
506
+ fields { amount: money<JPY>; }
507
+ lifecycle { states created; initial created; }
508
+ action create {
509
+ agent_description: "Create a probe instance.";
510
+ steps: [];
511
+ }
512
+
513
+ }
514
+ ```
515
+
516
+ ## HSX1305: More than one ledger currency
517
+
518
+ Stage: `typecheck`
519
+
520
+ Fix: Move all money in one currency; a program bills in one ledger currency.
521
+
522
+ ```hsx expect=HSX1305
523
+ program catalog_probe "Catalog probe"
524
+ instrument probe {
525
+ agent_description: "Probe instrument for catalog diagnostics.";
526
+ fields { amount: money<SAR>; fee: money<USD>; }
527
+ lifecycle { states created; initial created; }
528
+ action create {
529
+ agent_description: "Create a probe instance.";
530
+ steps: [];
531
+ }
532
+
533
+ }
534
+ ```
535
+
408
536
  ## HSX1401: Unbounded action
409
537
 
410
538
  Stage: `typecheck`
@@ -414,9 +542,13 @@ Fix: Replace runtime iteration with a bounded compile-time comprehension.
414
542
  ```hsx expect=HSX1401
415
543
  program catalog_probe "Catalog probe"
416
544
  instrument probe {
417
- fields {}
545
+ agent_description: "Probe instrument for catalog diagnostics.";
546
+ fields { }
418
547
  lifecycle { states created; initial created; }
419
- action create { steps: []; }
548
+ action create {
549
+ agent_description: "Create a probe instance.";
550
+ steps: [];
551
+ }
420
552
  action run { while { condition: true; }; }
421
553
  }
422
554
  ```
@@ -458,9 +590,13 @@ Fix: Reduce the fixed expansion to the compiler limit.
458
590
  ```hsx expect=HSX1404
459
591
  program catalog_probe "Catalog probe"
460
592
  instrument probe {
461
- fields {}
593
+ agent_description: "Probe instrument for catalog diagnostics.";
594
+ fields { }
462
595
  lifecycle { states created; initial created; }
463
- action create { steps: []; }
596
+ action create {
597
+ agent_description: "Create a probe instance.";
598
+ steps: [];
599
+ }
464
600
  for item in 257 { action run_[item] { steps: []; } }
465
601
  }
466
602
  ```
@@ -503,9 +639,13 @@ Fix: Use a clause exported by the targeted UDL vocabulary.
503
639
  ```hsx expect=HSX1501
504
640
  program catalog_probe "Catalog probe"
505
641
  instrument probe {
506
- fields {}
642
+ agent_description: "Probe instrument for catalog diagnostics.";
643
+ fields { }
507
644
  lifecycle { states created; initial created; }
508
- action create { steps: []; }
645
+ action create {
646
+ agent_description: "Create a probe instance.";
647
+ steps: [];
648
+ }
509
649
  unknown_clause: true;
510
650
  }
511
651
  ```
@@ -551,9 +691,13 @@ Fix: Keep one occurrence of the clause.
551
691
  ```hsx expect=HSX1505
552
692
  program catalog_probe "Catalog probe"
553
693
  instrument probe {
554
- fields {}
694
+ agent_description: "Probe instrument for catalog diagnostics.";
695
+ fields { }
555
696
  lifecycle { states created; initial created; }
556
- action create { steps: []; }
697
+ action create {
698
+ agent_description: "Create a probe instance.";
699
+ steps: [];
700
+ }
557
701
  title: "First"; title: "Second";
558
702
  }
559
703
  ```
@@ -567,9 +711,13 @@ Fix: Keep either public: none or a public action name.
567
711
  ```hsx expect=HSX1506
568
712
  program catalog_probe "Catalog probe"
569
713
  instrument probe {
570
- fields {}
714
+ agent_description: "Probe instrument for catalog diagnostics.";
715
+ fields { }
571
716
  lifecycle { states created; initial created; }
572
- action create { steps: []; }
717
+ action create {
718
+ agent_description: "Create a probe instance.";
719
+ steps: [];
720
+ }
573
721
  action finish { public: none; public_action: finishProbe; steps: []; }
574
722
  }
575
723
  ```
@@ -586,6 +734,40 @@ export instrument template() { fields {}; lifecycle { states created; initial cr
586
734
  instrument probe = template() { fields: {}; }
587
735
  ```
588
736
 
737
+ ## HSX1508: Invalid action-level port syntax
738
+
739
+ Stage: `typecheck`
740
+
741
+ Fix: Use allowed_parties: [...] inside an action-level port clause; allowed: is for top-level port declarations.
742
+
743
+ ```hsx expect=HSX1508
744
+ program catalog_probe "Catalog probe"
745
+ party approver: person
746
+ instrument probe {
747
+ fields {}
748
+ lifecycle { states created; initial created; }
749
+ action create {
750
+ steps: [];
751
+ port { allowed: [approver]; }
752
+ }
753
+ }
754
+ ```
755
+
756
+ ## HSX1509: Callable action without an agent description
757
+
758
+ Stage: `typecheck`
759
+
760
+ Fix: Add agent_description: "..." to the instrument and to every action a caller can reach; composer.check refuses the program without them.
761
+
762
+ ```hsx expect=HSX1509
763
+ program catalog_probe "Catalog probe"
764
+ instrument probe {
765
+ fields {}
766
+ lifecycle { states created; initial created; }
767
+ action create { steps: []; }
768
+ }
769
+ ```
770
+
589
771
  ## HSX1601: Invalid UDL shape
590
772
 
591
773
  Stage: `lower`
@@ -611,9 +793,13 @@ Fix: Correct compile-time block keys or parameter bindings.
611
793
  ```hsx expect=HSX1603
612
794
  program catalog_probe "Catalog probe"
613
795
  instrument probe {
614
- fields {}
796
+ agent_description: "Probe instrument for catalog diagnostics.";
797
+ fields { }
615
798
  lifecycle { states created; initial created; }
616
- action create { steps: []; }
799
+ action create {
800
+ agent_description: "Create a probe instance.";
801
+ steps: [];
802
+ }
617
803
  title: "__hsx_none__";
618
804
  }
619
805
  ```
@@ -1,4 +1,4 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # Grammar vocabulary
4
4
 
@@ -14,7 +14,7 @@ The parser is hand-written. This page records the exported lexer vocabulary, the
14
14
 
15
15
  ## Typed clause spellings
16
16
 
17
- `agent description`, `capture input`, `commit`, `quote`, `decided amount`, `deadline`, `decision`, `computes distribute`, `description`, `due`, `earnable`, `event name`, `examples`, `input`, `moves`, `payout`, `port`, `principal`, `public action`, `reconcile`, `computes remainder`, `requires aggregate`, `requires checks`, `requires drained`, `requires exposure`, `requires refs`, `sandbox failure point`, `sets at`, `computes signed_sum`, `steps`, `summary`, `updates`, `notify`, `agent description`, `aggregate invariants`, `caller parked states`, `description`, `dials`, `distinct parties`, `computes derived`, `computes fees`, `id prefix`, `nav`, `partitions`, `subject`, `summary`, `surface visibility`, `template id`, `title`, `update`
17
+ `agent description`, `capture input`, `commit`, `quote`, `decided amount`, `deadline`, `decision`, `computes distribute`, `description`, `due`, `earnable`, `event name`, `examples`, `input`, `moves`, `payout`, `port`, `principal`, `public action`, `reconcile`, `computes remainder`, `requires aggregate`, `requires checks`, `requires drained`, `requires exposure`, `requires refs`, `sandbox failure point`, `sets at`, `computes signed_sum`, `steps`, `summary`, `updates`, `notify`, `agent description`, `aggregate invariants`, `caller parked states`, `description`, `dials`, `distinct parties`, `computes derived`, `computes fees`, `id prefix`, `journeys`, `nav`, `partitions`, `subject`, `summary`, `surface visibility`, `template id`, `title`, `update`
18
18
 
19
19
  ## Standard-library modules
20
20
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # advance
4
4
 
5
- Source: [`std/settlements/advance.hsx`](../../../std/settlements/advance.hsx)
5
+ Source: [`std/money_flows/advance.hsx`](../../../std/money_flows/advance.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # cancellable_booking
4
4
 
5
- Source: [`std/settlements/cancellable_booking.hsx`](../../../std/settlements/cancellable_booking.hsx)
5
+ Source: [`std/money_flows/cancellable_booking.hsx`](../../../std/money_flows/cancellable_booking.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -25,11 +25,11 @@ None.
25
25
 
26
26
  ## Actions and clauses
27
27
 
28
- | Action | Clauses lowered |
29
- | ---------- | ---------------------------------------------------------- |
30
- | `create` | `agent description`, `moves`, `steps`, `summary` |
31
- | `take` | `agent description`, `moves`, `steps`, `summary` |
32
- | `complete` | `due`, `moves`, `steps`, `summary` |
33
- | `cancel` | `agent description`, `moves`, `quote`, `steps`, `summary` |
34
- | `confirm` | `agent description`, `commit`, `moves`, `steps`, `summary` |
35
- | `retain` | `agent description`, `moves`, `steps`, `summary` |
28
+ | Action | Clauses lowered |
29
+ | ---------- | ------------------------------------------------------------------------- |
30
+ | `create` | `agent description`, `moves`, `steps`, `summary` |
31
+ | `take` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
32
+ | `complete` | `due`, `moves`, `steps`, `summary` |
33
+ | `cancel` | `agent description`, `moves`, `quote`, `steps`, `summary` |
34
+ | `confirm` | `agent description`, `commit`, `moves`, `steps`, `summary` |
35
+ | `retain` | `agent description`, `moves`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # captured_payment
4
4
 
5
- Source: [`std/settlements/captured_payment.hsx`](../../../std/settlements/captured_payment.hsx)
5
+ Source: [`std/money_flows/captured_payment.hsx`](../../../std/money_flows/captured_payment.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -29,15 +29,15 @@ Source: [`std/settlements/captured_payment.hsx`](../../../std/settlements/captur
29
29
 
30
30
  ## Actions and clauses
31
31
 
32
- | Action | Clauses lowered |
33
- | ------------------ | -------------------------------------------------------------------------------------------- |
34
- | `create` | `agent description`, `moves`, `steps`, `summary` |
35
- | `authorize` | `agent description`, `moves`, `steps`, `summary` |
36
- | `capture` | `agent description`, `deadline`, `description`, `input`, `moves`, `steps`, `summary` |
37
- | `capture_more` | `agent description`, `deadline`, `description`, `input`, `moves`, `steps`, `summary` |
38
- | `settle` | `agent description`, `deadline`, `moves`, `steps`, `summary` |
39
- | `void` | `agent description`, `moves`, `steps`, `summary` |
40
- | `expire` | `due`, `moves`, `steps`, `summary` |
41
- | `settle_on_expiry` | `due`, `moves`, `steps`, `summary` |
42
- | `correction_name` | `agent description`, `moves`, `port`, `steps`, `summary` |
43
- | `reversal_name` | `agent description`, `deadline`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
32
+ | Action | Clauses lowered |
33
+ | ------------------ | ------------------------------------------------------------------------------------------------------------- |
34
+ | `create` | `agent description`, `moves`, `steps`, `summary` |
35
+ | `authorize` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
36
+ | `capture` | `agent description`, `deadline`, `description`, `input`, `moves`, `sandbox failure point`, `steps`, `summary` |
37
+ | `capture_more` | `agent description`, `deadline`, `description`, `input`, `moves`, `steps`, `summary` |
38
+ | `settle` | `agent description`, `deadline`, `moves`, `steps`, `summary` |
39
+ | `void` | `agent description`, `moves`, `steps`, `summary` |
40
+ | `expire` | `due`, `moves`, `steps`, `summary` |
41
+ | `settle_on_expiry` | `due`, `moves`, `steps`, `summary` |
42
+ | `correction_name` | `agent description`, `capture input`, `input`, `moves`, `port`, `steps`, `summary` |
43
+ | `reversal_name` | `agent description`, `capture input`, `deadline`, `input`, `moves`, `port`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # conditional_disbursement
4
4
 
5
- Source: [`std/settlements/conditional_disbursement.hsx`](../../../std/settlements/conditional_disbursement.hsx)
5
+ Source: [`std/money_flows/conditional_disbursement.hsx`](../../../std/money_flows/conditional_disbursement.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -27,7 +27,7 @@ Source: [`std/settlements/conditional_disbursement.hsx`](../../../std/settlement
27
27
  | Action | Clauses lowered |
28
28
  | --------- | ------------------------------------------------------------------------------------------------- |
29
29
  | `create` | `agent description`, `moves`, `steps`, `summary` |
30
- | `deny` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
30
+ | `deny` | `agent description`, `capture input`, `input`, `moves`, `port`, `steps`, `summary` |
31
31
  | `create` | `agent description`, `moves`, `steps`, `summary` |
32
32
  | `approve` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
33
33
  | `pay` | `agent description`, `moves`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # credit_facility
4
4
 
5
- Source: [`std/settlements/credit_facility.hsx`](../../../std/settlements/credit_facility.hsx)
5
+ Source: [`std/money_flows/credit_facility.hsx`](../../../std/money_flows/credit_facility.hsx)
6
6
 
7
7
  ## Export
8
8