@hyperscale0/hsx 1.0.334 → 1.0.336

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 (40) hide show
  1. package/dist/src/attachment-economics.d.ts +16 -2
  2. package/dist/src/attachment-economics.d.ts.map +1 -1
  3. package/dist/src/attachment-economics.js +58 -2
  4. package/dist/src/attachment-economics.js.map +1 -1
  5. package/dist/src/catalog-program.d.ts +1 -1
  6. package/dist/src/catalog-program.d.ts.map +1 -1
  7. package/dist/src/catalog-program.js +1 -0
  8. package/dist/src/catalog-program.js.map +1 -1
  9. package/dist/src/cli.js +2 -2
  10. package/dist/src/cli.js.map +1 -1
  11. package/dist/src/compile.d.ts +5 -0
  12. package/dist/src/compile.d.ts.map +1 -1
  13. package/dist/src/compile.js +47 -5
  14. package/dist/src/compile.js.map +1 -1
  15. package/dist/src/examples-bundle.d.ts.map +1 -1
  16. package/dist/src/examples-bundle.js +1 -0
  17. package/dist/src/examples-bundle.js.map +1 -1
  18. package/dist/src/index.d.ts +1 -1
  19. package/dist/src/index.d.ts.map +1 -1
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/parse.js +13 -0
  22. package/dist/src/parse.js.map +1 -1
  23. package/dist/src/std-bundle.js +1 -1
  24. package/dist/src/std-bundle.js.map +1 -1
  25. package/dist/src/template-guide.d.ts.map +1 -1
  26. package/dist/src/template-guide.js +18 -4
  27. package/dist/src/template-guide.js.map +1 -1
  28. package/docs/README.md +11 -1
  29. package/examples/camera-rental.hsx +25 -0
  30. package/package.json +4 -4
  31. package/src/attachment-economics.ts +77 -2
  32. package/src/catalog-program.ts +1 -0
  33. package/src/cli.ts +2 -2
  34. package/src/compile.ts +73 -8
  35. package/src/examples-bundle.ts +1 -0
  36. package/src/index.ts +1 -0
  37. package/src/parse.ts +15 -0
  38. package/src/std-bundle.ts +1 -1
  39. package/src/template-guide.ts +21 -4
  40. package/std/money.hsx +46 -6
@@ -1 +1 @@
1
- {"version":3,"file":"examples-bundle.d.ts","sourceRoot":"","sources":["../../src/examples-bundle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,eAAO,MAAM,QAAQ,EAAE,UAAU,EAiBhC,CAAC"}
1
+ {"version":3,"file":"examples-bundle.d.ts","sourceRoot":"","sources":["../../src/examples-bundle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,eAAO,MAAM,QAAQ,EAAE,UAAU,EAkBhC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export const examples = [
2
+ { "id": "camera-rental", "title": "Camera rentals", "summary": "Riyadh camera shop holds a 1,000 SAR deposit on each rental and charges 50 SAR for each day a camera comes back late, after one day of grace, up to 300 SAR.", "headers": ["money"], "source": "// Riyadh camera shop holds a 1,000 SAR deposit on each rental and charges 50 SAR\n// for each day a camera comes back late, after one day of grace, up to 300 SAR.\nprogram camera_rentals \"Camera rentals\"\nuse money\n\n// The customer owns the rental and pays both the deposit and any late fee.\n// The shop is payee, so its own session keeps a damaged camera's deposit with\n// keep_deposit; released_by stays on the default payee. Late fees are earnings.\nobject rental \"Camera rental\" {\n fields { camera: text, returnBy: date }\n columns: [camera, returnBy]\n attach deposit = money.hold {\n payer: owner, payee: operator, amount: 1000 SAR\n expose create as agree_deposit\n expose fund as pay_deposit\n expose release as keep_deposit\n expose refund as return_deposit\n }\n attach late = money.late_fee {\n payer: owner, payee: operator, amount: 50 SAR, cap: 300 SAR, period: 1d, grace: 1d\n rename { dueAt: returnBy }\n expose create as agree_late_fees\n expose stop as record_return\n }\n}\n" },
2
3
  { "id": "cards", "title": "Boston catering cards", "summary": "Boston catering cards lets staff reserve supplier purchases up to 5,000 SAR each. Supplier cancellation releases the reservation; captured purchases support a full refund or a reviewed dispute.", "headers": ["cards"], "source": "// Boston catering cards lets staff reserve supplier purchases up to 5,000 SAR each.\n// Supplier cancellation releases the reservation; captured purchases support a full refund or a reviewed dispute.\nprogram team_expense_cards \"Boston catering cards\"\nuse cards\nparty supplier: business\n\n// Bind supplier to the food wholesaler. Staff customers own their card records.\n// Card fee: 0%, tax: 0% on card access because the caterer charges staff nothing.\n// A supplier invoice might be 2,000 SAR plus 15% VAT, paid as one 2,300 SAR\n// authorization. cards does not calculate or remit the supplier's invoice VAT.\nobject employee \"Catering expense card\" {\n fields { employeeName: text, department: text }\n columns: [employeeName, department]\n attach holder = cards.cardholder {\n holder: owner\n expose create as enrol_employee\n expose activate as activate_employee\n expose suspend as suspend_employee\n expose resume as restore_employee\n expose close as close_employee_access\n expose operator_close as remove_employee_access\n }\n attach card = cards.card {\n holder: holder, person: owner, issuer: operator, spend_limit: 5000 SAR\n expose create as issue_card\n expose activate as activate_card\n expose freeze as freeze_lost_card\n expose unfreeze as restore_found_card\n expose issuer_freeze as block_card\n expose issuer_unfreeze as unblock_card\n expose cancel as cancel_card\n expose issuer_cancel as retire_employee_card\n }\n // Supply the gross invoice amount and expiresAt, such as 24 hours after\n // ordering. Pending and approved authorizations expire without capture.\n attach payment = cards.authorization {\n card: card, merchant: supplier, issuer: operator\n expose create as request_supplier_payment\n expose approve as approve_payment\n expose decline as decline_payment\n expose capture as capture_delivered_order\n expose reverse as cancel_supplier_reservation\n }\n attach receipt = cards.transaction {\n authorization: payment\n expose create as record_captured_purchase\n expose refund as refund_supplier_purchase\n }\n attach complaint = cards.dispute {\n transaction: receipt, issuer: operator, within: 30d\n expose create as dispute_supplier_purchase\n expose review as review_purchase_dispute\n expose win as uphold_dispute_and_refund\n }\n // A dispute unresolved after 30 days becomes lost. A refund always needs\n // the supplier's funds; the card header does not prove card-network settlement.\n}\n" },
3
4
  { "id": "collections", "title": "Portland cafe equipment finance", "summary": "Portland cafe equipment finance lends 24,000 SAR over 12 months and refers debt seven days overdue. Its agency earns 10% of each recovery from the lender, with at most four contacts per 30 days.", "headers": ["collections", "financing"], "source": "// Portland cafe equipment finance lends 24,000 SAR over 12 months and refers debt seven days overdue.\n// Its agency earns 10% of each recovery from the lender, with at most four contacts per 30 days.\nprogram business_collections \"Portland cafe equipment finance\"\nuse collections\nuse financing\nparty agency: business\n\n// Bind agency to the collector. The cafe owns the facility. Set price to\n// 24,000 SAR: 6% flat profit is 1,440 SAR, repaid in twelve 2,120 SAR payments.\n// Loan fee: 0%, tax: 0% on principal. The agency invoices 15% VAT on its\n// recovery service outside collections.case, which posts only the 10% fee.\nobject facility \"Cafe equipment facility\" {\n fields { businessName: text, purpose: text, price: money }\n columns: [businessName, purpose, price]\n attach allowance = financing.limits {\n borrower: owner, per_borrower: 100000 SAR\n expose create as request_borrower_limit\n expose approve as approve_borrower\n }\n attach budget = financing.portfolio_limit {\n limit: 2000000 SAR\n expose create as create_lending_budget\n expose approve as approve_budget\n }\n // Approve both limits and provide twelve future due dates before disbursement.\n attach loan = financing.installments {\n borrower: owner, capital: operator, share: 0%\n months: 12, pricing: flat_total, profit_rate: 6%, disburse_to: borrower\n payoff_rebate: 100%, refund_within: 30d, write_off_after: 90d\n limits: allowance, portfolio: budget\n expose create as quote_equipment_loan\n expose sign as sign_loan\n expose disburse as release_loan\n expose cancel as decline_loan_quote\n expose void as cancel_unfunded_loan\n expose payoff as repay_early\n expose complete as close_repaid_loan\n }\n // Select matching plan, overdue slice and pending payment when opening.\n // Recovery pays that payment, not necessarily the whole remaining debt.\n attach recovery = collections.case {\n on: loan, agency: agency, capital: operator, overdue: 7d, fee: 10%\n expose create as refer_overdue_instalment\n expose assign as assign_agency\n expose recover as collect_referred_payment\n expose recall as recall_collection_case\n expose return_uncollected as return_uncollected_case\n }\n attach contact = collections.contact {\n case: recovery, agency: agency\n max_contacts: 4, window: 30d, contact_from: 9, contact_until: 18\n timezone: \"Asia/Riyadh\"\n expose create as record_collection_contact\n }\n}\n\nexpose facility.contact.outcome.create as record_contact_outcome\nexpose facility.loan.payment.create as record_repayment\nexpose facility.loan.payment.pay as pay_instalment\nexpose facility.loan.payment.refund as refund_mistaken_repayment\nexpose facility.loan.payoff_quote.create as request_payoff_quote\n// A disputed contact can be recorded, then capital can recall the case.\n// Uncollectible principal needs a separate capital decision after 90 days.\nexpose facility.loan.write_off_request.create as request_overdue_write_off\nexpose facility.loan.write_off_request.apply as approve_overdue_write_off\nexpose facility.loan.write_off_request.cancel as cancel_write_off_request\n" },
4
5
  { "id": "escrow", "title": "Seattle used laptops", "summary": "Seattle used laptops holds a buyer's 2,300 SAR until the laptop arrives and passes inspection. Delivery has seven days; the buyer has 48 hours to accept or dispute before the operator reviews the sale.", "headers": ["escrow"], "source": "// Seattle used laptops holds a buyer's 2,300 SAR until the laptop arrives and passes inspection.\n// Delivery has seven days; the buyer has 48 hours to accept or dispute before the operator reviews the sale.\nprogram used_device_sales \"Seattle used laptops\"\nuse escrow\nparty seller: business\n\n// Bind seller to the refurbisher. Set price to the agreed gross invoice, for\n// example 2,300 SAR. The company keeps 5%, 115 SAR, plus 15% VAT on that fee.\n// Seller receives 2,167.75 SAR. Any VAT on the laptop is on the seller's invoice.\nobject device \"Laptop purchase\" {\n fields { model: text, condition: text, serialNumber: text, price: money }\n columns: [model, condition, serialNumber, price]\n attach sale = escrow.hold {\n payer: owner, payee: seller\n fee: { seller: 5%, tax: 15% }\n deliver_within: 7d, accept_within: 48h\n dispute: { refund_after: return_verified }\n expose create as agree_purchase\n expose fund as pay_for_laptop\n expose deliver as confirm_delivery\n expose accept as accept_laptop\n expose dispute as report_problem\n expose verify_return as verify_returned_laptop\n expose refund as refund_buyer\n expose refund_undelivered as refund_missing_delivery\n expose settle_release as resolve_in_seller_favour\n expose settle_return as resolve_in_buyer_favour\n expose settle_refund as finish_buyer_refund\n expose cancel as cancel_unpaid_purchase\n }\n}\n" },
@@ -1 +1 @@
1
- {"version":3,"file":"examples-bundle.js","sourceRoot":"","sources":["../../src/examples-bundle.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC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AC,EAAC,QAAQ,EAAC,6pFAA6pF,EAAC;IACt9F,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAC,4BAA4B,EAAC,SAAS,EAAC,mMAAmM,EAAC,SAAS,EAAC,CAAC,SAAS,CAAC,EAAC,QAAQ,EAAC,+hDAA+hD,EAAC;IACl0D,EAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,6BAA6B,EAAC,SAAS,EAAC,6LAA6L,EAAC,SAAS,EAAC,CAAC,QAAQ,EAAC,WAAW,EAAC,UAAU,EAAC,aAAa,CAAC,EAAC,QAAQ,EAAC,62JAA62J,EAAC;IAChrK,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,qBAAqB,EAAC,SAAS,EAAC,0KAA0K,EAAC,SAAS,EAAC,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAC,8kDAA8kD,EAAC;CACh1D,CAAC"}
@@ -1,4 +1,4 @@
1
- export { compile, type CompileDiagnostic, type CompileOptions, type CompileResult, type CompileOriginMapEntry, type AdapterBindingTarget, } from "./compile.ts";
1
+ export { compile, type CompileDiagnostic, type CompileOptions, type CompileResult, type CompileWarning, type CompileOriginMapEntry, type AdapterBindingTarget, } from "./compile.ts";
2
2
  export type { ProviderAdapter } from "@hyperscale0/adl";
3
3
  export { parseProgram } from "./parse.ts";
4
4
  export { lex, KEYWORDS } from "./lex.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM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,MAAM,cAAc,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAMR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAwB,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAwB,MAAM,WAAW,CAAC;AAYvE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,aAAa,GAGd,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAOR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAwB,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAwB,MAAM,WAAW,CAAC;AAYvE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,aAAa,GAGd,MAAM,qBAAqB,CAAC"}
package/dist/src/parse.js CHANGED
@@ -504,6 +504,19 @@ class Parser {
504
504
  };
505
505
  if (/[a-z]$/.test(token.text))
506
506
  return { kind: "duration", value: token.text, span: token.span };
507
+ // `1 month` reads as one value, so the checker names the tunable it
508
+ // was given to instead of failing on the next line. A unit followed by
509
+ // `:` is the next entry's key, as in `count: 2` then `months: 2`.
510
+ if (/^(?:minute|hour|day|week|month|year)s?$/.test(this.peek().text) &&
511
+ this.peek().kind === "name" &&
512
+ this.tokens[this.index + 1]?.text !== ":") {
513
+ const unit = this.take().text;
514
+ return {
515
+ kind: "duration",
516
+ value: `${token.text} ${unit}`,
517
+ span: this.span(start),
518
+ };
519
+ }
507
520
  if (/^[A-Z]{3}$/.test(this.peek().text)) {
508
521
  const currency = this.take().text;
509
522
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAc,MAAM,UAAU,CAAC;AAU3C,MAAM,YAAa,SAAQ,KAAK;IACT,UAAU;IAA/B,YAAqB,UAAsB;QACzC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;0BADP,UAAU;IAE/B,CAAC;CACF;AACD,MAAM,UAAU,YAAY,CAAC,MAAc;IAIzC,MAAM,KAAK,GAAY;QACrB,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE;KACvC,CAAC;IACF,IAAI,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,MAAM;QAClD,OAAO;YACL,OAAO,EAAE,KAAK;YACd,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,wBAAwB;oBACjC,GAAG,EAAE,gCAAgC;oBACrC,IAAI,EAAE,KAAK,CAAC,IAAI;iBACjB;aACF;SACF,CAAC;IACJ,IAAI,UAAU,CAAC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 -8,7 +8,7 @@ export const BUNDLED_STD_FILES = new Map([
8
8
  ["insurance.hsx", "header insurance\n\n// Economics: Company commission is earning; refunds reverse its captured transfer.\n// Outside broker commissions and insurer premiums are pass-through.\n// Claim moves remain unclassified until their money purpose is declared.\n\n// Expose cover.create, activate and cancel separately. The adapter names a\n// registered boundary adapter (conformance_boundary in sandbox). covers is an\n// optional link to a sibling attachment; the attached object is already the\n// insured thing. claim_limit is the sum insured: approved and paid claims on one\n// cover, across every claim attachment, never total more. Activation binds adapter;\n// each slice needs a separately created unique period and an active cover to collect.\n// Collection debits holder for insurerPremium to the insurer and commission to\n// broker as two moves. Broker defaults to programOperator; bind a declared business\n// for a distinct agency. The two amounts sum to premium. Zero portions are allowed.\n// Cover.cancel invokes refund only on paid slices, before each startsAt. It returns\n// insurerPremium from insurer and commission from broker to holder. Active or\n// expired periods are excluded; insufficient recipient funds refuse the reversal.\n// Slice refund is parent-owned, not a public alias. Expose cover.cancel instead.\n// Claims require active cover. Expose claim.create, approve, deny and pay as needed.\n// Inspector approves OR denies from submitted. After approval only pay or clock\n// expiry can consume the reservation; deny is never available after approval.\n// Inspector is a bound party, not necessarily staff. These are ledger transfers;\n// outside settlement needs the boundary protocol, not a claim of provider success.\n\n// Cost: each slice collection or refund declares two transfers. Claim approval\n// reserves once; pay posts once and expiry voids once. Cover cancellation adds\n// bounded slice invocations. Run hsx cost for composed counts, not provider prices.\n\ninstrument cover(holder: party, adapter: text, commission: percent = 0%, broker: party = programOperator, covers: ref?, premium: money = runtime, claim_limit: money = runtime) {\n summary: \"Recurring cover bound to an outside insurer across an ADL boundary.\"\n fields { covers: ref<covers>?, holder: account of holder, insurer: account(adapter(adapter), cash, \"premium\"), expiresAt: date, claimLimit: money = claim_limit }\n lifecycle { states: [pending, active, cancelled, expired], initial: pending }\n action create { actor: { party: holder } }\n action activate {\n from: pending, to: active, actor: { party: programOperator }\n subject { adapter: adapter }\n }\n action cancel {\n from: active, to: cancelled, actor: { party: holder }\n invoke: [{ selection: { instrument: slice, reference: \"cover\", anchor: self.id, states: [paid], limit: 366 }, action: refund, input: {} }]\n }\n action expire { from: active, to: expired, actor: clock, due: { at: self.expiresAt } }\n records {\n slice: {\n summary: \"A whole premium period, collected once and refundable only before it starts.\"\n fields {\n cover: ref<parent>, premium: money = premium, startsAt: date, endsAt: date\n commission: money = rate(self.premium, commission)\n insurerPremium: money = subtract(self.premium, self.commission), commissionReceipt: text?\n }\n lifecycle { states: [pending, paid, active, expired, refunded], initial: pending }\n action create {\n requires self.startsAt < self.endsAt\n requires unique \"premium_period\" on [self.cover, self.startsAt, self.endsAt]\n }\n action collect {\n allowZero: true\n requires self.premium > \"0\"\n from: pending, to: paid, actor: { party: holder }\n requires self.cover in [active]\n moves self.insurerPremium from holder to self.cover.insurer economics { purpose: pass_through, sourceParty: holder }\n moves self.commission from holder to broker capture \"commissionReceipt\" economics { recipient: broker, company: { purpose: earning, sourceParty: holder }, participant: { purpose: pass_through, sourceParty: holder } }\n }\n action start { from: paid, to: active, actor: clock, due: { at: self.startsAt } }\n action expire { from: active, to: expired, actor: clock, due: { at: self.endsAt } }\n action refund {\n allowZero: true\n requires self.premium > \"0\"\n from: paid, to: refunded, actor: { parent: parent }, deadline: { at: self.startsAt }\n moves self.insurerPremium from self.cover.insurer to holder economics { purpose: pass_through, sourceParty: programOperator }\n moves self.commission from broker to holder economics { recipient: broker, company: { purpose: earning, sourceParty: broker, reversalOf: self.commissionReceipt }, participant: { purpose: pass_through, sourceParty: broker } }\n }\n }\n }\n}\n\ninstrument claim(cover: ref<insurance.cover>, inspector: party) {\n summary: \"A claim decision reserves one claim payment before settlement.\"\n fields { cover: ref<cover>, amount: money, expiresAt: date, evidence: text, reservation: text? }\n lifecycle { states: [submitted, approved, paid, denied, expired], initial: submitted }\n invariants sum \"amount\" of { instrument: all(insurance.claim), reference: \"cover\", anchor: self.cover, states: [approved, paid], limit: 366 } <= self.cover.claimLimit\n action create { requires self.cover in [active] }\n action approve {\n from: submitted, to: approved\n actor: { party: inspector }\n deadline: { at: self.expiresAt }\n moves reserve self.amount from self.cover.insurer to self.cover.holder capture \"reservation\"\n }\n action pay { from: approved, to: paid, actor: { party: inspector }, deadline: { at: self.expiresAt }, moves post self.reservation }\n action deny { from: submitted, to: denied, actor: { party: inspector } }\n action expire { from: approved, to: expired, actor: clock, due: { at: self.expiresAt }, moves void self.reservation }\n}\n"],
9
9
  ["lending.hsx", "header lending\n\n// Economics: Funding and commitment returns are principal. Distribution tax is\n// pass-through; own-account fee and claim allocations are internal. Mixed\n// principal/profit distributions and unbound source owners remain unclassified.\n\n// Round target is plan.principal from runtime subject.price, not its credit limit.\n// The operator opens the round and closes it before closesAt. Expose\n// round.create and close plus commitment.create and withdraw. A commitment\n// debits the bound investor's original active wallet before closesAt. Investor cap\n// aggregates by investor across wallets. A round still open at closesAt fails,\n// even when fully committed, and refunds those original wallets.\n// Closing needs the exact target; it funds plan.capital and does not disburse the\n// loan. Expose plan.disburse separately after signing and limit approval.\n// Distribution.create needs a recorded settlement matching the plan. Only the\n// payout consumes it: distribute_cash or distribute_loss claims the settlement\n// and marks it distributed, so the plan's unwind_paid keeps that profit, while an\n// abandoned distribution leaves the settlement refundable.\n// Prepare cash or loss first, then create shares against funded commitments of\n// that round. Distribution needs pending share weights equal to the round target.\n// Cash fee is a percentage of retained profit, VAT a percentage of that fee.\n// Principal plus retained profit less fee and VAT goes to weighted wallets;\n// floored residual goes to residual_to. Loss mode moves claim balances, not cash.\n// Child share execution is parent-owned. No report or clock proves outside payout.\n\n// Cost: round.create declares one owned account. Close transfers its balance\n// and invokes commitments; failure invokes their refunds. Distribution adds moves\n// and bounded share invocations. Run hsx cost for counts after policy selection.\n\ninstrument round(borrower: party, plan: ref<financing.installments> = object(financing.installments), operator: party = programOperator, minimum_ticket: money = 100 SAR, investor_cap: percent = 20%, commitments: ref<lending.commitment> = object(lending.commitment)) {\n summary: \"A threshold funding round; failed rounds return each original wallet contribution.\"\n fields {\n borrower: account of borrower, plan: ref<plan>, price: money = self.plan.principal, closesAt: date\n minimumTicket: money = minimum_ticket, maximumTicket: money = rate(self.price, investor_cap)\n held: account of self\n }\n lifecycle { states: [open, funded, failed], initial: open }\n action create { actor: { party: operator }, requires unique \"funding_plan\" on [self.plan]; requires self.borrower == self.plan.borrower }\n action close {\n from: open, to: funded, actor: { party: operator }\n requires sum \"amount\" of { instrument: commitments, reference: \"round\", anchor: self.id, states: [committed], limit: 366 } == self.price\n requires self.held.balance == self.price\n moves self.price from self.held to self.plan.capital economics { purpose: principal, sourceParty: programOperator }\n invoke: [{ selection: { instrument: commitments, reference: \"round\", anchor: self.id, states: [committed], limit: 366 }, action: fund, input: {} }]\n }\n action fail {\n from: open, to: failed, actor: clock, due: { at: self.closesAt }\n invoke: [{ selection: { instrument: commitments, reference: \"round\", anchor: self.id, states: [committed], limit: 366 }, action: refund, input: {} }]\n }\n}\n\ninstrument commitment(round: ref<lending.round>, wallet: ref<wallet.balance>, investor: party = party(person)) {\n summary: \"One investor's original-wallet contribution, capped cumulatively within the round.\"\n fields { round: ref<round>, wallet: ref<wallet>, investor: account of investor, amount: money, loss: account(investor, claim, \"loss\") }\n lifecycle { states: [committed, funded, withdrawn, refunded], initial: committed }\n invariants sum \"amount\" of { instrument: all(lending.commitment), reference: \"round\", anchor: self.round, states: [committed, funded], limit: 366, where: { investor: { field: self.investor } } } <= self.round.maximumTicket\n invariants sum \"amount\" of { instrument: all(lending.commitment), reference: \"round\", anchor: self.round, states: [committed, funded], limit: 366 } <= self.round.price\n action create {\n actor: { party: investor }\n requires self.round in [open]\n requires self.wallet in [active]\n requires self.wallet.holder == self.investor\n requires self.amount >= self.round.minimumTicket\n deadline: { at: self.round.closesAt }\n moves self.amount from self.wallet.held to self.round.held economics { purpose: principal, sourceParty: programOperator }\n }\n action fund { from: committed, to: funded, actor: { parent: round } }\n action withdraw {\n from: committed, to: withdrawn, actor: { party: investor }\n requires self.round in [open]\n deadline: { at: self.round.closesAt }\n moves self.amount from self.round.held to self.wallet.held economics { purpose: principal, sourceParty: programOperator }\n }\n action refund {\n from: committed, to: refunded, actor: { parent: round }\n moves self.amount from self.round.held to self.wallet.held economics { purpose: principal, sourceParty: programOperator }\n }\n}\n\ninstrument distribution(round: ref<lending.round>, receipt: ref, commitments: ref<lending.commitment> = object(lending.commitment), mode: enum(cash, loss) = cash, residual_to: party = programOperator, operator: party = programOperator, fee: percent = 1%, tax: percent = 15%) {\n summary: \"Frozen weighted shares, floored once, with residual assigned to the chosen party.\"\n fields {\n round: ref<round>, source: ref<receipt>, mode: enum(cash, loss) = mode\n principal: money?, profit: money?, grossTotal: money?, charge: money?, vat: money?, net: money?\n held: account of self, losses: account(self, claim), residualLoss: account(residual_to, claim, \"loss\")\n }\n lifecycle { states: [pending, cash_ready, loss_ready, distributed], initial: pending }\n action create {\n requires self.round in [funded]; requires self.source in [recorded]; requires self.source.plan == self.round.plan\n }\n action prepare_cash {\n from: pending, to: cash_ready\n requires self.mode == \"cash\"; requires self.source.kind == \"cash\"; requires self.source in [recorded]\n calculate: [\n { target: \"principal\", op: \"sum\", values: [{ field: self.source.principal }] }\n { target: \"profit\", op: \"sum\", values: [{ field: self.source.retainedProfit }] }\n { target: \"charge\", op: \"rate\", base: { field: self.profit }, bps: { literal: fee }, rounding: \"floor\" }\n { target: \"vat\", op: \"rate\", base: { field: self.charge }, bps: { literal: tax }, rounding: \"floor\" }\n { target: \"grossTotal\", op: \"sum\", values: [{ field: self.principal }, { field: self.profit }] }\n { target: \"net\", op: \"subtract\", base: { field: self.grossTotal }, subtract: [{ field: self.charge }, { field: self.vat }] }\n ]\n }\n action prepare_loss {\n from: pending, to: loss_ready\n requires self.mode == \"loss\"; requires self.source.kind == \"loss\"; requires self.source in [recorded]\n calculate: [{ target: \"net\", op: \"sum\", values: [{ field: self.source.loss }] }]\n }\n action distribute_cash { allowZero: true,\n from: cash_ready, to: distributed, actor: { party: operator }\n requires self.source in [recorded]; requires unique \"settlement_consumption\" on [self.source.plan, self.source.identity]\n requires sum \"weight\" of { instrument: share, reference: \"distribution\", anchor: self.id, states: [pending], limit: 366 } == self.round.price\n moves self.principal from self.source.capital to self.held; moves self.profit from self.source.profitIncome to self.held; moves self.charge from self.held to programOperator economics { purpose: internal, sourceParty: programOperator }; moves self.vat from self.held to programTax economics { purpose: pass_through, sourceParty: programOperator }\n invoke: [{ reference: self.source, action: distribute, input: {} }, { selection: { instrument: share, reference: \"distribution\", anchor: self.id, states: [pending], limit: 366 }, action: cash, input: {} }, { reference: self.id, action: residual_cash, input: {} }]\n }\n action residual_cash { allowZero: true,\n from: distributed, to: distributed, actor: { parent: current() }\n moves self.held.balance from self.held to residual_to\n }\n action distribute_loss { allowZero: true,\n from: loss_ready, to: distributed, actor: { party: operator }\n requires self.source in [recorded]; requires unique \"settlement_consumption\" on [self.source.plan, self.source.identity]\n requires sum \"weight\" of { instrument: share, reference: \"distribution\", anchor: self.id, states: [pending], limit: 366 } == self.round.price\n moves self.net from self.source.lossAccount to self.losses\n invoke: [{ reference: self.source, action: distribute, input: {} }, { selection: { instrument: share, reference: \"distribution\", anchor: self.id, states: [pending], limit: 366 }, action: loss, input: {} }, { reference: self.id, action: residual_loss, input: {} }]\n }\n action residual_loss { allowZero: true,\n from: distributed, to: distributed, actor: { parent: current() }\n moves self.losses.balance from self.losses to self.residualLoss economics { purpose: internal, sourceParty: programOperator }\n }\n records {\n share: {\n fields {\n distribution: ref<parent>, commitment: ref<commitments>\n weight: money = self.commitment.amount\n gross: money = ratio(self.distribution.net, self.weight, self.distribution.round.price)\n }\n lifecycle { states: [pending, paid], initial: pending }\n action create { requires self.distribution in [cash_ready, loss_ready]; requires self.commitment in [funded]; requires unique \"distribution_weight\" on [self.distribution, self.commitment]; requires self.commitment.round == self.distribution.round }\n action cash { allowZero: true,\n from: pending, to: paid, actor: { parent: parent }\n moves self.gross from self.distribution.held to self.commitment.wallet.held\n }\n action loss { allowZero: true, from: pending, to: paid, actor: { parent: parent }, moves self.gross from self.distribution.losses to self.commitment.loss economics { purpose: internal, sourceParty: programOperator } }\n }\n }\n}\n"],
10
10
  ["marketplace.hsx", "header marketplace\n\n// Economics: Deposit funding, escrow credit and returns are principal. Retention is\n// earning for the company or passes the buyer's cash through to a bound outside recipient.\n\n// Listing, order and reservation are separate agreements. Expose their create\n// and decision actions individually. Order fulfillment does not move escrow cash;\n// only the fulfiller marks it, the Product operator unless the seller is bound.\n// Pair an order with escrow.hold and expose its fund, deliver, accept, dispute,\n// verify_return and refund aliases. Refund needs disputed -> return_verified,\n// with payee evidence, then returns the full price to payer; accept pays payee.\n// A reservation holds its own deposit. Activate requires an active listing and\n// no placed order. Only a declared converter may invoke credit. A financing\n// plan on the same hold credits it when the lender disburses. Credit consumes the\n// deposit once, credits at most the contribution, and returns excess to buyer.\n// Expose cancel, seller_cancel or operator_cancel for the intended actors.\n// Buyer cancel and expiry use configured refund percentages; seller/operator\n// cancellation return the whole reservation balance. Converted money is in escrow,\n// so subsequent return verification and refund use the escrow aliases.\n\n// Cost: listing and order actions declare no transfers. Reservation.create\n// declares one owned account; activate declares one deposit transfer. Cancellation\n// and credit split that balance into moves. Run hsx cost for the composed counts.\n\ninstrument listing(seller: party) {\n revisioned: true\n summary: \"A seller's offer and its asking price.\"\n fields { seller: account of seller, title: text, price: money }\n lifecycle { states: [draft, active, withdrawn, sold], initial: draft }\n action create { actor: { party: seller } }\n action publish {\n from: draft, to: active, actor: { party: seller }\n }\n action withdraw { from: active, to: withdrawn, actor: { party: seller }, requires count of { instrument: all(marketplace.reservation), reference: \"listing\", anchor: self.id, states: [active], limit: 366 } == 0 }\n action sell { from: active, to: sold, actor: { party: seller }, requires count of { instrument: all(marketplace.reservation), reference: \"listing\", anchor: self.id, states: [active], limit: 366 } == 0 }\n}\n\ninstrument order(listing: ref<marketplace.listing>, buyer: party, fulfiller: party = programOperator) {\n revisioned: true\n summary: \"A buyer's order for one listing at its declared price.\"\n fields { listing: ref<listing>, buyer: account of buyer, price: money, reservations: integer?, ownReservations: integer?, blockingQuotes: integer?, ownBlockingQuotes: integer? }\n lifecycle { states: [quoted, placed, fulfilled, cancelled], initial: quoted }\n action create {\n actor: { party: buyer }\n requires self.listing in [active]\n calculate: [\n { target: blockingQuotes, op: aggregate, selection: { instrument: all(marketplace.reservation), reference: \"listing\", anchor: self.listing, states: [active], limit: 366, where: { quotePolicy: { literal: \"blocked\" } } }, measure: count }\n { target: ownBlockingQuotes, op: aggregate, selection: { instrument: all(marketplace.reservation), reference: \"listing\", anchor: self.listing, states: [active], limit: 366, where: { quotePolicy: { literal: \"blocked\" }, buyer: { field: self.buyer } } }, measure: count }\n ]\n requires self.blockingQuotes == self.ownBlockingQuotes\n requires self.price == self.listing.price\n }\n action commit {\n from: [quoted, placed], to: placed\n requires self.listing in [active]\n calculate: [\n { target: reservations, op: aggregate, selection: { instrument: all(marketplace.reservation), reference: \"listing\", anchor: self.listing, states: [active], limit: 366 }, measure: count }\n { target: ownReservations, op: aggregate, selection: { instrument: all(marketplace.reservation), reference: \"listing\", anchor: self.listing, states: [active], limit: 366, where: { buyer: { field: self.buyer } } }, measure: count }\n ]\n requires self.reservations == self.ownReservations\n }\n invariants count of { instrument: all(marketplace.order), reference: \"listing\", anchor: self.listing, states: [placed, fulfilled], limit: 366 } <= 1\n action fulfill { from: placed, to: fulfilled, actor: { party: fulfiller } }\n action cancel { from: [quoted, placed], to: cancelled, actor: { party: buyer } }\n}\n\ninstrument reservation(listing: ref<marketplace.listing>, funds: ref<escrow.hold>, converters: ref[], buyer: party, seller: party, expires_after: duration = 48h, deposit: money = 1000 SAR, cancellation_refund: percent = 100%, expiry_refund: percent = 100%, retained_to: party = programOperator, operator: party = programOperator, competing_quotes: enum(allowed, blocked) = allowed) {\n revisioned: true\n summary: \"Exclusive timed listing hold with explicit deposit credit and refund.\"\n fields {\n listing: ref<listing>, funds: ref<funds>, buyer: account of buyer, seller: account of seller, price: money, terms: text\n held: account of self, quotePolicy: enum(allowed, blocked) = competing_quotes, deposit: money = deposit, proposalExpiresAt: date = after(self.createdAt, expires_after), expiresAt: date?\n credit: money?, refund: money?, retained: money?, dispositionAt: date?, reason: text?\n }\n lifecycle { states: [proposed, active, converted, cancelled, expired], initial: proposed }\n invariants count of { instrument: all(marketplace.reservation), reference: \"listing\", anchor: self.listing, states: [active], limit: 366 } <= 1\n action create { actor: { party: buyer }, requires self.listing in [active]; requires self.seller == self.listing.seller; requires self.price == self.listing.price }\n action activate {\n from: proposed, to: active, actor: { party: buyer }, deadline: { at: self.proposalExpiresAt }\n calculate: [{ target: expiresAt, op: shift, date: { field: self.now }, milliseconds: { literal: expires_after }, direction: after }]\n requires self.listing in [active]; requires self.price == self.listing.price\n requires count of { instrument: all(marketplace.order), reference: \"listing\", anchor: self.listing, states: [placed, fulfilled], limit: 366 } == 0\n moves self.deposit from self.buyer to self.held economics { purpose: principal, sourceParty: buyer }\n }\n action credit { allowZero: true,\n from: active, to: converted, actor: { parent: converters }, deadline: { at: self.expiresAt }\n input { funds: ref<funds>, contribution: money }\n requires input.funds == self.funds; requires input.funds in [pending, funded]; requires input.funds.payer == self.buyer; requires input.funds.price == self.price\n requires input.contribution <= self.price\n calculate: [{ target: credit, op: minimum, values: [{ field: self.held.balance }, { field: input.contribution }] }, { target: refund, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.credit }] }]\n set: { dispositionAt: { field: self.now } }\n moves self.credit from self.held to input.funds.held economics { purpose: principal, sourceParty: programOperator }\n moves self.refund from self.held to self.buyer economics { purpose: principal, sourceParty: programOperator }\n }\n action cancel { allowZero: true,\n from: active, to: cancelled, actor: { party: buyer }, input { reason: text }\n calculate: [{ target: refund, op: rate, base: { field: self.held.balance }, bps: { literal: cancellation_refund }, rounding: floor }, { target: retained, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.refund }] }]\n set: { reason: { field: input.reason }, dispositionAt: { field: self.now } }\n moves self.refund from self.held to self.buyer economics { purpose: principal, sourceParty: programOperator }; moves self.retained from self.held to retained_to economics { recipient: retained_to, company: { purpose: earning, sourceParty: buyer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action seller_cancel {\n from: active, to: cancelled, actor: { party: seller }, input { reason: text }\n set: { reason: { field: input.reason }, dispositionAt: { field: self.now } }\n moves self.held.balance from self.held to self.buyer economics { purpose: principal, sourceParty: programOperator }\n }\n action operator_cancel {\n from: active, to: cancelled, actor: { party: operator }, input { reason: text }\n set: { reason: { field: input.reason }, dispositionAt: { field: self.now } }\n moves self.held.balance from self.held to self.buyer economics { purpose: principal, sourceParty: programOperator }\n }\n action withdraw { from: proposed, to: cancelled, actor: { party: buyer } }\n action expire { allowZero: true,\n from: active, to: expired, actor: clock, due: { at: self.expiresAt }\n calculate: [{ target: refund, op: rate, base: { field: self.held.balance }, bps: { literal: expiry_refund }, rounding: floor }, { target: retained, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.refund }] }]\n set: { dispositionAt: { field: self.now } }\n moves self.refund from self.held to self.buyer economics { purpose: principal, sourceParty: programOperator }; moves self.retained from self.held to retained_to economics { recipient: retained_to, company: { purpose: earning, sourceParty: buyer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action expire_proposal { from: proposed, to: expired, actor: clock, due: { at: self.proposalExpiresAt } }\n}\n"],
11
- ["money.hsx", "header money\n\n// Economics: Held funding and returns are principal. Release to the company realizes\n// earnings; release to another participant passes the payer's cash through. Generic transfers, splits,\n// schedules, swaps, boundary payouts and metered fees retain no assumed purpose.\n\n// Expose each attachment's create and caller actions explicitly. A transfer or\n// split pays once; a hold exposes fund, release and refund separately. Release\n// pays payee and refund returns payer. A hold has no dispute or damage decision.\n// The payee proposes a schedule, which creates its count occurrences, and only\n// the payer activates or cancels it. Each due occurrence pays only while the\n// schedule is active. A due time promises no retry.\n// A pool accepts whole contributions only up to its remaining target and at most\n// 366 paid records. Expose pay to release the exact target. Clock failure refunds\n// original contributors; excess acceptance and partial contribution are absent.\n// A swap reserves both legs before exchange or voids reservations on expiry.\n// Payout instruct reserves across the selected adapter; confirm/reject require\n// matching terminal instruction evidence. An acknowledgement cannot settle it.\n// Metered bill charges a unique usage identity at the fixed unit price, only\n// under an active mandate the payer created: bills stop at its expiresAt, and at\n// most 366 billed events across every metered attachment on the mandate may sum\n// their payer debit, buyer fee and tax included, to its limit. The payer revokes\n// it to stop billing. Only the payee cancels its own unbilled usage.\n\n// Cost: transfer.pay declares one transfer. Hold.create declares one owned account;\n// fund, release and refund each declare one transfer. Schedules and pools add bounded\n// child invocations. Run hsx cost on the composed program for counts, not riyal prices.\n\ninstrument transfer(payer: party, payee: party, amount: money = runtime) {\n summary: \"One transfer between the bound parties.\"\n fields { amount: money = amount }\n lifecycle { states: [pending, paid, cancelled], initial: pending }\n action create { actor: { party: payer }, requires self.amount > \"0\" }\n action pay {\n from: pending, to: paid, actor: { party: payer }\n moves self.amount from payer to payee\n }\n action cancel { from: pending, to: cancelled, actor: { party: payer } }\n}\n\ninstrument hold(payer: party, payee: party, amount: money = runtime) {\n summary: \"Hold the declared amount until release or refund.\"\n fields { payer: account of payer, payee: account of payee, amount: money = amount, price: money = self.amount, held: account of self }\n lifecycle { states: [pending, funded, released, refunded, cancelled], initial: pending }\n action create { }\n action fund {\n from: pending, to: funded, actor: { party: payer }\n moves self.amount from payer to self.held economics { purpose: principal, sourceParty: payer }\n }\n action confirm {\n from: pending, to: funded\n requires self.held.balance == self.amount\n }\n action release {\n from: funded, to: released, actor: { party: payer }\n moves self.amount from self.held to payee economics { recipient: payee, company: { purpose: earning, sourceParty: payer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action refund {\n from: funded, to: refunded, actor: { party: payee }\n moves self.amount from self.held to payer economics { purpose: principal, sourceParty: programOperator }\n }\n action cancel { from: pending, to: cancelled }\n}\n\ninstrument split(payer: party, amount: money = runtime, shares: split = { programOperator: 100% }) {\n summary: \"Split one amount; the last declared recipient receives the rounding remainder.\"\n fields { amount: money = amount }\n lifecycle { states: [pending, paid, cancelled], initial: pending }\n action create {}\n action pay { allowZero: true, requires self.amount > \"0\"; from: pending, to: paid, actor: { party: payer }, moves self.amount from payer shares shares }\n action cancel { from: pending, to: cancelled }\n}\n\ninstrument schedule(payer: party, payee: party, amount: money = runtime, count: integer(1, 366) = 12) {\n summary: \"A finite schedule whose dated pieces sum exactly to the declared total.\"\n fields { amount: money = amount, count: integer = count, dates: list(date, count) }\n lifecycle { states: [draft, active, complete, cancelled], initial: draft }\n action create {\n actor: { party: payee }\n invoke: [{ range: { count: { literal: count }, maximum: count, bind: position }, instrument: occurrence, action: create, input: { schedule: { field: self.id }, position: { field: position } } }]\n }\n action activate { from: draft, to: active, actor: { party: payer } }\n action complete {\n from: active, to: complete\n requires count of { instrument: occurrence, reference: \"schedule\", anchor: self.id, states: [pending], limit: 366 } == 0\n }\n action cancel { from: [draft, active], to: cancelled, actor: { party: payer } }\n records {\n occurrence: {\n fields {\n schedule: ref<parent>, position: integer(1, count), dueAt: date = at(self.schedule.dates, self.position)\n base: money = divide(self.schedule.amount, count)\n allocated: money = multiply(self.base, count)\n remainder: money = subtract(self.schedule.amount, self.allocated)\n first: integer = divide(1, self.position)\n adjustment: money = multiply(self.remainder, self.first)\n amount: money = sum(self.base, self.adjustment)\n }\n lifecycle { states: [pending, paid, cancelled], initial: pending }\n action create { actor: { parent: parent }, input { schedule: ref<parent>, position: integer(1, count) }, requires unique \"scheduled_position\" on [self.schedule, self.position] }\n action pay { allowZero: true, from: pending, to: paid, actor: clock, due: { at: self.dueAt }, requires self.schedule in [active], moves self.amount from payer to payee }\n action cancel { from: pending, to: cancelled, requires self.schedule in [cancelled] }\n }\n }\n}\n\ninstrument pool(payer: party, payee: party, target: money, closes: date) {\n summary: \"Contributions fund one threshold or return to their original contributor.\"\n fields { target: money = target, closesAt: date = closes, held: account of self }\n lifecycle { states: [open, paid, failed], initial: open }\n action create { }\n action pay {\n from: open, to: paid, actor: { party: payee }\n requires self.held.balance == self.target\n moves self.target from self.held to payee economics { recipient: payee, company: { purpose: earning, sourceParty: payer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action fail {\n from: open, to: failed, actor: clock, due: { at: self.closesAt }\n requires self.held.balance < self.target\n invoke: [{ selection: { instrument: contribution, reference: \"pool\", anchor: self.id, states: [paid], limit: 366 }, action: refund, input: {} }]\n }\n records {\n contribution: {\n fields { pool: ref<parent>, payer: account of payer, amount: money, remaining: money? }\n lifecycle { states: [pending, paid, refunded], initial: pending }\n invariants count of { instrument: current(), reference: \"pool\", anchor: self.pool, states: [paid], limit: 366 } <= 366\n action create { requires self.pool in [open] }\n action pay { from: pending, to: paid, actor: { party: payer }, deadline: { at: self.pool.closesAt }, requires self.pool in [open], calculate: [{ target: remaining, op: subtract, base: { field: self.pool.target }, subtract: [{ field: self.pool.held.balance }] }], requires self.amount <= self.remaining, moves self.amount from self.payer to self.pool.held economics { purpose: principal, sourceParty: payer } }\n action refund { from: paid, to: refunded, actor: { parent: parent }, moves self.amount from self.pool.held to self.payer economics { purpose: principal, sourceParty: programOperator } }\n }\n }\n}\n\ninstrument swap(first: party, second: party, first_amount: money, second_amount: money, expires: date) {\n summary: \"Two reservations settle together or both return.\"\n fields { firstAmount: money = first_amount, secondAmount: money = second_amount, expiresAt: date = expires, firstReceipt: text?, secondReceipt: text? }\n lifecycle { states: [pending, first_ready, second_ready, both_ready, exchanged, cancelled], initial: pending }\n action create {}\n action fund_first { from: pending, to: first_ready, actor: { party: first }, deadline: { at: self.expiresAt }, moves reserve self.firstAmount from first to second capture \"firstReceipt\" }\n action fund_second { from: first_ready, to: both_ready, actor: { party: second }, deadline: { at: self.expiresAt }, moves reserve self.secondAmount from second to first capture \"secondReceipt\" }\n action start_second { from: pending, to: second_ready, actor: { party: second }, deadline: { at: self.expiresAt }, moves reserve self.secondAmount from second to first capture \"secondReceipt\" }\n action finish_first { from: second_ready, to: both_ready, actor: { party: first }, deadline: { at: self.expiresAt }, moves reserve self.firstAmount from first to second capture \"firstReceipt\" }\n action expire_second { from: second_ready, to: cancelled, actor: clock, due: { at: self.expiresAt }, moves void self.secondReceipt }\n action exchange { from: both_ready, to: exchanged, actor: { party: first }, moves post self.firstReceipt; moves post self.secondReceipt }\n action cancel { from: pending, to: cancelled }\n action expire_first { from: first_ready, to: cancelled, actor: clock, due: { at: self.expiresAt }, moves void self.firstReceipt }\n action expire_both { from: both_ready, to: cancelled, actor: clock, due: { at: self.expiresAt }, moves void self.firstReceipt; moves void self.secondReceipt }\n}\n\ninstrument payout(payer: party, payee: party, adapter: text, amount: money = runtime) {\n summary: \"Pay the recipient when the provider confirms settlement.\"\n fields { amount: money = amount }\n lifecycle { states: [pending, instructed, settled, rejected], initial: pending }\n action create {}\n action instruct {\n from: pending, to: instructed, actor: { party: payer }\n moves reserve self.amount from payer to payee boundary adapter\n }\n action confirm {\n from: instructed, to: settled\n moves post instruct\n }\n action reject {\n from: instructed, to: rejected\n moves void instruct\n }\n}\n\ninstrument mandate(payer: party, payee: party) {\n summary: \"A payer's permission for one payee to charge up to a total until it expires.\"\n fields { payer: account of payer, payee: account of payee, limit: money, expiresAt: date }\n lifecycle { states: [active, revoked], initial: active }\n action create { actor: { party: payer }, requires self.limit > \"0\" }\n action revoke { from: active, to: revoked, actor: { party: payer } }\n}\n\ninstrument metered(payer: party, payee: party, unit_price: money, units: integer = 1, fee: fee = { seller: 0% }, mandate: ref<money.mandate> = object(money.mandate)) {\n summary: \"A unique usage event priced once at the fixed unit price.\"\n fields { usageIdentity: text, mandate: ref<mandate>, payer: account of payer, payee: account of payee, unitPrice: money = unit_price, units: integer = units, amount: money = multiply(self.unitPrice, self.units) }\n lifecycle { states: [recorded, billed, cancelled], initial: recorded }\n invariants sum \"bill_move1_debit\" of { instrument: all(money.metered), reference: \"mandate\", anchor: self.mandate, states: [billed], limit: 366 } <= self.mandate.limit\n action create { requires unique \"usage_event\" on [self.usageIdentity]; requires self.mandate.payer == self.payer; requires self.mandate.payee == self.payee }\n action bill { allowZero: true, requires self.amount > \"0\"; from: recorded, to: billed, actor: { party: payee }, deadline: { at: self.mandate.expiresAt }, requires self.mandate in [active], moves self.amount from payer to payee fee fee }\n action cancel { from: recorded, to: cancelled, actor: { party: payee } }\n}\n"],
11
+ ["money.hsx", "header money\n\n// Economics: Held funding and returns are principal. Release to the company realizes\n// earnings; release to another participant passes the payer's cash through. A late\n// fee charge is the same: earnings for the company, pass-through for another payee.\n// Generic transfers, splits, schedules, swaps, boundary payouts and metered fees\n// retain no assumed purpose.\n\n// Expose each attachment's create and caller actions explicitly. A transfer or\n// split pays once; a hold exposes fund, release and refund separately. Release\n// pays payee and refund returns payer. released_by runs release and defaults to\n// payee, so a shop that is payee keeps a deposit without acting for its customer.\n// Bind released_by: payer for an escrow-style hold that only the payer releases.\n// Only the payee refunds. A hold has no dispute or damage decision.\n// The payee proposes a schedule, which creates its count occurrences, and only\n// the payer activates or cancels it. Each due occurrence pays only while the\n// schedule is active. A due time promises no retry.\n// A pool accepts whole contributions only up to its remaining target and at most\n// 366 paid records. Expose pay to release the exact target. Clock failure refunds\n// original contributors; excess acceptance and partial contribution are absent.\n// A swap reserves both legs before exchange or voids reservations on expiry.\n// Payout instruct reserves across the selected adapter; confirm/reject require\n// matching terminal instruction evidence. An acknowledgement cannot settle it.\n// Metered bill charges a unique usage identity at the fixed unit price, only\n// under an active mandate the payer created: bills stop at its expiresAt, and at\n// most 366 billed events across every metered attachment on the mandate may sum\n// their payer debit, buyer fee and tax included, to its limit. The payer revokes\n// it to stop billing. Only the payee cancels its own unbilled usage.\n// The payer creates a late fee against its dueAt, which rename can bind to the\n// record's own due field. Once dueAt plus grace plus one period has passed, the\n// clock charges amount from payer to payee for each whole period, and the last\n// charge takes only what is left under cap; then the fee is capped. The payee runs\n// stop when the obligation is met, which ends charging. A charge the payer cannot\n// fund refuses as clock work and charging waits for its retry. Grace is at least\n// one second; there are no percentage or interest-style fees.\n\n// Cost: transfer.pay declares one transfer. Hold.create declares one owned account;\n// fund, release and refund each declare one transfer. Schedules and pools add bounded\n// child invocations. Each late fee charge declares one transfer, and cap may be at most\n// 366 times amount. Run hsx cost on the composed program for counts, not riyal prices.\n\ninstrument transfer(payer: party, payee: party, amount: money = runtime) {\n summary: \"One transfer between the bound parties.\"\n fields { amount: money = amount }\n lifecycle { states: [pending, paid, cancelled], initial: pending }\n action create { actor: { party: payer }, requires self.amount > \"0\" }\n action pay {\n from: pending, to: paid, actor: { party: payer }\n moves self.amount from payer to payee\n }\n action cancel { from: pending, to: cancelled, actor: { party: payer } }\n}\n\ninstrument hold(payer: party, payee: party, amount: money = runtime, released_by: party = payee) {\n summary: \"Hold the declared amount until release or refund.\"\n fields { payer: account of payer, payee: account of payee, amount: money = amount, price: money = self.amount, held: account of self }\n lifecycle { states: [pending, funded, released, refunded, cancelled], initial: pending }\n action create { }\n action fund {\n from: pending, to: funded, actor: { party: payer }\n moves self.amount from payer to self.held economics { purpose: principal, sourceParty: payer }\n }\n action confirm {\n from: pending, to: funded\n requires self.held.balance == self.amount\n }\n action release {\n from: funded, to: released, actor: { party: released_by }\n moves self.amount from self.held to payee economics { recipient: payee, company: { purpose: earning, sourceParty: payer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action refund {\n from: funded, to: refunded, actor: { party: payee }\n moves self.amount from self.held to payer economics { purpose: principal, sourceParty: programOperator }\n }\n action cancel { from: pending, to: cancelled }\n}\n\ninstrument split(payer: party, amount: money = runtime, shares: split = { programOperator: 100% }) {\n summary: \"Split one amount; the last declared recipient receives the rounding remainder.\"\n fields { amount: money = amount }\n lifecycle { states: [pending, paid, cancelled], initial: pending }\n action create {}\n action pay { allowZero: true, requires self.amount > \"0\"; from: pending, to: paid, actor: { party: payer }, moves self.amount from payer shares shares }\n action cancel { from: pending, to: cancelled }\n}\n\ninstrument schedule(payer: party, payee: party, amount: money = runtime, count: integer(1, 366) = 12) {\n summary: \"A finite schedule whose dated pieces sum exactly to the declared total.\"\n fields { amount: money = amount, count: integer = count, dates: list(date, count) }\n lifecycle { states: [draft, active, complete, cancelled], initial: draft }\n action create {\n actor: { party: payee }\n invoke: [{ range: { count: { literal: count }, maximum: count, bind: position }, instrument: occurrence, action: create, input: { schedule: { field: self.id }, position: { field: position } } }]\n }\n action activate { from: draft, to: active, actor: { party: payer } }\n action complete {\n from: active, to: complete\n requires count of { instrument: occurrence, reference: \"schedule\", anchor: self.id, states: [pending], limit: 366 } == 0\n }\n action cancel { from: [draft, active], to: cancelled, actor: { party: payer } }\n records {\n occurrence: {\n fields {\n schedule: ref<parent>, position: integer(1, count), dueAt: date = at(self.schedule.dates, self.position)\n base: money = divide(self.schedule.amount, count)\n allocated: money = multiply(self.base, count)\n remainder: money = subtract(self.schedule.amount, self.allocated)\n first: integer = divide(1, self.position)\n adjustment: money = multiply(self.remainder, self.first)\n amount: money = sum(self.base, self.adjustment)\n }\n lifecycle { states: [pending, paid, cancelled], initial: pending }\n action create { actor: { parent: parent }, input { schedule: ref<parent>, position: integer(1, count) }, requires unique \"scheduled_position\" on [self.schedule, self.position] }\n action pay { allowZero: true, from: pending, to: paid, actor: clock, due: { at: self.dueAt }, requires self.schedule in [active], moves self.amount from payer to payee }\n action cancel { from: pending, to: cancelled, requires self.schedule in [cancelled] }\n }\n }\n}\n\ninstrument pool(payer: party, payee: party, target: money, closes: date) {\n summary: \"Contributions fund one threshold or return to their original contributor.\"\n fields { target: money = target, closesAt: date = closes, held: account of self }\n lifecycle { states: [open, paid, failed], initial: open }\n action create { }\n action pay {\n from: open, to: paid, actor: { party: payee }\n requires self.held.balance == self.target\n moves self.target from self.held to payee economics { recipient: payee, company: { purpose: earning, sourceParty: payer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action fail {\n from: open, to: failed, actor: clock, due: { at: self.closesAt }\n requires self.held.balance < self.target\n invoke: [{ selection: { instrument: contribution, reference: \"pool\", anchor: self.id, states: [paid], limit: 366 }, action: refund, input: {} }]\n }\n records {\n contribution: {\n fields { pool: ref<parent>, payer: account of payer, amount: money, remaining: money? }\n lifecycle { states: [pending, paid, refunded], initial: pending }\n invariants count of { instrument: current(), reference: \"pool\", anchor: self.pool, states: [paid], limit: 366 } <= 366\n action create { requires self.pool in [open] }\n action pay { from: pending, to: paid, actor: { party: payer }, deadline: { at: self.pool.closesAt }, requires self.pool in [open], calculate: [{ target: remaining, op: subtract, base: { field: self.pool.target }, subtract: [{ field: self.pool.held.balance }] }], requires self.amount <= self.remaining, moves self.amount from self.payer to self.pool.held economics { purpose: principal, sourceParty: payer } }\n action refund { from: paid, to: refunded, actor: { parent: parent }, moves self.amount from self.pool.held to self.payer economics { purpose: principal, sourceParty: programOperator } }\n }\n }\n}\n\ninstrument swap(first: party, second: party, first_amount: money, second_amount: money, expires: date) {\n summary: \"Two reservations settle together or both return.\"\n fields { firstAmount: money = first_amount, secondAmount: money = second_amount, expiresAt: date = expires, firstReceipt: text?, secondReceipt: text? }\n lifecycle { states: [pending, first_ready, second_ready, both_ready, exchanged, cancelled], initial: pending }\n action create {}\n action fund_first { from: pending, to: first_ready, actor: { party: first }, deadline: { at: self.expiresAt }, moves reserve self.firstAmount from first to second capture \"firstReceipt\" }\n action fund_second { from: first_ready, to: both_ready, actor: { party: second }, deadline: { at: self.expiresAt }, moves reserve self.secondAmount from second to first capture \"secondReceipt\" }\n action start_second { from: pending, to: second_ready, actor: { party: second }, deadline: { at: self.expiresAt }, moves reserve self.secondAmount from second to first capture \"secondReceipt\" }\n action finish_first { from: second_ready, to: both_ready, actor: { party: first }, deadline: { at: self.expiresAt }, moves reserve self.firstAmount from first to second capture \"firstReceipt\" }\n action expire_second { from: second_ready, to: cancelled, actor: clock, due: { at: self.expiresAt }, moves void self.secondReceipt }\n action exchange { from: both_ready, to: exchanged, actor: { party: first }, moves post self.firstReceipt; moves post self.secondReceipt }\n action cancel { from: pending, to: cancelled }\n action expire_first { from: first_ready, to: cancelled, actor: clock, due: { at: self.expiresAt }, moves void self.firstReceipt }\n action expire_both { from: both_ready, to: cancelled, actor: clock, due: { at: self.expiresAt }, moves void self.firstReceipt; moves void self.secondReceipt }\n}\n\ninstrument payout(payer: party, payee: party, adapter: text, amount: money = runtime) {\n summary: \"Pay the recipient when the provider confirms settlement.\"\n fields { amount: money = amount }\n lifecycle { states: [pending, instructed, settled, rejected], initial: pending }\n action create {}\n action instruct {\n from: pending, to: instructed, actor: { party: payer }\n moves reserve self.amount from payer to payee boundary adapter\n }\n action confirm {\n from: instructed, to: settled\n moves post instruct\n }\n action reject {\n from: instructed, to: rejected\n moves void instruct\n }\n}\n\ninstrument mandate(payer: party, payee: party) {\n summary: \"A payer's permission for one payee to charge up to a total until it expires.\"\n fields { payer: account of payer, payee: account of payee, limit: money, expiresAt: date }\n lifecycle { states: [active, revoked], initial: active }\n action create { actor: { party: payer }, requires self.limit > \"0\" }\n action revoke { from: active, to: revoked, actor: { party: payer } }\n}\n\ninstrument metered(payer: party, payee: party, unit_price: money, units: integer = 1, fee: fee = { seller: 0% }, mandate: ref<money.mandate> = object(money.mandate)) {\n summary: \"A unique usage event priced once at the fixed unit price.\"\n fields { usageIdentity: text, mandate: ref<mandate>, payer: account of payer, payee: account of payee, unitPrice: money = unit_price, units: integer = units, amount: money = multiply(self.unitPrice, self.units) }\n lifecycle { states: [recorded, billed, cancelled], initial: recorded }\n invariants sum \"bill_move1_debit\" of { instrument: all(money.metered), reference: \"mandate\", anchor: self.mandate, states: [billed], limit: 366 } <= self.mandate.limit\n action create { requires unique \"usage_event\" on [self.usageIdentity]; requires self.mandate.payer == self.payer; requires self.mandate.payee == self.payee }\n action bill { allowZero: true, requires self.amount > \"0\"; from: recorded, to: billed, actor: { party: payee }, deadline: { at: self.mandate.expiresAt }, requires self.mandate in [active], moves self.amount from payer to payee fee fee }\n action cancel { from: recorded, to: cancelled, actor: { party: payee } }\n}\n\ninstrument late_fee(payer: party, payee: party, amount: money, cap: money, period: duration = 1d, grace: duration = 1h) {\n summary: \"Charge a fixed fee for each period a due time stays unmet, up to a cap.\"\n fields {\n payer: account of payer, payee: account of payee, amount: money = amount, cap: money = cap, ceiling: money = multiply(self.amount, 366)\n dueAt: date, graceEndsAt: date?, firstAt: date?, nextAt: date?, followingAt: date?, charge: money?, left: money?, remaining: money?\n }\n lifecycle { states: [running, capped, stopped], initial: running }\n action create {\n actor: { party: payer }\n requires self.amount > \"0\"\n requires self.cap >= self.amount\n requires self.cap <= self.ceiling\n calculate: [{ target: graceEndsAt, op: shift, date: { field: self.dueAt }, milliseconds: { literal: grace }, direction: after }, { target: firstAt, op: shift, date: { field: self.graceEndsAt }, milliseconds: { literal: period }, direction: after }]\n set: { nextAt: { field: self.firstAt }, left: { field: self.cap } }\n }\n action charge {\n summary: \"Charge late fee\"\n from: running, to: running, actor: clock, due: { at: self.nextAt }\n calculate: [{ target: charge, op: minimum, values: [{ field: self.amount }, { field: self.left }] }, { target: remaining, op: subtract, base: { field: self.left }, subtract: [{ field: self.charge }] }, { target: followingAt, op: shift, date: { field: self.nextAt }, milliseconds: { literal: period }, direction: after }]\n set: { left: { field: self.remaining }, nextAt: { field: self.followingAt } }\n moves self.charge from payer to payee economics { recipient: payee, company: { purpose: earning, sourceParty: payer }, participant: { purpose: pass_through, sourceParty: payer } }\n invoke: [{ selection: { instrument: current(), reference: \"payer\", anchor: self.payer, states: [running], limit: 1, where: { id: { field: self.id }, left: { literal: \"0\" } } }, action: finish, input: {} }]\n }\n action finish { from: running, to: capped, actor: { parent: current() } }\n action stop { from: running, to: stopped, actor: { party: payee } }\n}\n"],
12
12
  ["purchase.hsx", "header purchase\n\n// A financed purchase connects a repayment plan, a delivery hold and optional\n// marketplace reservations. The hold blocks refunds while checkout is active.\n// Debt cancellation returns outstanding capital before the buyer's own cash.\ninstrument checkout(plans: ref<financing.installments>[], funds: ref<escrow.hold>, borrower: party, capital: party = programOperator) {\n summary: \"Fund a purchase and return lender capital before refunding the buyer.\"\n fields {\n funds: ref<funds>, borrower: account of borrower\n downPaymentCredit: money?, downPaymentRemaining: money?\n }\n lifecycle { states: [pending, active, closed], initial: pending }\n action create { actor: { party: borrower } }\n action check {\n from: pending, to: pending, actor: { parent: plans }\n input { plan: ref<plans> }\n requires input.plan.funds == self.id\n requires input.plan.borrower == self.borrower\n requires input.plan.borrower == self.funds.payer\n requires input.plan.price == self.funds.price\n }\n action collect { allowZero: true,\n from: pending, to: pending, actor: { parent: plans }\n input { plan: ref<plans> }\n requires input.plan.funds == self.id\n requires self.funds in [pending]\n calculate: [{ target: downPaymentCredit, op: minimum, values: [{ field: self.funds.held.balance }, { field: input.plan.downPayment }] }, { target: downPaymentRemaining, op: subtract, base: { field: input.plan.downPayment }, subtract: [{ field: self.downPaymentCredit }] }]\n moves self.downPaymentRemaining from self.borrower to self.funds.held economics { purpose: principal, sourceParty: borrower }\n }\n action disburse {\n from: pending, to: active, actor: { parent: plans }\n input { plan: ref<plans> }\n requires input.plan.funds == self.id\n requires self.funds in [pending]\n invoke: [{ selection: { instrument: all(marketplace.reservation), reference: \"funds\", anchor: self.funds, states: [active], limit: 1 }, action: credit, input: { funds: { field: self.funds }, contribution: { field: input.plan.downPayment } } }, { reference: self.id, action: fund, input: { plan: { field: input.plan } } }]\n }\n action fund { allowZero: true,\n from: active, to: active, actor: { parent: current() }\n input { plan: ref<plans> }\n calculate: [{ target: downPaymentCredit, op: minimum, values: [{ field: self.funds.held.balance }, { field: input.plan.downPayment }] }, { target: downPaymentRemaining, op: subtract, base: { field: input.plan.downPayment }, subtract: [{ field: self.downPaymentCredit }] }]\n moves self.downPaymentRemaining from self.borrower to self.funds.held economics { purpose: principal, sourceParty: borrower }\n moves input.plan.principal from input.plan.capital to self.funds.held economics { purpose: principal, sourceParty: capital }\n invoke: [{ reference: self.funds, action: confirm, input: {} }]\n }\n action write_off {\n from: active, to: active, actor: { parent: plans }\n input { plan: ref<plans> }\n requires input.plan.funds == self.id\n requires self.funds in [released]\n }\n action refund { allowZero: true,\n from: active, to: closed, actor: { parent: plans }\n input { plan: ref<plans>, principal: money }\n requires input.plan.funds == self.id\n requires self.funds in [return_verified]\n moves input.principal from self.funds.held to input.plan.capital economics { purpose: principal, sourceParty: capital }\n }\n action cancel_undelivered { allowZero: true,\n from: active, to: closed, actor: { parent: plans }\n input { plan: ref<plans> }\n requires input.plan.funds == self.id\n requires self.funds in [funded]\n moves input.plan.principal from self.funds.held to input.plan.capital economics { purpose: principal, sourceParty: capital }\n invoke: [{ reference: self.funds, action: finish_refund, input: {} }]\n }\n action return_paid {\n from: active, to: closed, actor: { parent: plans }\n input { plan: ref<plans> }\n requires input.plan.funds == self.id\n requires self.funds in [return_verified]\n invoke: [{ reference: self.funds, action: finish_refund, input: {} }]\n }\n action unwind_paid_undelivered {\n from: active, to: closed, actor: { parent: plans }\n input { plan: ref<plans> }\n requires input.plan.funds == self.id\n requires self.funds in [funded]\n requires self.funds.deliverBy < self.now\n invoke: [{ reference: self.funds, action: finish_refund, input: {} }]\n }\n action unwind_paid {\n from: active, to: closed, actor: { parent: plans }\n input { plan: ref<plans> }\n requires input.plan.funds == self.id\n requires self.funds in [funded, return_verified]\n requires self.funds.deliverBy < self.now\n invoke: [{ reference: self.funds, action: finish_refund, input: {} }]\n }\n}\n"],
13
13
  ["rental.hsx", "header rental\n\n// One hire per security agreement, including ended hires.\n// Pickup makes hire payable to the operator; cancellation before pickup refunds both holds.\ninstrument hire_charge(renter: party, security: ref<rental.deposit>) {\n fields { security: ref<security>, held: account of self }\n lifecycle { states: [pending, funded, released, cancelled], initial: pending }\n action create {\n actor: { party: renter }\n requires count of { instrument: current(), reference: \"security\", anchor: self.security, states: [pending, funded, released, cancelled], limit: 1 } == 0\n }\n action fund {\n from: pending, to: funded, actor: { party: renter }\n requires self.security in [pending, funded, hired, returned]\n moves 250 SAR from renter to self.held economics { purpose: principal, sourceParty: renter }\n }\n action release {\n from: funded, to: released, actor: { party: renter }\n requires self.security in [hired, returned]\n moves self.held.balance from self.held to programOperator economics { purpose: earning, sourceParty: renter }\n }\n action refund { allowZero: true,\n from: [pending, funded], to: cancelled, actor: { parent: security }\n moves self.held.balance from self.held to renter economics { purpose: principal, sourceParty: programOperator }\n }\n action cancel {\n from: [pending, funded], to: preserve, actor: { party: renter }\n invoke: [{ reference: self.security, action: cancel, input: {} }]\n }\n}\n\n// Security stays refundable. Only the operator records pickup and damage.\ninstrument deposit(renter: party, hire: ref<rental.hire_charge>) {\n summary: \"Refund rental security on return, less an authorized damage amount.\"\n fields { renter: account of renter, held: account of self, amount: money = subject.price, refund: money? }\n lifecycle { states: [pending, funded, hired, returned, cancelled], initial: pending }\n action create { actor: { party: renter }, subject { price: money }, requires self.amount > \"0\" }\n action fund {\n from: pending, to: funded, actor: { party: renter }\n moves self.amount from self.renter to self.held economics { purpose: principal, sourceParty: renter }\n }\n action pickup { from: funded, to: hired, actor: { party: programOperator } }\n action return {\n from: hired, to: returned, actor: { party: programOperator }\n input { returnReference: text }\n moves self.held.balance from self.held to self.renter economics { purpose: principal, sourceParty: programOperator }\n }\n action withhold { allowZero: true,\n from: hired, to: returned, actor: { party: programOperator }\n input { damage: money, damageReference: text }\n requires input.damage > \"0\"\n requires input.damage <= self.held.balance\n calculate: [{ target: refund, op: subtract, base: { field: self.held.balance }, subtract: [{ field: input.damage }] }]\n moves input.damage from self.held to programOperator economics { purpose: earning, sourceParty: renter }\n moves self.refund from self.held to self.renter economics { purpose: principal, sourceParty: programOperator }\n }\n action refund_before_pickup { allowZero: true,\n from: [pending, funded], to: cancelled, actor: { party: renter }\n moves self.held.balance from self.held to self.renter economics { purpose: principal, sourceParty: programOperator }\n invoke: [{ selection: { instrument: hire, reference: \"security\", anchor: self.id, states: [pending, funded], limit: 1 }, action: refund, input: {} }]\n }\n action cancel { allowZero: true,\n from: [pending, funded], to: cancelled, actor: { party: renter }\n moves self.held.balance from self.held to self.renter economics { purpose: principal, sourceParty: programOperator }\n invoke: [{ selection: { instrument: hire, reference: \"security\", anchor: self.id, states: [pending, funded], limit: 1 }, action: refund, input: {} }]\n }\n}\n\n"],
14
14
  ["reporting.hsx", "header reporting\n\n// Attach portfolio to one or more financing plans. Its only lifecycle action is\n// create; reports use the declared report request/read roles, not a money action.\n// Aging selects active facilities and includes earned profit when deciding arrears.\n// The default-rate report measures period-end stock, not new default incidence.\n// Paid facilities are excluded and write-offs counted separately. Amounts are riyal\n// minor units; declared scale and rounding govern ratios. Missing identity joins\n// or unreconciled schedule counts refuse.\n\n// Cost: portfolio.create declares no transfers, owned accounts or invocations.\n// That zero instruction count does not price report capture, rendering, storage or\n// release. The host owns those charges and their execution.\n\ninstrument portfolio(on: ref<financing.installments>[], default_days: integer(1, 3650) = 90, retention_years: integer(1, 100) = 10, aging_first_days: integer(1, 3650) = 30, aging_second_days: integer(1, 3650) = 60, aging_third_days: integer(1, 3650) = 90, ratio_scale: integer(1, 1000000) = 10000, ratio_rounding: enum(floor, halfUp) = floor) {\n summary: \"Declared financing reports evaluated over frozen Product facts.\"\n fields {}\n lifecycle { states: [declared], initial: declared }\n action create {}\n constraints { aging_first_days: less_than(aging_second_days), aging_second_days: less_than(aging_third_days) }\n reports: [\n {\n identity: { id: \"portfolio_aging\", version: 1, description: \"Period-end outstanding principal by oldest unpaid installment. Remaining scheduled profit is distinct from accrued profit. Restructuring evidence is unavailable.\" },\n scope: { kind: \"product\", classification: \"internal\", currency: \"SAR\" },\n datasets: [\n {\n id: \"facilities\",\n source: \"instrument\",\n instruments: on,\n rowKey: \"facilityId\",\n columns: [\n {\n name: \"facilityId\",\n field: \"id\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"borrowerAccount\",\n field: \"borrower\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"state\",\n field: \"status\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"originalPrincipal\",\n field: \"principal\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n },\n {\n name: \"scheduleCount\",\n field: \"months\",\n type: { kind: \"integer\" },\n required: true\n },\n {\n name: \"recordedCreation\",\n field: \"createdAt\",\n type: { kind: \"date\" },\n required: true\n }\n ],\n expressions: [\n {\n id: \"activeState\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"active\"\n },\n {\n id: \"paidState\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"paid\"\n },\n {\n id: \"writtenState\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"written_off\"\n },\n { id: \"active\", op: \"equal\", left: \"state\", right: \"activeState\" },\n { id: \"paid\", op: \"equal\", left: \"state\", right: \"paidState\" },\n { id: \"writtenOff\", op: \"equal\", left: \"state\", right: \"writtenState\" },\n { id: \"activeOrPaid\", op: \"or\", left: \"active\", right: \"paid\" },\n { id: \"financed\", op: \"or\", left: \"active\", right: \"writtenOff\" }\n ],\n selection: \"active\"\n },\n {\n id: \"schedule\",\n source: \"instrument\",\n instruments: child(on, slice),\n rowKey: \"sliceId\",\n columns: [\n {\n name: \"sliceId\",\n field: \"id\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"planId\",\n field: \"plan\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"due\",\n field: \"dueAt\",\n type: { kind: \"date\" },\n required: true\n },\n {\n name: \"principal\",\n field: \"principalReceivable.balance\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n },\n {\n name: \"profit\",\n field: \"profitReceivable.balance\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n },\n {\n name: \"earnedProfit\",\n field: \"profitEarned.balance\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n },\n {\n name: \"scheduledPrincipal\",\n field: \"principal\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n }\n ],\n expressions: [\n {\n id: \"zeroMoney\",\n op: \"literal\",\n type: { kind: \"money\", currency: \"SAR\" },\n value: \"0\"\n },\n {\n id: \"zeroDays\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: 0\n },\n { id: \"observed\", op: \"parameter\", name: \"observationAt\" },\n { id: \"scheduledOutstanding\", op: \"sum\", left: \"principal\", right: \"profit\" },\n { id: \"totalOutstanding\", op: \"sum\", left: \"scheduledOutstanding\", right: \"earnedProfit\" },\n { id: \"unpaid\", op: \"less\", left: \"zeroMoney\", right: \"totalOutstanding\" },\n { id: \"elapsed\", op: \"daysBetween\", left: \"due\", right: \"observed\" },\n { id: \"nonnegativeDays\", op: \"maximum\", left: \"elapsed\", right: \"zeroDays\" },\n { id: \"daysPastDue\", op: \"choose\", condition: \"unpaid\", yes: \"nonnegativeDays\", no: \"zeroDays\" }\n ]\n },\n {\n id: \"borrowerAccounts\",\n source: \"account\",\n instruments: [ ],\n rowKey: \"accountId\",\n columns: [\n {\n name: \"accountId\",\n field: \"id\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"participant\",\n field: \"ownerParticipantId\",\n type: { kind: \"text\" },\n required: false\n }\n ],\n expressions: [ ]\n },\n {\n id: \"borrowers\",\n source: \"identity\",\n instruments: [ ],\n rowKey: \"customerId\",\n columns: [\n {\n name: \"customerId\",\n field: \"id\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"participantId\",\n field: \"participantId\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"entityId\",\n field: \"entityId\",\n type: { kind: \"text\" },\n required: true\n }\n ],\n expressions: [ ]\n }\n ],\n time: { timezone: \"Asia/Riyadh\", boundary: \"startInclusiveEndExclusive\", observation: \"periodEnd\", history: \"retainedOnly\" },\n selection: { dataset: \"facilities\" },\n calculation: {\n joins: [\n {\n dataset: \"schedule\",\n local: \"facilityId\",\n foreign: \"planId\",\n cardinality: \"many\",\n missing: \"refuse\",\n aggregates: [\n { name: \"outstandingPrincipal\", op: \"sum\", value: \"principal\" },\n { name: \"remainingScheduledProfit\", op: \"sum\", value: \"profit\" },\n { name: \"scheduledPrincipalTotal\", op: \"sum\", value: \"scheduledPrincipal\" },\n { name: \"capturedScheduleCount\", op: \"count\" },\n { name: \"oldestUnpaidDays\", op: \"maximum\", value: \"daysPastDue\" }\n ]\n },\n {\n dataset: \"borrowerAccounts\",\n local: \"borrowerAccount\",\n foreign: \"accountId\",\n cardinality: \"one\",\n missing: \"refuse\",\n aggregates: [\n { name: \"borrowerParticipant\", op: \"minimum\", value: \"participant\" }\n ]\n },\n {\n dataset: \"borrowers\",\n local: \"borrowerParticipant\",\n foreign: \"participantId\",\n cardinality: \"one\",\n missing: \"refuse\",\n aggregates: [\n { name: \"borrowerEntity\", op: \"minimum\", value: \"entityId\" }\n ]\n }\n ],\n expressions: [\n {\n id: \"day0\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: 0\n },\n {\n id: \"day30\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: aging_first_days\n },\n {\n id: \"day60\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: aging_second_days\n },\n {\n id: \"day90\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: aging_third_days\n },\n {\n id: \"band0\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"current\"\n },\n {\n id: \"band30\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"first\"\n },\n {\n id: \"band60\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"second\"\n },\n {\n id: \"band90\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"third\"\n },\n {\n id: \"bandLate\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"later\"\n },\n { id: \"current\", op: \"atMost\", left: \"oldestUnpaidDays\", right: \"day0\" },\n { id: \"first\", op: \"atMost\", left: \"oldestUnpaidDays\", right: \"day30\" },\n { id: \"second\", op: \"atMost\", left: \"oldestUnpaidDays\", right: \"day60\" },\n { id: \"third\", op: \"atMost\", left: \"oldestUnpaidDays\", right: \"day90\" },\n { id: \"lateBand\", op: \"choose\", condition: \"third\", yes: \"band90\", no: \"bandLate\" },\n { id: \"secondBand\", op: \"choose\", condition: \"second\", yes: \"band60\", no: \"lateBand\" },\n { id: \"firstBand\", op: \"choose\", condition: \"first\", yes: \"band30\", no: \"secondBand\" },\n { id: \"agingBand\", op: \"choose\", condition: \"current\", yes: \"band0\", no: \"firstBand\" }\n ],\n groupBy: [ \"agingBand\" ],\n aggregates: [\n { name: \"facilities\", op: \"count\" },\n { name: \"principalMinor\", op: \"sum\", value: \"outstandingPrincipal\" },\n { name: \"scheduledProfitMinor\", op: \"sum\", value: \"remainingScheduledProfit\" }\n ],\n resultExpressions: [ ]\n },\n validation: {\n empty: \"noEligibleFacilities\",\n required: [ \"borrowerEntity\" ],\n reconcile: [ ],\n rowReconcile: [\n { left: \"originalPrincipal\", right: \"scheduledPrincipalTotal\" },\n { left: \"scheduleCount\", right: \"capturedScheduleCount\" }\n ],\n unavailableFacts: [ ],\n },\n output: {\n profile: \"internal.v1\",\n formats: [ \"json\", \"csv\" ],\n columns: [\n {\n name: \"agingBand\",\n label: \"agingBand\",\n type: { kind: \"text\" }\n },\n {\n name: \"facilities\",\n label: \"facilities\",\n type: { kind: \"integer\" }\n },\n {\n name: \"principalMinor\",\n label: \"principalMinor\",\n type: { kind: \"money\", currency: \"SAR\" }\n },\n {\n name: \"scheduledProfitMinor\",\n label: \"scheduledProfitMinor\",\n type: { kind: \"money\", currency: \"SAR\" }\n }\n ],\n sort: [ \"agingBand\" ]\n },\n authority: {\n request: [ \"owner\", \"finance\" ],\n read: [ \"owner\", \"admin\", \"operations\", \"finance\", \"viewer\" ],\n release: [ ],\n retention: { policy: \"report_replay\", years: retention_years }\n }\n },\n {\n identity: { id: \"period_end_outstanding_principal_default_rate\", version: 1, description: \"Current active facilities with any unpaid installment at least the declared default days past due, observed at period end. Cure when arrears clear. Count and outstanding-principal weighted rates in the declared scale exclude paid and written-off facilities; write-offs are counted separately. This is a stock measure, not a new-default incidence or origination cohort rate.\" },\n scope: { kind: \"product\", classification: \"internal\", currency: \"SAR\" },\n datasets: [\n {\n id: \"facilities\",\n source: \"instrument\",\n instruments: on,\n rowKey: \"facilityId\",\n columns: [\n {\n name: \"facilityId\",\n field: \"id\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"borrowerAccount\",\n field: \"borrower\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"state\",\n field: \"status\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"originalPrincipal\",\n field: \"principal\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n },\n {\n name: \"scheduleCount\",\n field: \"months\",\n type: { kind: \"integer\" },\n required: true\n },\n {\n name: \"recordedCreation\",\n field: \"createdAt\",\n type: { kind: \"date\" },\n required: true\n }\n ],\n expressions: [\n {\n id: \"activeState\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"active\"\n },\n {\n id: \"paidState\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"paid\"\n },\n {\n id: \"writtenState\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"written_off\"\n },\n { id: \"active\", op: \"equal\", left: \"state\", right: \"activeState\" },\n { id: \"paid\", op: \"equal\", left: \"state\", right: \"paidState\" },\n { id: \"writtenOff\", op: \"equal\", left: \"state\", right: \"writtenState\" },\n { id: \"activeOrPaid\", op: \"or\", left: \"active\", right: \"paid\" },\n { id: \"financed\", op: \"or\", left: \"active\", right: \"writtenOff\" }\n ],\n selection: \"financed\"\n },\n {\n id: \"schedule\",\n source: \"instrument\",\n instruments: child(on, slice),\n rowKey: \"sliceId\",\n columns: [\n {\n name: \"sliceId\",\n field: \"id\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"planId\",\n field: \"plan\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"due\",\n field: \"dueAt\",\n type: { kind: \"date\" },\n required: true\n },\n {\n name: \"principal\",\n field: \"principalReceivable.balance\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n },\n {\n name: \"profit\",\n field: \"profitReceivable.balance\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n },\n {\n name: \"earnedProfit\",\n field: \"profitEarned.balance\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n },\n {\n name: \"scheduledPrincipal\",\n field: \"principal\",\n type: { kind: \"money\", currency: \"SAR\" },\n required: true\n }\n ],\n expressions: [\n {\n id: \"zeroMoney\",\n op: \"literal\",\n type: { kind: \"money\", currency: \"SAR\" },\n value: \"0\"\n },\n {\n id: \"zeroDays\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: 0\n },\n { id: \"observed\", op: \"parameter\", name: \"observationAt\" },\n { id: \"scheduledOutstanding\", op: \"sum\", left: \"principal\", right: \"profit\" },\n { id: \"totalOutstanding\", op: \"sum\", left: \"scheduledOutstanding\", right: \"earnedProfit\" },\n { id: \"unpaid\", op: \"less\", left: \"zeroMoney\", right: \"totalOutstanding\" },\n { id: \"elapsed\", op: \"daysBetween\", left: \"due\", right: \"observed\" },\n { id: \"nonnegativeDays\", op: \"maximum\", left: \"elapsed\", right: \"zeroDays\" },\n { id: \"daysPastDue\", op: \"choose\", condition: \"unpaid\", yes: \"nonnegativeDays\", no: \"zeroDays\" }\n ]\n },\n {\n id: \"borrowerAccounts\",\n source: \"account\",\n instruments: [ ],\n rowKey: \"accountId\",\n columns: [\n {\n name: \"accountId\",\n field: \"id\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"participant\",\n field: \"ownerParticipantId\",\n type: { kind: \"text\" },\n required: false\n }\n ],\n expressions: [ ]\n },\n {\n id: \"borrowers\",\n source: \"identity\",\n instruments: [ ],\n rowKey: \"customerId\",\n columns: [\n {\n name: \"customerId\",\n field: \"id\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"participantId\",\n field: \"participantId\",\n type: { kind: \"text\" },\n required: true\n },\n {\n name: \"entityId\",\n field: \"entityId\",\n type: { kind: \"text\" },\n required: true\n }\n ],\n expressions: [ ]\n }\n ],\n time: { timezone: \"Asia/Riyadh\", boundary: \"startInclusiveEndExclusive\", observation: \"periodEnd\", history: \"retainedOnly\" },\n selection: { dataset: \"facilities\" },\n calculation: {\n joins: [\n {\n dataset: \"schedule\",\n local: \"facilityId\",\n foreign: \"planId\",\n cardinality: \"many\",\n missing: \"refuse\",\n aggregates: [\n { name: \"outstandingPrincipal\", op: \"sum\", value: \"principal\" },\n { name: \"remainingScheduledProfit\", op: \"sum\", value: \"profit\" },\n { name: \"scheduledPrincipalTotal\", op: \"sum\", value: \"scheduledPrincipal\" },\n { name: \"capturedScheduleCount\", op: \"count\" },\n { name: \"oldestUnpaidDays\", op: \"maximum\", value: \"daysPastDue\" }\n ]\n },\n {\n dataset: \"borrowerAccounts\",\n local: \"borrowerAccount\",\n foreign: \"accountId\",\n cardinality: \"one\",\n missing: \"refuse\",\n aggregates: [\n { name: \"borrowerParticipant\", op: \"minimum\", value: \"participant\" }\n ]\n },\n {\n dataset: \"borrowers\",\n local: \"borrowerParticipant\",\n foreign: \"participantId\",\n cardinality: \"one\",\n missing: \"refuse\",\n aggregates: [\n { name: \"borrowerEntity\", op: \"minimum\", value: \"entityId\" }\n ]\n }\n ],\n expressions: [\n {\n id: \"threshold\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: default_days\n },\n {\n id: \"zero\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: 0\n },\n {\n id: \"one\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: 1\n },\n {\n id: \"zeroMoney\",\n op: \"literal\",\n type: { kind: \"money\", currency: \"SAR\" },\n value: \"0\"\n },\n { id: \"pastThreshold\", op: \"atMost\", left: \"threshold\", right: \"oldestUnpaidDays\" },\n { id: \"isDefault\", op: \"and\", left: \"active\", right: \"pastThreshold\" },\n { id: \"activeCount\", op: \"choose\", condition: \"active\", yes: \"one\", no: \"zero\" },\n { id: \"defaultCount\", op: \"choose\", condition: \"isDefault\", yes: \"one\", no: \"zero\" },\n { id: \"writeOffCount\", op: \"choose\", condition: \"writtenOff\", yes: \"one\", no: \"zero\" },\n { id: \"activePrincipal\", op: \"choose\", condition: \"active\", yes: \"outstandingPrincipal\", no: \"zeroMoney\" },\n { id: \"defaultPrincipal\", op: \"choose\", condition: \"isDefault\", yes: \"outstandingPrincipal\", no: \"zeroMoney\" }\n ],\n groupBy: [ ],\n aggregates: [\n { name: \"activeFacilities\", op: \"sum\", value: \"activeCount\" },\n { name: \"defaultFacilities\", op: \"sum\", value: \"defaultCount\" },\n { name: \"writtenOffFacilities\", op: \"sum\", value: \"writeOffCount\" },\n { name: \"activePrincipalMinor\", op: \"sum\", value: \"activePrincipal\" },\n { name: \"defaultPrincipalMinor\", op: \"sum\", value: \"defaultPrincipal\" }\n ],\n resultExpressions: [\n { id: \"countRate\", op: \"ratio\", numerator: \"defaultFacilities\", denominator: \"activeFacilities\", scale: ratio_scale, rounding: ratio_rounding, zero: \"null\" },\n { id: \"principalRate\", op: \"ratio\", numerator: \"defaultPrincipalMinor\", denominator: \"activePrincipalMinor\", scale: ratio_scale, rounding: ratio_rounding, zero: \"null\" },\n {\n id: \"restructuringEvidence\",\n op: \"literal\",\n type: { kind: \"text\" },\n value: \"unavailable\"\n },\n {\n id: \"defaultDays\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: default_days\n },\n {\n id: \"rateScale\",\n op: \"literal\",\n type: { kind: \"integer\" },\n value: ratio_scale\n }\n ]\n },\n validation: {\n empty: \"refuse\",\n required: [ \"borrowerEntity\" ],\n reconcile: [ ],\n rowReconcile: [\n { left: \"originalPrincipal\", right: \"scheduledPrincipalTotal\" },\n { left: \"scheduleCount\", right: \"capturedScheduleCount\" }\n ],\n unavailableFacts: [ ],\n },\n output: {\n profile: \"internal.v1\",\n formats: [ \"json\", \"csv\" ],\n columns: [\n {\n name: \"activeFacilities\",\n label: \"activeFacilities\",\n type: { kind: \"integer\" }\n },\n {\n name: \"defaultFacilities\",\n label: \"defaultFacilities\",\n type: { kind: \"integer\" }\n },\n {\n name: \"writtenOffFacilities\",\n label: \"writtenOffFacilities\",\n type: { kind: \"integer\" }\n },\n {\n name: \"activePrincipalMinor\",\n label: \"activePrincipalMinor\",\n type: { kind: \"money\", currency: \"SAR\" }\n },\n {\n name: \"defaultPrincipalMinor\",\n label: \"defaultPrincipalMinor\",\n type: { kind: \"money\", currency: \"SAR\" }\n },\n {\n name: \"countRate\",\n label: \"countRate\",\n type: { kind: \"integer\" }\n },\n {\n name: \"principalRate\",\n label: \"principalRate\",\n type: { kind: \"integer\" }\n },\n {\n name: \"restructuringEvidence\",\n label: \"restructuringEvidence\",\n type: { kind: \"text\" }\n },\n {\n name: \"defaultDays\",\n label: \"defaultDays\",\n type: { kind: \"integer\" }\n },\n {\n name: \"rateScale\",\n label: \"rateScale\",\n type: { kind: \"integer\" }\n }\n ],\n sort: [ \"activeFacilities\" ]\n },\n authority: {\n request: [ \"owner\", \"finance\" ],\n read: [ \"owner\", \"admin\", \"operations\", \"finance\", \"viewer\" ],\n release: [ ],\n retention: { policy: \"report_replay\", years: retention_years }\n }\n }\n ]\n}\n"],
@@ -1 +1 @@
1
- {"version":3,"file":"std-bundle.js","sourceRoot":"","sources":["../../src/std-bundle.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,MAAM,CAAC,MAAM,iBAAiB,GAAgC,IAAI,GAAG,CAAiB;IACpF,CAAC,aAAa,EAAE,m7LAAm7L,CAAC;IACp8L,CAAC,WAAW,EAAE,6wMAA6wM,CAAC;IAC5xM,CAAC,iBAAiB,EAAE,qrNAAqrN,CAAC;IAC1sN,CAAC,YAAY,EAAE,mkOAAmkO,CAAC;IACnlO,CAAC,eAAe,EAAE,kinFAAkinF,CAAC;IACrjnF,CAAC,eAAe,EAAE,u8LAAu8L,CAAC;IAC19L,CAAC,aAAa,EAAE,03UAA03U,CAAC;IAC34U,CAAC,iBAAiB,EAAE,ggTAAggT,CAAC;IACrhT,CAAC,WAAW,EAAE,ogYAAogY,CAAC;IACnhY,CAAC,cAAc,EAAE,svJAAsvJ,CAAC;IACxwJ,CAAC,YAAY,EAAE,y1HAAy1H,CAAC;IACz2H,CAAC,eAAe,EAAE,4o1BAA4o1B,CAAC;IAC/p1B,CAAC,aAAa,EAAE,4hKAA4hK,CAAC;IAC7iK,CAAC,YAAY,EAAE,u8HAAu8H,CAAC;CACx9H,CAAC,CAAC"}
1
+ {"version":3,"file":"std-bundle.js","sourceRoot":"","sources":["../../src/std-bundle.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,MAAM,CAAC,MA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,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAiBD,yDAAyD;AACzD,wBAAgB,aAAa,CAC3B,OAAO,GAAE,eAAwC,GAChD,kBAAkB,EAAE,CAQtB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,YAAiB,GACzB,aAAa,GAAG,SAAS,CAyE3B;AAoYD,KAAK,YAAY,GAAG,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,CAAC"}
@@ -6,6 +6,13 @@ import { parseProgram } from "./parse.js";
6
6
  import { bundledStandardLibrary } from "./std-library.js";
7
7
  // How to read runBy, the same for every template.
8
8
  const RUN_BY_NOTE = "runBy names who runs each action: a party is whoever the attach binds to it (owner, actor, operator or a declared business), clock is the platform when the action falls due, parent runs only inside its parent record's action, and caller is anyone the exposed action admits.";
9
+ /**
10
+ * A stock money move declares no purpose, because the purpose follows how
11
+ * the attach binds its parties; the guide shows the line for this example.
12
+ */
13
+ function economicsNote(lines) {
14
+ return `economics declares what a payment is for the books. Add ${lines.map((line) => `\`${line}\``).join(" and ")} inside the attach. Use purpose earning when operator receives the money as revenue, participant_payout when operator pays a participant, and pass_through when money passes between participants. Without it hsx check warns and the books report leaves the payment out.`;
15
+ }
9
16
  const SUBJECT_NOTE = "subject names fields the attached object must carry, or rename to with rename { field: yourField }, before the actions that read them can run.";
10
17
  /** One line per template, small enough to read whole. */
11
18
  export function templateIndex(library = bundledStandardLibrary) {
@@ -49,8 +56,11 @@ export function templateGuide(qualifiedName, options = {}) {
49
56
  bare.actions[action.name])
50
57
  .map((action) => `expose ${action.name}`);
51
58
  const program = example.render(exposes);
52
- const create = compiledAttachment(program, example.attachment, options)
53
- .actions.create;
59
+ const compiled = compiledAttachment(program, example.attachment, options);
60
+ const create = compiled.actions.create;
61
+ const economics = compiled.warnings.flatMap((warning) => warning.message.startsWith(`${example.attachment}: `)
62
+ ? [/economics [^}]+\}/.exec(warning.fix)[0]]
63
+ : []);
54
64
  return {
55
65
  qualifiedName,
56
66
  summary: manifest.summary,
@@ -73,7 +83,11 @@ export function templateGuide(qualifiedName, options = {}) {
73
83
  subject: manifest.subject,
74
84
  actions,
75
85
  example: program,
76
- notes: [RUN_BY_NOTE, ...(manifest.subject.length ? [SUBJECT_NOTE] : [])],
86
+ notes: [
87
+ RUN_BY_NOTE,
88
+ ...(manifest.subject.length ? [SUBJECT_NOTE] : []),
89
+ ...(economics.length ? [economicsNote(economics)] : []),
90
+ ],
77
91
  };
78
92
  }
79
93
  function slot(block, key) {
@@ -406,7 +420,7 @@ function compiledAttachment(source, attachment, options) {
406
420
  const instrument = document.instruments.find((candidate) => candidate.id === instrumentId);
407
421
  if (!instrument)
408
422
  throw new Error(`${attachment} example has no instrument`);
409
- return instrument;
423
+ return Object.assign(instrument, { warnings: result.warnings });
410
424
  }
411
425
  function inputType(field) {
412
426
  const type = String(field.type);
@@ -1 +1 @@
1
- {"version":3,"file":"template-guide.js","sourceRoot":"","sources":["../../src/template-guide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAwB,MAAM,kBAAkB,CAAC;AAyChF,kDAAkD;AAClD,MAAM,WAAW,GACf,mRAAmR,CAAC;AAEtR,MAAM,YAAY,GAChB,gJAAgJ,CAAC;AAEnJ,y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