@hyperscale0/hsx 1.0.0-rc.1 → 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.
- package/CHANGELOG.md +32 -4
- package/README.md +58 -36
- package/bin/hsx.ts +2 -0
- package/dist/bin/hsx.js +2 -0
- package/dist/bin/hsx.js.map +1 -1
- package/dist/src/ast.d.ts +10 -2
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast.js +24 -0
- package/dist/src/ast.js.map +1 -1
- package/dist/src/cli.d.ts +3 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +25 -5
- package/dist/src/cli.js.map +1 -1
- package/dist/src/compile.d.ts +9 -5
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +9 -3
- package/dist/src/compile.js.map +1 -1
- package/dist/src/cost.d.ts +3 -1
- package/dist/src/cost.d.ts.map +1 -1
- package/dist/src/cost.js +124 -94
- package/dist/src/cost.js.map +1 -1
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +89 -5
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/emit.d.ts +4 -3
- package/dist/src/emit.d.ts.map +1 -1
- package/dist/src/emit.js +28 -233
- package/dist/src/emit.js.map +1 -1
- package/dist/src/format.js.map +1 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/ir.d.ts.map +1 -1
- package/dist/src/lex.d.ts.map +1 -1
- package/dist/src/lsp/server.d.ts +32 -0
- package/dist/src/lsp/server.d.ts.map +1 -0
- package/dist/src/lsp/server.js +391 -0
- package/dist/src/lsp/server.js.map +1 -0
- package/dist/src/modules.d.ts +2 -0
- package/dist/src/modules.d.ts.map +1 -1
- package/dist/src/modules.js +14 -14
- package/dist/src/modules.js.map +1 -1
- package/dist/src/parse.js +3 -3
- package/dist/src/parse.js.map +1 -1
- package/dist/src/std-bundle.d.ts +2 -0
- package/dist/src/std-bundle.d.ts.map +1 -0
- package/dist/src/std-bundle.js +88 -0
- package/dist/src/std-bundle.js.map +1 -0
- package/dist/src/std-library.d.ts +5 -0
- package/dist/src/std-library.d.ts.map +1 -0
- package/dist/src/std-library.js +9 -0
- package/dist/src/std-library.js.map +1 -0
- package/dist/src/typecheck.d.ts.map +1 -1
- package/dist/src/typecheck.js +859 -156
- package/dist/src/typecheck.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/docs/README.md +12 -0
- package/docs/assets/hsx.svg +18 -0
- package/docs/guide/01-first-program.md +2 -2
- package/docs/guide/02-money.md +1 -1
- package/docs/guide/03-instruments.md +44 -3
- package/docs/guide/04-lifecycles.md +18 -3
- package/docs/guide/05-fees-and-splits.md +2 -2
- package/docs/guide/06-schedules.md +1 -1
- package/docs/guide/07-composition.md +8 -2
- package/docs/guide/08-writing-a-module.md +13 -2
- package/docs/guide/09-cost.md +3 -3
- package/docs/guide/10-diagnostics.md +1 -1
- package/docs/llms-full.txt +458 -194
- package/docs/llms.txt +2 -2
- package/docs/playground.md +55 -0
- package/docs/reference/cli.md +5 -3
- package/docs/reference/diagnostics.md +223 -37
- package/docs/reference/grammar.md +2 -2
- package/docs/reference/std/advance.md +2 -2
- package/docs/reference/std/cancellable_booking.md +10 -10
- package/docs/reference/std/captured_payment.md +14 -14
- package/docs/reference/std/conditional_disbursement.md +3 -3
- package/docs/reference/std/credit_facility.md +2 -2
- package/docs/reference/std/held_payment.md +37 -33
- package/docs/reference/std/instant_transfer.md +8 -8
- package/docs/reference/std/metered.md +2 -2
- package/docs/reference/std/pooled_split.md +2 -2
- package/docs/reference/std/premium_forward.md +13 -13
- package/docs/reference/std/reconciled_payout.md +2 -2
- package/docs/reference/std/recurring_collection.md +2 -2
- package/docs/reference/std/rotating_pool.md +2 -2
- package/docs/reference/std/scheduled.md +18 -18
- package/docs/reference/std/security_deposit.md +14 -14
- package/docs/reference/std/settlement_batch.md +2 -2
- package/docs/reference/std/swap.md +18 -18
- package/docs/reference/std/threshold_pool.md +2 -2
- package/docs/reference/std/weighted_distribution.md +2 -2
- package/docs/reference/types.md +1 -1
- package/docs/reference/udl-output.md +2 -3
- package/examples/01-first-program/README.md +1 -1
- package/examples/01-first-program/tip-jar.hsx +1 -1
- package/examples/02-imports-and-archetypes/README.md +1 -4
- package/examples/02-imports-and-archetypes/photo-booth.hsx +1 -1
- package/examples/03-diagnostics/corner-shop-fixed.hsx +1 -1
- package/examples/03-diagnostics/corner-shop.hsx +1 -1
- package/examples/04-complete-product/README.md +0 -3
- package/examples/04-complete-product/study-hall.hsx +1 -1
- package/examples/05-watch-club/README.md +0 -3
- package/examples/05-watch-club/watch-club.hsx +1 -1
- package/examples/README.md +35 -4
- package/examples/advance/advance.hsx +1 -1
- package/examples/advance/advance.udl +10 -5
- package/examples/cancellable_booking/cancellable_booking.hsx +1 -1
- package/examples/cancellable_booking/cancellable_booking.udl +3 -1
- package/examples/captured_payment/captured_payment.hsx +1 -1
- package/examples/captured_payment/captured_payment.udl +4 -1
- package/examples/conditional_disbursement/conditional_disbursement.hsx +1 -1
- package/examples/conditional_disbursement/conditional_disbursement.udl +5 -3
- package/examples/cost-table.json +1602 -382
- package/examples/credit_facility/credit_facility.hsx +1 -1
- package/examples/credit_facility/credit_facility.udl +16 -9
- package/examples/held_payment/held_payment.hsx +1 -1
- package/examples/held_payment/held_payment.udl +38 -3
- package/examples/instant_transfer/instant_transfer.hsx +1 -1
- package/examples/instant_transfer/instant_transfer.udl +11 -5
- package/examples/metered/metered.hsx +1 -1
- package/examples/metered/metered.udl +4 -2
- package/examples/pooled_split/pooled_split.hsx +1 -1
- package/examples/pooled_split/pooled_split.udl +6 -3
- package/examples/premium_forward/premium_forward.hsx +1 -1
- package/examples/premium_forward/premium_forward.udl +10 -4
- package/examples/reconciled_payout/reconciled_payout.hsx +1 -1
- package/examples/reconciled_payout/reconciled_payout.udl +4 -2
- package/examples/recurring_collection/recurring_collection.hsx +1 -1
- package/examples/recurring_collection/recurring_collection.udl +12 -7
- package/examples/rotating_pool/rotating_pool.hsx +1 -1
- package/examples/rotating_pool/rotating_pool.udl +14 -4
- package/examples/scheduled/scheduled.hsx +1 -1
- package/examples/scheduled/scheduled.udl +9 -4
- package/examples/security_deposit/security_deposit.hsx +1 -1
- package/examples/security_deposit/security_deposit.udl +17 -3
- package/examples/settlement_batch/settlement_batch.hsx +1 -1
- package/examples/swap/swap.hsx +1 -1
- package/examples/swap/swap.udl +12 -6
- package/examples/threshold_pool/threshold_pool.hsx +1 -1
- package/examples/threshold_pool/threshold_pool.udl +4 -2
- package/examples/weighted_distribution/weighted_distribution.hsx +1 -1
- package/examples/weighted_distribution/weighted_distribution.udl +4 -2
- package/package.json +15 -6
- package/skills/hsx/SKILL.md +26 -26
- package/src/ast.ts +34 -2
- package/src/cli.ts +32 -13
- package/src/compile.ts +15 -7
- package/src/cost.ts +176 -104
- package/src/diagnostics.ts +89 -4
- package/src/emit.ts +34 -266
- package/src/index.ts +10 -7
- package/src/lsp/server.ts +460 -0
- package/src/modules.ts +21 -13
- package/src/parse.ts +3 -3
- package/src/std-bundle.ts +91 -0
- package/src/std-library.ts +12 -0
- package/src/typecheck.ts +1147 -235
- package/src/version.ts +1 -1
- package/std/SEMANTICS.md +12 -3
- package/std/{settlements → money_flows}/advance.hsx +1 -1
- package/std/{settlements → money_flows}/cancellable_booking.hsx +4 -3
- package/std/{settlements → money_flows}/captured_payment.hsx +35 -6
- package/std/{settlements → money_flows}/conditional_disbursement.hsx +17 -16
- package/std/{settlements → money_flows}/credit_facility.hsx +1 -2
- package/std/{settlements → money_flows}/held_payment.hsx +59 -25
- package/std/money_flows/index.hsx +3 -0
- package/std/{settlements → money_flows}/instant_transfer.hsx +2 -3
- package/std/{settlements → money_flows}/metered.hsx +1 -1
- package/std/{settlements → money_flows}/pooled_split.hsx +3 -3
- package/std/{settlements → money_flows}/premium_forward.hsx +22 -23
- package/std/{settlements → money_flows}/reconciled_payout.hsx +3 -3
- package/std/{settlements → money_flows}/recurring_collection.hsx +1 -1
- package/std/{settlements → money_flows}/rotating_pool.hsx +8 -6
- package/std/{settlements → money_flows}/scheduled.hsx +22 -27
- package/std/{settlements → money_flows}/security_deposit.hsx +38 -14
- package/std/{settlements → money_flows}/settlement_batch.hsx +3 -3
- package/std/{settlements → money_flows}/swap.hsx +41 -16
- package/std/{settlements → money_flows}/threshold_pool.hsx +5 -5
- package/std/{settlements → money_flows}/weighted_distribution.hsx +6 -6
- package/docs/sessions/2026-09-02-two-instruments.hsx +0 -21
- package/docs/sessions/2026-09-02-two-instruments.md +0 -41
- 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
|
+
<!-- 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
|
|
5
|
+
> Repository guide and generated compiler reference for HSX 2.0.0.
|
|
6
6
|
|
|
7
7
|
## Guide
|
|
8
8
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Browser playground
|
|
2
|
+
|
|
3
|
+
The HSX playground is a static browser application for authoring, editing,
|
|
4
|
+
and inspecting HSX programs without a server. It runs the compiler directly
|
|
5
|
+
in the browser client. The hosted playground is served at
|
|
6
|
+
https://hyperscale0.ai/playground.
|
|
7
|
+
|
|
8
|
+
## What it provides
|
|
9
|
+
|
|
10
|
+
- Source editor with line numbers and debounced compilation (200 ms).
|
|
11
|
+
- Verdict badge showing `valid`, `warning`, or `invalid`.
|
|
12
|
+
- Diagnostics panel with stage, code, line and column coordinates, message,
|
|
13
|
+
and suggested fix. Clicking any diagnostic focuses the editor and highlights
|
|
14
|
+
the exact source span.
|
|
15
|
+
- Tabbed output pane showing the lowered canonical UDL document as formatted
|
|
16
|
+
JSON and the UDL cost manifest.
|
|
17
|
+
- Built-in example selector containing the full corpus of test programs and
|
|
18
|
+
standard-library settlements.
|
|
19
|
+
- Pure client execution with no Node runtime dependencies.
|
|
20
|
+
|
|
21
|
+
## Build the playground
|
|
22
|
+
|
|
23
|
+
Generate the examples manifest, bundle the browser assets, and copy static
|
|
24
|
+
files to `open/hsx/playground/dist/`:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
bun run --cwd open/hsx playground:build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Verify that the generated static bundle contains no Node specifiers or URL
|
|
31
|
+
resolution calls:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
bun run --cwd open/hsx playground:check
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Serve locally
|
|
38
|
+
|
|
39
|
+
The hosted playground is served at https://hyperscale0.ai/playground.
|
|
40
|
+
To run the playground locally from `open/hsx/playground/dist/`, serve
|
|
41
|
+
the output directory with any local static file server.
|
|
42
|
+
|
|
43
|
+
Using Bun:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
bunx serve open/hsx/playground/dist
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Using Python:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python3 -m http.server -d open/hsx/playground/dist 8000
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Open `http://localhost:8000` in a browser.
|
package/docs/reference/cli.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
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
|
|
6
|
+
hsx 2.0.0, the HSX compiler
|
|
7
7
|
|
|
8
8
|
Usage:
|
|
9
9
|
hsx check <file.hsx> [--strict]
|
|
@@ -11,15 +11,17 @@ Usage:
|
|
|
11
11
|
hsx cost <file.hsx> [--json] [--out <file.json>] [--strict]
|
|
12
12
|
hsx explain <HSX####>
|
|
13
13
|
hsx format <file.hsx>
|
|
14
|
+
hsx lsp
|
|
14
15
|
hsx --version
|
|
15
16
|
hsx --help
|
|
16
17
|
|
|
17
18
|
Commands:
|
|
18
19
|
check Compile and report diagnostics. Prints nothing when the program is clean.
|
|
19
|
-
build Compile and write canonical UDL
|
|
20
|
+
build Compile and write canonical UDL as JSON.
|
|
20
21
|
cost Compile and print the version-pinned cost manifest as a table or JSON.
|
|
21
22
|
explain Print one diagnostic title, fix, and source example.
|
|
22
23
|
format Print the source in the one canonical HSX style.
|
|
24
|
+
lsp Run the language server over stdin and stdout.
|
|
23
25
|
|
|
24
26
|
Options:
|
|
25
27
|
--json Print the cost manifest as JSON instead of a table.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
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
|
-
|
|
35
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
36
|
+
fields { }
|
|
36
37
|
lifecycle { states created; initial created; }
|
|
37
|
-
action create {
|
|
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
|
-
|
|
66
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
67
|
+
fields { }
|
|
63
68
|
lifecycle { states created; initial created; }
|
|
64
|
-
action create {
|
|
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
|
-
|
|
118
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
119
|
+
fields { }
|
|
111
120
|
lifecycle { states created; initial created; }
|
|
112
|
-
action create {
|
|
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
|
|
247
|
+
## HSX1022: Authored instrument collides with published catalog
|
|
236
248
|
|
|
237
249
|
Stage: `typecheck`
|
|
238
250
|
|
|
239
|
-
Fix:
|
|
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
|
-
|
|
264
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
265
|
+
fields { }
|
|
253
266
|
lifecycle { states created; initial created; }
|
|
254
|
-
action create {
|
|
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
|
-
|
|
328
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
329
|
+
fields { }
|
|
269
330
|
lifecycle { states created; initial created; }
|
|
270
|
-
action create {
|
|
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
|
-
|
|
349
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
350
|
+
fields { }
|
|
286
351
|
lifecycle { states created; initial created; }
|
|
287
|
-
action create {
|
|
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
|
-
|
|
370
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
371
|
+
fields { }
|
|
303
372
|
lifecycle { states created; initial created; }
|
|
304
|
-
action create {
|
|
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
|
-
|
|
390
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
391
|
+
fields { }
|
|
319
392
|
lifecycle { states created; initial created; }
|
|
320
|
-
action create {
|
|
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
|
-
|
|
427
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
428
|
+
fields { }
|
|
352
429
|
lifecycle { states created; initial created; }
|
|
353
|
-
action create {
|
|
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
|
-
|
|
448
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
449
|
+
fields { }
|
|
369
450
|
lifecycle { states created; initial created; }
|
|
370
|
-
action create {
|
|
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
|
-
|
|
469
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
470
|
+
fields { }
|
|
386
471
|
lifecycle { states created; initial created; }
|
|
387
|
-
action create {
|
|
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
|
-
|
|
545
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
546
|
+
fields { }
|
|
418
547
|
lifecycle { states created; initial created; }
|
|
419
|
-
action create {
|
|
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
|
-
|
|
593
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
594
|
+
fields { }
|
|
462
595
|
lifecycle { states created; initial created; }
|
|
463
|
-
action create {
|
|
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
|
-
|
|
642
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
643
|
+
fields { }
|
|
507
644
|
lifecycle { states created; initial created; }
|
|
508
|
-
action create {
|
|
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
|
-
|
|
694
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
695
|
+
fields { }
|
|
555
696
|
lifecycle { states created; initial created; }
|
|
556
|
-
action create {
|
|
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
|
-
|
|
714
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
715
|
+
fields { }
|
|
571
716
|
lifecycle { states created; initial created; }
|
|
572
|
-
action create {
|
|
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
|
-
|
|
796
|
+
agent_description: "Probe instrument for catalog diagnostics.";
|
|
797
|
+
fields { }
|
|
615
798
|
lifecycle { states created; initial created; }
|
|
616
|
-
action create {
|
|
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
|
+
<!-- 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
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# advance
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
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
|
+
<!-- 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/
|
|
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
|
+
<!-- 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/
|
|
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`, `
|
|
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
|
+
<!-- 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/
|
|
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`, `
|
|
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
|
+
<!-- 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/
|
|
5
|
+
Source: [`std/money_flows/credit_facility.hsx`](../../../std/money_flows/credit_facility.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|