@hyperscale0/hsx 2.4.0 → 3.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 +2 -400
- package/README.md +3 -92
- package/dist/src/ast.d.ts +99 -310
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast.js +16 -69
- package/dist/src/ast.js.map +1 -1
- package/dist/src/cli.d.ts +6 -19
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +76 -315
- package/dist/src/cli.js.map +1 -1
- package/dist/src/compile.d.ts +23 -73
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +1113 -148
- package/dist/src/compile.js.map +1 -1
- package/dist/src/cost.d.ts +8 -77
- package/dist/src/cost.d.ts.map +1 -1
- package/dist/src/cost.js +13 -422
- package/dist/src/cost.js.map +1 -1
- package/dist/src/format.d.ts +8 -7
- package/dist/src/format.d.ts.map +1 -1
- package/dist/src/format.js +9 -175
- package/dist/src/format.js.map +1 -1
- package/dist/src/headers.d.ts +35 -0
- package/dist/src/headers.d.ts.map +1 -0
- package/dist/src/headers.js +108 -0
- package/dist/src/headers.js.map +1 -0
- package/dist/src/index.d.ts +6 -12
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -9
- package/dist/src/index.js.map +1 -1
- package/dist/src/lex.d.ts +8 -28
- package/dist/src/lex.d.ts.map +1 -1
- package/dist/src/lex.js +88 -146
- package/dist/src/lex.js.map +1 -1
- package/dist/src/parse.d.ts +4 -17
- package/dist/src/parse.d.ts.map +1 -1
- package/dist/src/parse.js +402 -1040
- package/dist/src/parse.js.map +1 -1
- package/dist/src/std-bundle.d.ts.map +1 -1
- package/dist/src/std-bundle.js +12 -20
- package/dist/src/std-bundle.js.map +1 -1
- package/dist/src/std-library.d.ts +1 -1
- package/dist/src/std-library.d.ts.map +1 -1
- package/dist/src/std-library.js +1 -5
- package/dist/src/std-library.js.map +1 -1
- package/dist/src/tunables.d.ts +7 -0
- package/dist/src/tunables.d.ts.map +1 -0
- package/dist/src/tunables.js +26 -0
- package/dist/src/tunables.js.map +1 -0
- package/dist/src/version.d.ts +2 -4
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +2 -4
- package/dist/src/version.js.map +1 -1
- package/docs/README.md +179 -41
- package/docs/headers.md +44 -0
- package/examples/cost-table.json +99 -751
- package/examples/library.hsx +59 -0
- package/package.json +9 -17
- package/src/ast.ts +82 -441
- package/src/cli.ts +77 -362
- package/src/compile.ts +1535 -247
- package/src/cost.ts +28 -671
- package/src/format.ts +12 -256
- package/src/headers.ts +126 -0
- package/src/index.ts +7 -39
- package/src/lex.ts +99 -195
- package/src/parse.ts +403 -1209
- package/src/std-bundle.ts +12 -20
- package/src/std-library.ts +2 -7
- package/src/tunables.ts +31 -0
- package/src/version.ts +2 -5
- package/std/approvals.hsx +17 -0
- package/std/cards.hsx +63 -0
- package/std/collections.hsx +31 -0
- package/std/escrow.hsx +43 -0
- package/std/financing.hsx +372 -0
- package/std/insurance.hsx +59 -0
- package/std/lending.hsx +115 -0
- package/std/marketplace.hsx +24 -0
- package/std/money.hsx +195 -0
- package/std/savings.hsx +44 -0
- package/std/travel.hsx +98 -0
- package/std/wallet.hsx +41 -0
- package/dist/src/diagnostics.d.ts +0 -13
- package/dist/src/diagnostics.d.ts.map +0 -1
- package/dist/src/diagnostics.js +0 -587
- package/dist/src/diagnostics.js.map +0 -1
- package/dist/src/emit.d.ts +0 -51
- package/dist/src/emit.d.ts.map +0 -1
- package/dist/src/emit.js +0 -192
- package/dist/src/emit.js.map +0 -1
- package/dist/src/entry-overrides.d.ts +0 -58
- package/dist/src/entry-overrides.d.ts.map +0 -1
- package/dist/src/entry-overrides.js +0 -284
- package/dist/src/entry-overrides.js.map +0 -1
- package/dist/src/ir.d.ts +0 -73
- package/dist/src/ir.d.ts.map +0 -1
- package/dist/src/ir.js +0 -15
- package/dist/src/ir.js.map +0 -1
- package/dist/src/limits.d.ts +0 -23
- package/dist/src/limits.d.ts.map +0 -1
- package/dist/src/limits.js +0 -23
- package/dist/src/limits.js.map +0 -1
- package/dist/src/lsp/server.d.ts +0 -32
- package/dist/src/lsp/server.d.ts.map +0 -1
- package/dist/src/lsp/server.js +0 -391
- package/dist/src/lsp/server.js.map +0 -1
- package/dist/src/modules.d.ts +0 -38
- package/dist/src/modules.d.ts.map +0 -1
- package/dist/src/modules.js +0 -372
- package/dist/src/modules.js.map +0 -1
- package/dist/src/typecheck.d.ts +0 -8
- package/dist/src/typecheck.d.ts.map +0 -1
- package/dist/src/typecheck.js +0 -4131
- package/dist/src/typecheck.js.map +0 -1
- package/docs/guide/01-first-program.md +0 -24
- package/docs/guide/02-money.md +0 -25
- package/docs/guide/03-instruments.md +0 -93
- package/docs/guide/04-lifecycles.md +0 -40
- package/docs/guide/05-fees-and-splits.md +0 -45
- package/docs/guide/06-schedules.md +0 -26
- package/docs/guide/07-composition.md +0 -52
- package/docs/guide/08-writing-a-module.md +0 -85
- package/docs/guide/09-cost.md +0 -24
- package/docs/guide/10-diagnostics.md +0 -27
- package/docs/llms-full.txt +0 -3684
- package/docs/llms.txt +0 -44
- package/docs/piece-plans.md +0 -120
- package/docs/playground.md +0 -55
- package/docs/reference/cli.md +0 -36
- package/docs/reference/diagnostics.md +0 -901
- package/docs/reference/grammar.md +0 -38
- package/docs/reference/std/advance.md +0 -112
- package/docs/reference/std/cancellable_booking.md +0 -159
- package/docs/reference/std/captured_payment.md +0 -115
- package/docs/reference/std/conditional_disbursement.md +0 -101
- package/docs/reference/std/credit_facility.md +0 -108
- package/docs/reference/std/held_payment.md +0 -173
- package/docs/reference/std/instant_transfer.md +0 -97
- package/docs/reference/std/metered.md +0 -89
- package/docs/reference/std/pooled_split.md +0 -95
- package/docs/reference/std/premium_forward.md +0 -119
- package/docs/reference/std/reconciled_payout.md +0 -103
- package/docs/reference/std/rotating_pool.md +0 -130
- package/docs/reference/std/scheduled.md +0 -136
- package/docs/reference/std/security_deposit.md +0 -138
- package/docs/reference/std/settlement_batch.md +0 -123
- package/docs/reference/std/swap.md +0 -133
- package/docs/reference/std/threshold_pool.md +0 -138
- package/docs/reference/std/weighted_distribution.md +0 -135
- package/docs/reference/types.md +0 -61
- package/docs/reference/udl-output.md +0 -13
- package/examples/01-first-program/README.md +0 -45
- package/examples/01-first-program/tip-jar.hsx +0 -17
- package/examples/02-imports-and-modules/README.md +0 -96
- package/examples/02-imports-and-modules/photo-booth.hsx +0 -37
- package/examples/03-diagnostics/README.md +0 -68
- package/examples/03-diagnostics/corner-shop-fixed.hsx +0 -22
- package/examples/03-diagnostics/corner-shop.hsx +0 -19
- package/examples/04-complete-product/README.md +0 -84
- package/examples/04-complete-product/study-hall.hsx +0 -67
- package/examples/05-authored-instrument/README.md +0 -5
- package/examples/05-authored-instrument/payment.hsx +0 -37
- package/examples/05-watch-club/README.md +0 -6
- package/examples/05-watch-club/watch-club.hsx +0 -123
- package/examples/README.md +0 -48
- package/examples/advance/README.md +0 -3
- package/examples/advance/advance.hsx +0 -13
- package/examples/advance/advance.udl +0 -367
- package/examples/cancellable_booking/README.md +0 -3
- package/examples/cancellable_booking/cancellable_booking.hsx +0 -14
- package/examples/cancellable_booking/cancellable_booking.udl +0 -413
- package/examples/captured_payment/README.md +0 -3
- package/examples/captured_payment/captured_payment.hsx +0 -17
- package/examples/captured_payment/captured_payment.udl +0 -686
- package/examples/conditional_disbursement/README.md +0 -3
- package/examples/conditional_disbursement/conditional_disbursement.hsx +0 -15
- package/examples/conditional_disbursement/conditional_disbursement.udl +0 -418
- package/examples/credit_facility/README.md +0 -3
- package/examples/credit_facility/credit_facility.hsx +0 -24
- package/examples/credit_facility/credit_facility.udl +0 -1396
- package/examples/held_payment/README.md +0 -3
- package/examples/held_payment/held_payment.hsx +0 -13
- package/examples/held_payment/held_payment.udl +0 -569
- package/examples/instant_transfer/README.md +0 -3
- package/examples/instant_transfer/instant_transfer.hsx +0 -16
- package/examples/instant_transfer/instant_transfer.udl +0 -376
- package/examples/metered/README.md +0 -3
- package/examples/metered/metered.hsx +0 -13
- package/examples/metered/metered.udl +0 -253
- package/examples/pooled_split/README.md +0 -3
- package/examples/pooled_split/pooled_split.hsx +0 -15
- package/examples/pooled_split/pooled_split.udl +0 -432
- package/examples/premium_forward/README.md +0 -3
- package/examples/premium_forward/premium_forward.hsx +0 -19
- package/examples/premium_forward/premium_forward.udl +0 -604
- package/examples/reconciled_payout/README.md +0 -3
- package/examples/reconciled_payout/reconciled_payout.hsx +0 -13
- package/examples/reconciled_payout/reconciled_payout.udl +0 -312
- package/examples/rotating_pool/README.md +0 -3
- package/examples/rotating_pool/rotating_pool.hsx +0 -18
- package/examples/rotating_pool/rotating_pool.udl +0 -4370
- package/examples/scheduled/README.md +0 -3
- package/examples/scheduled/scheduled.hsx +0 -12
- package/examples/scheduled/scheduled.udl +0 -355
- package/examples/security_deposit/README.md +0 -3
- package/examples/security_deposit/security_deposit.hsx +0 -21
- package/examples/security_deposit/security_deposit.udl +0 -320
- package/examples/settlement_batch/README.md +0 -3
- package/examples/settlement_batch/settlement_batch.hsx +0 -19
- package/examples/settlement_batch/settlement_batch.udl +0 -757
- package/examples/swap/README.md +0 -3
- package/examples/swap/swap.hsx +0 -19
- package/examples/swap/swap.udl +0 -892
- package/examples/threshold_pool/README.md +0 -3
- package/examples/threshold_pool/threshold_pool.hsx +0 -16
- package/examples/threshold_pool/threshold_pool.udl +0 -680
- package/examples/weighted_distribution/README.md +0 -3
- package/examples/weighted_distribution/weighted_distribution.hsx +0 -20
- package/examples/weighted_distribution/weighted_distribution.udl +0 -348
- package/skills/hsx/SKILL.md +0 -449
- package/src/diagnostics.ts +0 -620
- package/src/emit.ts +0 -282
- package/src/entry-overrides.ts +0 -428
- package/src/ir.ts +0 -113
- package/src/limits.ts +0 -22
- package/src/lsp/server.ts +0 -460
- package/src/modules.ts +0 -452
- package/src/typecheck.ts +0 -5381
- package/std/SEMANTICS.md +0 -44
- package/std/money_flows/advance.hsx +0 -235
- package/std/money_flows/cancellable_booking.hsx +0 -402
- package/std/money_flows/captured_payment.hsx +0 -220
- package/std/money_flows/conditional_disbursement.hsx +0 -226
- package/std/money_flows/credit_facility.hsx +0 -214
- package/std/money_flows/held_payment.hsx +0 -812
- package/std/money_flows/index.hsx +0 -4
- package/std/money_flows/instant_transfer.hsx +0 -231
- package/std/money_flows/metered.hsx +0 -104
- package/std/money_flows/pooled_split.hsx +0 -109
- package/std/money_flows/premium_forward.hsx +0 -307
- package/std/money_flows/reconciled_payout.hsx +0 -119
- package/std/money_flows/rotating_pool.hsx +0 -305
- package/std/money_flows/scheduled.hsx +0 -599
- package/std/money_flows/security_deposit.hsx +0 -248
- package/std/money_flows/settlement_batch.hsx +0 -173
- package/std/money_flows/swap.hsx +0 -1192
- package/std/money_flows/threshold_pool.hsx +0 -307
- package/std/money_flows/weighted_distribution.hsx +0 -237
package/CHANGELOG.md
CHANGED
|
@@ -1,401 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# HSX 3.0.0
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this package
|
|
5
|
-
follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
-
|
|
7
|
-
The IR format version (`"hsx": 1`, stamped into every compiled document) moves
|
|
8
|
-
independently of the package version.
|
|
9
|
-
|
|
10
|
-
## [2.4.0] - 2026-09-17
|
|
11
|
-
|
|
12
|
-
Pairs with UDL 2.6.0.
|
|
13
|
-
|
|
14
|
-
### Added
|
|
15
|
-
|
|
16
|
-
- `collects` parameter on `cancellable_booking` to cascade named actions to linked instruments on deposit.
|
|
17
|
-
|
|
18
|
-
## [2.3.0] - 2026-09-17
|
|
19
|
-
|
|
20
|
-
Pairs with UDL 2.5.0.
|
|
21
|
-
|
|
22
|
-
### Added
|
|
23
|
-
|
|
24
|
-
- `allow_zero: true` on a `money<C>` field admits a zero amount; the default still refuses zero. `allow_zero` on any other type is HSX1105. Decision port shapes set it on their money fields.
|
|
25
|
-
|
|
26
|
-
### Changed
|
|
27
|
-
|
|
28
|
-
- `date` fields admit any RFC 3339 offset, such as `+03:00`; the host stores the UTC instant. Values already in `Z` pass through unchanged.
|
|
29
|
-
|
|
30
|
-
### Docs
|
|
31
|
-
|
|
32
|
-
- The instruments guide gains "Money fields" and "Date fields" sections covering both rules.
|
|
33
|
-
|
|
34
|
-
## [2.2.1] - 2026-09-16
|
|
35
|
-
|
|
36
|
-
Pairs with UDL 2.4.0.
|
|
37
|
-
|
|
38
|
-
### Fixed
|
|
39
|
-
|
|
40
|
-
- `cancellable_booking` pins its four priced-booking account fields to the `customer_balance` role, so programs that import it pass the host's account-role admission law.
|
|
41
|
-
- Pin receipt distribution fee, tax and residual accounts to customer balances.
|
|
42
|
-
- Lower omitted and full-refund unpaid cancellation bands as deposit refunds. Refuse constant cancellation partitions that exceed the deposit.
|
|
43
|
-
|
|
44
|
-
### Docs
|
|
45
|
-
|
|
46
|
-
- The instruments guide teaches the `"x-hyperscale-reference-filter"` role pin on account fields, and the generated type reference repeats it.
|
|
47
|
-
|
|
48
|
-
## [2.2.0] - 2026-09-15
|
|
49
|
-
|
|
50
|
-
Pairs with UDL 2.4.0.
|
|
51
|
-
|
|
52
|
-
### Added
|
|
53
|
-
|
|
54
|
-
- General lowering for allocation, `requiresAllocation`, `templateBinding`, children buckets, unique account fields and allocation-backed exposure measures. Signed schedules, stored rates, referenced transitions, equal partitions, contributions and attested decisions retain their UDL contracts.
|
|
55
|
-
- Custody vocabulary: `shift_date`, `requiresExposure.groupField` and `minimumField`, `funding` and `receiptDistribution`.
|
|
56
|
-
- `cancellable_booking` accepts finite `cancel_bands`, deposit/balance custody, supplier shares, confirmation release and timeout refunds. `held_payment.private_actions` lets a program select its public aliases.
|
|
57
|
-
- `threshold_pool.funding_join` binds frozen wallet tickets to priced funding. `weighted_distribution` receipt mode derives ticket ratios, carves fee and VAT, pays a named residual and allocates noncash losses.
|
|
58
|
-
- A complete authored cash-movement example and checkout CLI instructions. Generated std references include parameter tables and clause coverage across branches.
|
|
59
|
-
|
|
60
|
-
### Changed
|
|
61
|
-
|
|
62
|
-
- `advance` derives profit from principal, separates repayment and profit parties, and accepts signed dates. `scheduled` expands finite slice lists and preserves other delinquent slices.
|
|
63
|
-
- Remove the empty `recurring_collection` module, unused std parameters, the journeys clause and the Blueprint cost dimension.
|
|
64
|
-
|
|
65
|
-
## [2.1.1] - 2026-09-15
|
|
66
|
-
|
|
67
|
-
Published in lockstep with UDL 2.3.0.
|
|
68
|
-
|
|
69
|
-
### Added
|
|
70
|
-
|
|
71
|
-
- `docs/piece-plans.md`, a guide to partitioned totals: declaring pieces, orders and payees, staging one piece per action, and reading the compiled plan.
|
|
72
|
-
|
|
73
|
-
## [2.1.0] - 2026-09-14
|
|
74
|
-
|
|
75
|
-
Published in lockstep with UDL 2.1.0.
|
|
76
|
-
|
|
77
|
-
### Added
|
|
78
|
-
|
|
79
|
-
- `piece_plan` declares a partitioned total with named pieces, immutable release and refund payees, and fund, release, refund and unfund orders. `piece_stage` on an action moves one piece and derives the `pieceId` input from the selected order.
|
|
80
|
-
- `calls` on an action invoke typed private actions from an `action_library`, binding parameters and capturing results. Public and authored calls lower to the same leaf origins, and the compiled document round-trips calls and piece plans losslessly.
|
|
81
|
-
- Diagnostics `HSX1610` (piece partition), `HSX1611` (piece stage), `HSX1612` (action graph), `HSX1613` (static call binding), `HSX1614` (action boundary) and `HSX1615` (leaf evidence and effects), each mapped from its UDL counterpart. `HSX1601` and `HSX1602` now take their fix text from the diagnostic table.
|
|
82
|
-
- The cost kernel prices every expanded leaf of a call and refuses a leaf without a price (`HSX1301`).
|
|
83
|
-
|
|
84
|
-
### Changed
|
|
85
|
-
|
|
86
|
-
- The VS Code extension is titled "Hyperscale HSX". The README and playground carry the design-language brand assets.
|
|
87
|
-
- `HSX_LIMITS.maxExpansions` (256) bounds action-graph expansion; the typechecker's own limit is gone.
|
|
88
|
-
|
|
89
|
-
## [2.0.5] - 2026-09-11
|
|
90
|
-
|
|
91
|
-
### Fixed
|
|
92
|
-
|
|
93
|
-
- Print diagnostic codes next to severity, stage, and location on compiler and formatter error paths so `hsx explain <code>` works.
|
|
94
|
-
- Reconcile `version.ts` with `package.json`.
|
|
95
|
-
|
|
96
|
-
## [2.0.4] - 2026-09-11
|
|
97
|
-
|
|
98
|
-
Published in lockstep with UDL 2.0.4.
|
|
99
|
-
|
|
100
|
-
### Added
|
|
101
|
-
|
|
102
|
-
- Diagnostic `HSX1026` reports a decision port field whose declared type differs from the type its instrument captures for that field. It runs only when the compiler is given a published catalog, so plain CLI compiles are unchanged.
|
|
103
|
-
|
|
104
|
-
### Fixed
|
|
105
|
-
|
|
106
|
-
- The standard `held_payment` flow accepts `quote_cancellation` again from `cancellation_quoted`, so an expired offer can be re-quoted instead of trapping the deal.
|
|
107
|
-
- `held_payment` admits a dispute from `cancellation_quoted`.
|
|
108
|
-
- A `held_payment` cancellation with `cancel_charge_bps` of zero settles without emitting a zero-amount retain transfer.
|
|
109
|
-
|
|
110
|
-
## [2.0.3] - 2026-09-10
|
|
111
|
-
|
|
112
|
-
Published in lockstep with UDL 2.0.3.
|
|
113
|
-
|
|
114
|
-
### Added
|
|
115
|
-
|
|
116
|
-
- The quote clause key `charge_retained_by` lowers to the UDL `chargeRetainedBy` declaration, so an instrument can say which party keeps a cancellation charge. The lowering rides the generic key mapping that 2.0.2 already shipped; this release pins it with a test.
|
|
117
|
-
|
|
118
|
-
## [2.0.2] - 2026-09-10
|
|
119
|
-
|
|
120
|
-
### Added
|
|
121
|
-
|
|
122
|
-
- `held_payment` takes an opt-in quoted cancellation with an authored flat charge, so a cancellation quote can name the amount the refund source keeps.
|
|
123
|
-
- `std/money_flows/weighted_distribution` flow.
|
|
124
|
-
- Every std flow describes itself: the reference pages carry parameters and an example for each flow, and the guide documents the sandbox.
|
|
125
|
-
|
|
126
|
-
### Removed
|
|
127
|
-
|
|
128
|
-
- The GitHub Actions workflows. Publishing runs from the platform release lane.
|
|
129
|
-
|
|
130
|
-
## [2.0.1] - 2026-09-10
|
|
131
|
-
|
|
132
|
-
Published in lockstep with UDL 2.0.1.
|
|
133
|
-
|
|
134
|
-
### Added
|
|
135
|
-
|
|
136
|
-
- Pinned the currency of every move of a `money<CUR>` field, and of every account step in a fixed-currency instrument, to the constant `CUR` in the lowered document; a binding that reads the instrument's currency field is rewritten, and one the compiler cannot pin (an input, a ref, or a constant naming another currency) reports `HSX1306`.
|
|
137
|
-
|
|
138
|
-
### Changed
|
|
139
|
-
|
|
140
|
-
- Anchored `dispute` on `held_payment` to `release_deadline` like `cancel`, so a dispute after the release deadline refuses instead of freezing money the clock already released.
|
|
141
|
-
- Declared the safe-integer maximum on `share_offering.totalShares` and `share_allocation.shares` so the lowered schema round-trips byte for byte.
|
|
142
|
-
|
|
143
|
-
## [2.0.0] - 2026-09-10
|
|
144
|
-
|
|
145
|
-
### Added
|
|
146
|
-
|
|
147
|
-
- Added `hsx lsp` over stdio with diagnostics and formatting, and a VS Code language client.
|
|
148
|
-
- Added a static browser playground under `playground/` with debounced compilation, diagnostics inspection, span navigation, canonical UDL and cost manifest inspection, and inlined examples.
|
|
149
|
-
- Bundled standard library sources as data in `src/std-bundle.ts` and decoupled compiler module resolution from Node filesystem imports.
|
|
150
|
-
- Lowered money fields with an `x-hyperscale-currency` schema marker so consumers read the ledger currency without parsing descriptions.
|
|
151
|
-
- Accepted an array of cost tables (`examples/cost-table.json` now ships one card per priced currency); the compiler prices the card matching the program's ledger currency, reporting `HSX1304` for an unpriced currency and `HSX1305` for a program that moves money in two currencies.
|
|
152
|
-
- Reported `HSX1509` when an instrument, or an action a caller can reach, lacks an `agent_description`.
|
|
153
|
-
- Declared `sandbox_failure_point` on the std money-flow fund and release actions so sandbox failures land on a named step.
|
|
154
|
-
- Added `share_offering` and `share_allocation` std instruments with an integer-sum supply invariant, `dispute` and `resume` on `held_payment`, and `quote_refund` and `confirm_refund` on policy programs.
|
|
155
|
-
- Bound decision port parties through declared account fields; a decision-only party binds to an account and decides without holding money, and every action a port reaches carries its allowed parties.
|
|
156
|
-
|
|
157
|
-
### Changed
|
|
158
|
-
|
|
159
|
-
- Lowered `account<CUR>` fields with the `acct_(sandbox|live)_...` pattern.
|
|
160
|
-
- Diagnosed `allowed:` written on an action instead of its port, and refused ports whose allowed parties are not declared (`HSX1024`).
|
|
161
|
-
- Field descriptions are prose in the lowered document and no longer part of the frozen schema.
|
|
162
|
-
- Moved LSP server exports (`startLspServer`, `createHostForUri`, and LSP types) from the package root to `@hyperscale0/hsx/lsp`.
|
|
163
|
-
|
|
164
|
-
### Removed
|
|
165
|
-
|
|
166
|
-
- Deleted the Business Frame artifact (`frame`) from the compiler output and CLI build command.
|
|
167
|
-
|
|
168
|
-
## [1.0.0] - 2026-09-04
|
|
169
|
-
|
|
170
|
-
This release is byte-identical to 1.0.0-rc.1.
|
|
171
|
-
|
|
172
|
-
## [1.0.0-rc.1] - 2026-09-02
|
|
173
|
-
|
|
174
|
-
### Added
|
|
175
|
-
|
|
176
|
-
- Added the repository guide, generated compiler reference, `llms.txt`, and
|
|
177
|
-
`llms-full.txt`. Tests compile every guide program and compare generated
|
|
178
|
-
files byte for byte.
|
|
179
|
-
- Added one compiled example and pinned canonical UDL file for every standard
|
|
180
|
-
library module.
|
|
181
|
-
- Added the public HSX agent skill and moved language examples into it.
|
|
182
|
-
- Added `hsx explain` for the stable diagnostics catalog.
|
|
183
|
-
- Added a generated VS Code grammar, standard-library snippets, and a CI-built
|
|
184
|
-
`hsx.vsix` artifact.
|
|
185
|
-
|
|
186
|
-
### Changed
|
|
187
|
-
|
|
188
|
-
- `hsx cost` now prints a versioned effect table by default. `--json` prints the
|
|
189
|
-
complete manifest, and `--out <file.json>` writes that JSON. Basis-point rows
|
|
190
|
-
label their total as amount-dependent because the compiler has no priced
|
|
191
|
-
runtime amount. No cost flags were removed.
|
|
192
|
-
- The npm package now includes `docs/` and `skills/`. It no longer lists the
|
|
193
|
-
deleted `spec/` directory.
|
|
194
|
-
- The package exports its shipped standard-library files through `./std/*`.
|
|
195
|
-
|
|
196
|
-
### Fixed
|
|
197
|
-
|
|
198
|
-
- Diagnostics raised from an imported module now name that module and its own
|
|
199
|
-
source coordinates.
|
|
200
|
-
- `premium_forward` now reports `HSX1011` when endorsement selects a path that
|
|
201
|
-
needs `renewal_due`. It no longer reaches an internal lowering refusal.
|
|
202
|
-
|
|
203
|
-
## [1.0.0-beta.1] - 2026-08-29
|
|
204
|
-
|
|
205
|
-
- This is the first beta and has no package behavior changes from
|
|
206
|
-
1.0.0-alpha.6.
|
|
207
|
-
|
|
208
|
-
## [1.0.0-alpha.6] - 2026-08-29
|
|
209
|
-
|
|
210
|
-
### Fixed
|
|
211
|
-
|
|
212
|
-
- Alpha.6 carries a `held_payment` or `premium_forward` release port's actor
|
|
213
|
-
allowlist and declared input fields into the generated release action. Alpha.5
|
|
214
|
-
kept those constraints in the checked program and Business Frame but dropped
|
|
215
|
-
them from HSX-JSON IR, so a runtime consuming the IR could admit the release
|
|
216
|
-
without the declared actor or evidence. Recompile affected programs with
|
|
217
|
-
alpha.6.
|
|
218
|
-
|
|
219
|
-
## [1.0.0-alpha.5] - 2026-08-29
|
|
220
|
-
|
|
221
|
-
### Added
|
|
222
|
-
|
|
223
|
-
- Six settlement modules now compile and lower. `threshold_pool` caps locked
|
|
224
|
-
commitments and contributor count, then collects or refunds each commitment
|
|
225
|
-
whole. `weighted_distribution` freezes evidence-backed weights and pays by
|
|
226
|
-
deterministic largest remainder. `credit_facility` owns draw capacity while
|
|
227
|
-
a referenced `scheduled` obligation owns repayment. the retired collection tracker
|
|
228
|
-
adds mandate evidence and explicit attempts to that obligation.
|
|
229
|
-
`conditional_disbursement` stores one evidence-approved amount under a cap.
|
|
230
|
-
`rotating_pool` fixes its roster, contribution, due anchors, and payout order
|
|
231
|
-
before activation. Import the required module from `"settlement"` and
|
|
232
|
-
supply every policy entry that its reference table marks as required.
|
|
233
|
-
- Any settlement may declare one `derived_amount` block. The runtime computes
|
|
234
|
-
`floor(source * bps / 10000)` from a stored money field and callers omit the
|
|
235
|
-
target field. Version 1 accepts percentage rules from 1 through 9,999 basis
|
|
236
|
-
points. The checker refuses fixed rules, tiered rules, missing source fields,
|
|
237
|
-
non-money source fields, and target fields that already exist.
|
|
238
|
-
- `captured_payment` reserves a payer amount for strict partial captures before
|
|
239
|
-
a stored deadline. The payee may settle the remainder, void before capture,
|
|
240
|
-
or use separate full-only correction and externally decided reversal ports.
|
|
241
|
-
Declare the required capture, correction, negative-position, and timeout
|
|
242
|
-
policies explicitly. Compose another settlement when capture fees are
|
|
243
|
-
needed, because this module refuses `fees`.
|
|
244
|
-
- `settlement_batch` freezes capture lineage and signed adjustments at a stored
|
|
245
|
-
close date, persists gross, credit, debit, and net subtotals, and instructs
|
|
246
|
-
one payout from the frozen net. Supply lineage field names, the payout
|
|
247
|
-
destination and beneficiary reference, and an acknowledgement port. Apply a
|
|
248
|
-
correction to a later open batch instead of changing a closed batch.
|
|
249
|
-
- `overrideProgramEntries()`, `Program`, and the typed override and issue shapes
|
|
250
|
-
are public package exports. The function replaces existing integer or
|
|
251
|
-
basis-point literals in a parsed `Program`, then callers run the checker and
|
|
252
|
-
lowerer again. Every
|
|
253
|
-
override declares inclusive integer bounds. Negative, fractional, `NaN`,
|
|
254
|
-
infinite, out-of-range, missing, ambiguous, and non-literal targets return
|
|
255
|
-
coded issues, and one bad override prevents every replacement from being
|
|
256
|
-
returned.
|
|
257
|
-
- `premium_forward` accepts an optional stored policy reference, one non-money
|
|
258
|
-
endorsement port, a renewal due condition, and explicit-new-forward renewal.
|
|
259
|
-
Supply `policy_ref`, `renewal_due`, `renewal_policy`, `endorsement`,
|
|
260
|
-
`endorsement_policy`, and `lapse_policy` together when the forward needs
|
|
261
|
-
endorsement, lapse, or renewal behavior. The original forwarding shape
|
|
262
|
-
remains valid.
|
|
263
|
-
|
|
264
|
-
### Changed
|
|
265
|
-
|
|
266
|
-
- `scheduled` accepts `mode: obligation` for installment obligations. It emits
|
|
267
|
-
one payment instrument per anchor, binds each payment to its obligation and anchor,
|
|
268
|
-
allows partial and early payments, and refunds one stored paid row whole.
|
|
269
|
-
Obligation mode accepts 2 through 7 anchors and refuses rescheduling. Use the
|
|
270
|
-
original transfer schedule without `mode`, or declare the debtor and every
|
|
271
|
-
obligation policy explicitly.
|
|
272
|
-
- The program money-event budget is 20 instead of 14, and every settlement has
|
|
273
|
-
its own event cap. Advance carves now validate their amount field, currency,
|
|
274
|
-
recourse, and fee rules. Settlement references resolve through
|
|
275
|
-
module-declared exits, and lowering binds referenced instrument identity,
|
|
276
|
-
statuses, amounts, and currency before movement. Recompile programs that
|
|
277
|
-
previously sat near the budget or used an advance carve. The stricter checker
|
|
278
|
-
may refuse a carve or reference that alpha.4 accepted.
|
|
279
|
-
- HSX-JSON IR version 1 grew new instrument fields for generated-child prefixes,
|
|
280
|
-
aggregate invariants, derived amounts, typed references, beneficiary IDs,
|
|
281
|
-
currency, text, counts, and constants. Actions gained public actions, reference
|
|
282
|
-
bindings, captured input, payout instructions, signed sums, deterministic
|
|
283
|
-
distribution, aggregate and exposure checks, and durable-settlement gates.
|
|
284
|
-
Money events gained fixed, remaining-balance, and runtime-bounded amount
|
|
285
|
-
modes with dependency lists. Consumers that validate or interpret IR version
|
|
286
|
-
1 must adopt alpha.5's schema before accepting alpha.5 output.
|
|
287
|
-
- `settlement_batch` now requires `payout_beneficiary_ref`. Instruct emits a
|
|
288
|
-
payout intent and captures `payoutId` instead of emitting an internal
|
|
289
|
-
transfer. A system-only reconcile transition records `settlementEvidenceId`
|
|
290
|
-
after durable evidence matches that payout. The tenant acknowledgement port
|
|
291
|
-
remains a separate claim.
|
|
292
|
-
|
|
293
|
-
## [1.0.0-alpha.4] - 2026-08-26
|
|
294
|
-
|
|
295
|
-
### Removed
|
|
296
|
-
|
|
297
|
-
- Eleven names left the package entry point: the AST types `BlockExpr`,
|
|
298
|
-
`CallExpr`, `ListExpr`, `PercentExpr`, `PortDecl`, `PortRefExpr`, and
|
|
299
|
-
`SettlementDecl`, plus `lineColAt`, `CompileResult`, `HSX_IR_VERSION`, and
|
|
300
|
-
`HSX_VERSION`. Nothing outside this package imported any of them, and the
|
|
301
|
-
seven AST types were seven of the twenty-two the tree defines, chosen by no
|
|
302
|
-
rule anyone could restate. What the entry point exports now is what callers
|
|
303
|
-
use: `compile`, `checkProgram`, `lowerProgram`, `parseProgram`, and
|
|
304
|
-
`MONEY_EVENT_BUDGET`. Every removed name still exists in its own module for
|
|
305
|
-
the compiler's own use. Read the IR format version off the compiled
|
|
306
|
-
document's `hsx` field, which is what `spec/hsx-ir.schema.json` pins and what
|
|
307
|
-
a consumer of the JSON artifact already holds.
|
|
308
|
-
|
|
309
|
-
## [1.0.0-alpha.3] - 2026-08-25
|
|
310
|
-
|
|
311
|
-
### Fixed
|
|
312
|
-
|
|
313
|
-
- `compile()` no longer throws on a deeply nested source. Lists, blocks, calls,
|
|
314
|
-
and bindings are parsed by recursion and nothing bounded it, so a file
|
|
315
|
-
nesting past roughly 9,000 levels exhausted the call stack and a `RangeError`
|
|
316
|
-
escaped `compile()`, which SECURITY.md says never happens. Parsing stops at
|
|
317
|
-
the depth budget now and reports an ordinary parse diagnostic. The deepest
|
|
318
|
-
program in the corpus nests 5 levels.
|
|
319
|
-
- Diagnostic coordinates cost O(n + d log n) instead of O(n·d). `compile()`
|
|
320
|
-
resolved every diagnostic by rescanning the source from offset zero. On the
|
|
321
|
-
largest file this release will read, 262,144 bytes carrying one diagnostic
|
|
322
|
-
per two bytes, that was 10,304 ms of line and column arithmetic for 131,072
|
|
323
|
-
diagnostics while the parse itself took 18 ms. It scans once and
|
|
324
|
-
binary-searches now: same coordinates, 2.6 ms.
|
|
325
|
-
|
|
326
|
-
### Added
|
|
327
|
-
|
|
328
|
-
- Two source limits, both checked before the program is read. A file over
|
|
329
|
-
262,144 UTF-8 bytes, the same ceiling UDL uses, is refused before the lexer
|
|
330
|
-
runs. Nesting is refused past a parser depth budget of 64.
|
|
331
|
-
|
|
332
|
-
The depth budget counts nested expressions and blocks, which is not the same
|
|
333
|
-
number as source levels: `key { … }` spends one per level and `key: { … }`
|
|
334
|
-
spends two, so the budget buys 63 levels of the first and 31 of the second.
|
|
335
|
-
The release reference carried the conversion for every shape. Both refusals are
|
|
336
|
-
ordinary parse diagnostics, not exceptions.
|
|
337
|
-
|
|
338
|
-
## [1.0.0-alpha.2] - 2026-08-23
|
|
339
|
-
|
|
340
|
-
### Fixed
|
|
341
|
-
|
|
342
|
-
- `bin` points at the built JavaScript; alpha.1's registry metadata pointed at
|
|
343
|
-
TypeScript source. npm builds the packument from package.json as it sits on
|
|
344
|
-
disk after `postpack`, so the pack-time rewrite never reached `bin`, and
|
|
345
|
-
every install linked `.bin/hsx` to `bin/hsx.ts`, which Node refuses to
|
|
346
|
-
execute.
|
|
347
|
-
|
|
348
|
-
### Changed
|
|
349
|
-
|
|
350
|
-
- Licensed AGPL-3.0-only with a commercial license from Hyperscale LLC;
|
|
351
|
-
copyright holder Hyperscale LLC; repository renamed to
|
|
352
|
-
`hyperscale0/hyperscale-hsx`.
|
|
353
|
-
|
|
354
|
-
## [1.0.0-alpha.1] - 2026-08-22
|
|
355
|
-
|
|
356
|
-
First public release.
|
|
357
|
-
This is the first version published as a package anyone can install.
|
|
358
|
-
|
|
359
|
-
### Added
|
|
360
|
-
|
|
361
|
-
- `compile(source)`, the three-verdict driver: `valid`, `warning`, and
|
|
362
|
-
`invalid`, with diagnostics carrying 1-indexed line and column, a severity,
|
|
363
|
-
and the stage that raised them.
|
|
364
|
-
- The stage entry points `parseProgram`, `checkProgram`, and `lowerProgram`,
|
|
365
|
-
for tools that need one stage rather than the whole compile.
|
|
366
|
-
- `HSX_IR_VERSION`, exported and stamped into every compiled document as its
|
|
367
|
-
`hsx` field, so a consumer can decide from one integer whether it
|
|
368
|
-
understands the document. `HSX_VERSION` carries the package version.
|
|
369
|
-
- The `hsx` command: `hsx check <file> [--strict]` and
|
|
370
|
-
`hsx build <file> [--out <file>] [--strict]`. Exit codes are `0` compiled,
|
|
371
|
-
`1` refused, `2` unusable command line or input.
|
|
372
|
-
- `spec/hsx-ir.schema.json`, JSON Schema 2020-12 for the HSX-JSON IR document
|
|
373
|
-
and the Business Frame. Every `.hsx` file in the repository is validated
|
|
374
|
-
against it in CI.
|
|
375
|
-
- The release reference: the lexical grammar, the EBNF the parser accepts, what
|
|
376
|
-
each stage does, the diagnostic model, and all nine `settlement` modules
|
|
377
|
-
with their parameters and constraints.
|
|
378
|
-
- `examples/`, four teaching programs compiled by the test suite.
|
|
379
|
-
- `editors/vscode/`, a TextMate grammar for syntax highlighting.
|
|
380
|
-
|
|
381
|
-
### Known limitations
|
|
382
|
-
|
|
383
|
-
- **Diagnostics have no stable codes.** Match on `severity` and `stage`, which
|
|
384
|
-
are stable; do not pattern-match on message text. Codes would be additive
|
|
385
|
-
and are the obvious next step.
|
|
386
|
-
- **There is no formatter.** `hsx fmt` does not exist rather than existing
|
|
387
|
-
badly.
|
|
388
|
-
- **One program carries at most 14 money events** (`MONEY_EVENT_BUDGET`). A
|
|
389
|
-
program that needs more is refused with a diagnostic saying so.
|
|
390
|
-
- **`party` takes no attribute block yet**, though the grammar parses one.
|
|
391
|
-
|
|
392
|
-
[Unreleased]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0...HEAD
|
|
393
|
-
[1.0.0]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-rc.1...v1.0.0
|
|
394
|
-
[1.0.0-rc.1]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-beta.1...v1.0.0-rc.1
|
|
395
|
-
[1.0.0-beta.1]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.6...v1.0.0-beta.1
|
|
396
|
-
[1.0.0-alpha.6]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.5...v1.0.0-alpha.6
|
|
397
|
-
[1.0.0-alpha.5]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.4...v1.0.0-alpha.5
|
|
398
|
-
[1.0.0-alpha.4]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.3...v1.0.0-alpha.4
|
|
399
|
-
[1.0.0-alpha.3]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.2...v1.0.0-alpha.3
|
|
400
|
-
[1.0.0-alpha.2]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.1...v1.0.0-alpha.2
|
|
401
|
-
[1.0.0-alpha.1]: https://github.com/hyperscale0/hyperscale-hsx/releases/tag/v1.0.0-alpha.1
|
|
3
|
+
Version 3 replaces the previous grammar. Recreate development estates. There is no migration reader.
|
package/README.md
CHANGED
|
@@ -1,94 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(max-width: 600px) and (prefers-color-scheme: dark)" srcset="docs/assets/brand/hsx-stacked-white.svg">
|
|
4
|
-
<source media="(max-width: 600px)" srcset="docs/assets/brand/hsx-stacked.svg">
|
|
5
|
-
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/brand/hsx-horizontal-white.svg">
|
|
6
|
-
<source media="(prefers-color-scheme: light)" srcset="docs/assets/brand/hsx-horizontal.svg">
|
|
7
|
-
<img src="docs/assets/brand/hsx-horizontal.svg" alt="Hyperscale™ HSX" width="335">
|
|
8
|
-
</picture>
|
|
9
|
-
</p>
|
|
1
|
+
# HSX 3
|
|
10
2
|
|
|
11
|
-
|
|
3
|
+
Read the [language reference](docs/README.md).
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
HSX is the strictly typed programming language for money on the Hyperscale operating system. It defines general instruments, composes money flows from the [money flows library](std/), checks currency-indexed linear money, and calculates deterministic execution costs at compile time. HSX compiles each accepted program to canonical UDL. It does not execute settlements, open network sockets, or manage provider accounts.
|
|
16
|
-
|
|
17
|
-
## Install
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
npm install @hyperscale0/hsx @hyperscale0/udl
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Install the compiler globally or run it with `npx`:
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
npm install -g @hyperscale0/hsx
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
The VS Code extension package is available at https://hyperscale0.ai/downloads/hsx-vscode.vsix. Your editor extension runs `hsx lsp` to report diagnostics and format your document. It communicates through standard input and output.
|
|
30
|
-
|
|
31
|
-
## First program
|
|
32
|
-
|
|
33
|
-
`tip-jar.hsx` is an example HSX program that moves money:
|
|
34
|
-
|
|
35
|
-
```hsx
|
|
36
|
-
program tip_jar "Tip jar"
|
|
37
|
-
|
|
38
|
-
import { instant_transfer } from "std/money_flows"
|
|
39
|
-
|
|
40
|
-
party listener: person
|
|
41
|
-
party host: business
|
|
42
|
-
|
|
43
|
-
settlement tip = instant_transfer {
|
|
44
|
-
payer: listener
|
|
45
|
-
payee: host
|
|
46
|
-
amount: tipAmount: money(SAR)
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Check the program with the CLI:
|
|
51
|
-
|
|
52
|
-
```sh
|
|
53
|
-
hsx check tip-jar.hsx
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Compile it to canonical UDL:
|
|
57
|
-
|
|
58
|
-
```sh
|
|
59
|
-
hsx build tip-jar.hsx --out tip-jar.udl.json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The CLI exits 0 for an accepted program, 1 for a refused program, and 2 when the command line or input file cannot be used.
|
|
63
|
-
|
|
64
|
-
In TypeScript, compile a source string directly:
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
import { compile } from "@hyperscale0/hsx";
|
|
68
|
-
|
|
69
|
-
const result = compile(source, { costTable });
|
|
70
|
-
if (result.verdict !== "invalid" && result.artifacts) {
|
|
71
|
-
const { document, originMap, costManifest } = result.artifacts;
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Programmatic compilation requires a `costTable` parameter. See the [cost documentation](docs/guide/09-cost.md#cost) for table structure and pricing semantics. The compiler returns three artifacts: `document` (the canonical UDL value), `originMap` (UDL paths mapped to source spans), and `costManifest` (deterministic compile-time costs).
|
|
76
|
-
|
|
77
|
-
## Documentation
|
|
78
|
-
|
|
79
|
-
- [Guide and reading order](docs/README.md)
|
|
80
|
-
- [Your first program](docs/guide/01-first-program.md)
|
|
81
|
-
- [Standard library examples](examples/README.md)
|
|
82
|
-
- [Browser playground](docs/playground.md)
|
|
83
|
-
- [Compiler and language reference](docs/reference/)
|
|
84
|
-
- [Contributing](CONTRIBUTING.md)
|
|
85
|
-
|
|
86
|
-
## License and security
|
|
87
|
-
|
|
88
|
-
HSX is licensed under AGPL-3.0-only, with a commercial license available from Hyperscale LLC. See [LICENSE](LICENSE), [LICENSING.md](LICENSING.md), and [TRADEMARKS.md](TRADEMARKS.md).
|
|
89
|
-
|
|
90
|
-
Vulnerability reports go through private disclosure as described in [SECURITY.md](SECURITY.md).
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
Hyperscale™ is a trademark of Hyperscale LLC. Code licenses do not grant rights to the name or marks.
|
|
5
|
+
Run `bun run check` to build and check this package.
|