@wowok/agent-mcp 3.1.6 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/dist/config/exposure.d.ts +10 -10
  2. package/dist/config/judgment.d.ts +25 -25
  3. package/dist/config/rule-engine.d.ts +25 -25
  4. package/dist/customer/user-preferences.d.ts +2 -2
  5. package/dist/evaluation/arbitration-game.js +1 -1
  6. package/dist/evaluation/capability.d.ts +1 -1
  7. package/dist/evaluation/extract.js +1 -1
  8. package/dist/evaluation/match-operation.js +1 -1
  9. package/dist/extensions/industry-pack.d.ts +3 -2
  10. package/dist/extensions/industry-pack.js +1 -1
  11. package/dist/extensions/modes.js +1 -1
  12. package/dist/extensions/registry.js +1 -1
  13. package/dist/extensions/types.d.ts +1 -0
  14. package/dist/graph/onchain/analyze.js +1 -1
  15. package/dist/graph/onchain/analyze.spec.js +1 -1
  16. package/dist/graph/onchain/edge-schema.js +1 -1
  17. package/dist/graph/onchain/extract.js +1 -1
  18. package/dist/graph/onchain/field-manifest.js +1 -1
  19. package/dist/graph/onchain/project-relationship.js +1 -1
  20. package/dist/graph/onchain/types.d.ts +1 -1
  21. package/dist/harness/recover.js +1 -1
  22. package/dist/keeper/KeeperScan.d.ts +2 -1
  23. package/dist/keeper/KeeperScan.js +1 -1
  24. package/dist/keeper/detectors.d.ts +9 -0
  25. package/dist/keeper/detectors.js +1 -1
  26. package/dist/keeper/keeper.spec.js +1 -1
  27. package/dist/keeper/types.d.ts +1 -1
  28. package/dist/keeper/types.js +1 -1
  29. package/dist/knowledge/allocation-ledger.d.ts +4 -1
  30. package/dist/knowledge/allocation-ledger.js +1 -1
  31. package/dist/knowledge/allocation-puzzle.d.ts +2 -0
  32. package/dist/knowledge/allocation-puzzle.js +1 -1
  33. package/dist/knowledge/allocation-risk.d.ts +1 -1
  34. package/dist/knowledge/allocation-risk.js +1 -1
  35. package/dist/knowledge/arb-risk.d.ts +3 -1
  36. package/dist/knowledge/arb-risk.js +1 -1
  37. package/dist/knowledge/arbitration-ledger.js +1 -1
  38. package/dist/knowledge/arbitration-risk.js +1 -1
  39. package/dist/knowledge/arbitration-templates.d.ts +1 -0
  40. package/dist/knowledge/arbitration-templates.js +1 -1
  41. package/dist/knowledge/audit-rules.d.ts +13 -2
  42. package/dist/knowledge/audit-rules.js +1 -1
  43. package/dist/knowledge/baselines/rules/allocation.json +50 -1
  44. package/dist/knowledge/baselines/rules/arb.json +20 -1
  45. package/dist/knowledge/baselines/rules/arbitration.json +27 -0
  46. package/dist/knowledge/baselines/rules/guard.json +75 -2
  47. package/dist/knowledge/baselines/rules/machine.json +38 -13
  48. package/dist/knowledge/baselines/rules/order.json +2 -2
  49. package/dist/knowledge/builtin-templates.d.ts +3 -1
  50. package/dist/knowledge/builtin-templates.js +1 -1
  51. package/dist/knowledge/event-semantics.js +1 -1
  52. package/dist/knowledge/fund-layer.js +1 -1
  53. package/dist/knowledge/getting-started.js +1 -1
  54. package/dist/knowledge/guard-anchor-reach.d.ts +19 -0
  55. package/dist/knowledge/guard-anchor-reach.js +1 -0
  56. package/dist/knowledge/guard-bindings.js +1 -1
  57. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  58. package/dist/knowledge/guard-design-patterns.js +1 -1
  59. package/dist/knowledge/guard-ledger.js +1 -1
  60. package/dist/knowledge/guard-lint.js +1 -1
  61. package/dist/knowledge/guard-render.d.ts +6 -0
  62. package/dist/knowledge/guard-render.js +1 -1
  63. package/dist/knowledge/guard-risk.js +1 -1
  64. package/dist/knowledge/guard-submission-prompt.d.ts +6 -0
  65. package/dist/knowledge/guard-submission-prompt.js +1 -1
  66. package/dist/knowledge/guard-templates.d.ts +1 -1
  67. package/dist/knowledge/guard-templates.js +1 -1
  68. package/dist/knowledge/index.d.ts +4 -4
  69. package/dist/knowledge/index.js +1 -1
  70. package/dist/knowledge/industry-generalizer.js +1 -1
  71. package/dist/knowledge/industry-registry.d.ts +1 -1
  72. package/dist/knowledge/industry-registry.js +1 -1
  73. package/dist/knowledge/jsonrpc-enum.js +1 -1
  74. package/dist/knowledge/machine-ledger.js +1 -1
  75. package/dist/knowledge/machine-risk.js +1 -1
  76. package/dist/knowledge/machine-templates.js +1 -1
  77. package/dist/knowledge/order-ledger.js +1 -1
  78. package/dist/knowledge/order-templates.js +1 -1
  79. package/dist/knowledge/permission-ledger.js +1 -1
  80. package/dist/knowledge/release-sentinel.d.ts +12 -0
  81. package/dist/knowledge/release-sentinel.js +1 -0
  82. package/dist/knowledge/repository-write-semantics.d.ts +27 -0
  83. package/dist/knowledge/repository-write-semantics.js +1 -0
  84. package/dist/knowledge/rule-node-analyzers.d.ts +6 -0
  85. package/dist/knowledge/rule-node-analyzers.js +1 -1
  86. package/dist/knowledge/safety-rules.d.ts +5 -1
  87. package/dist/knowledge/safety-rules.js +1 -1
  88. package/dist/knowledge/scenario-modes.d.ts +10 -1
  89. package/dist/knowledge/scenario-modes.js +1 -1
  90. package/dist/knowledge/service-allocation-semantics.d.ts +36 -0
  91. package/dist/knowledge/service-allocation-semantics.js +1 -0
  92. package/dist/knowledge/strategy-manuals.d.ts +3 -5
  93. package/dist/knowledge/strategy-manuals.js +1 -1
  94. package/dist/knowledge/template-loader.d.ts +28 -12
  95. package/dist/knowledge/template-loader.js +1 -1
  96. package/dist/knowledge/template-registry.js +1 -1
  97. package/dist/knowledge/template-scanner.js +1 -1
  98. package/dist/knowledge/tools-reference.js +1 -1
  99. package/dist/knowledge/workflow-guidance.d.ts +26 -0
  100. package/dist/knowledge/workflow-guidance.js +1 -1
  101. package/dist/monitor/MonitorLoop.js +1 -1
  102. package/dist/participation/allocation-advice.d.ts +38 -0
  103. package/dist/participation/allocation-advice.js +1 -0
  104. package/dist/participation/radar-core.d.ts +2 -0
  105. package/dist/persona/types.d.ts +3 -2
  106. package/dist/persona/types.js +1 -1
  107. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  108. package/dist/playbooks/service-build/intent-analyzer.js +1 -1
  109. package/dist/playbooks/service-build/merchant-guide.d.ts +70 -63
  110. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  111. package/dist/playbooks/service-build/migration-planner.js +1 -1
  112. package/dist/playbooks/service-build/mode-actions.d.ts +5 -0
  113. package/dist/playbooks/service-build/mode-actions.js +1 -1
  114. package/dist/playbooks/service-build/participation-radar.js +1 -1
  115. package/dist/playbooks/service-build/semantic-graph.d.ts +1 -0
  116. package/dist/playbooks/service-build/semantic-graph.js +1 -1
  117. package/dist/playbooks/service-build/service-quote.d.ts +2 -0
  118. package/dist/playbooks/service-build/service-quote.js +1 -0
  119. package/dist/relationship/derivation.d.ts +1 -1
  120. package/dist/safety/confirm-gate.js +1 -1
  121. package/dist/schema/benchmark-migration/index.d.ts +30 -8
  122. package/dist/schema/benchmark-migration/index.js +1 -1
  123. package/dist/schema/call/allocation.d.ts +6 -3
  124. package/dist/schema/call/arbitration.js +1 -1
  125. package/dist/schema/call/base.d.ts +4 -0
  126. package/dist/schema/call/base.js +1 -1
  127. package/dist/schema/call/bridge.d.ts +1 -0
  128. package/dist/schema/call/error-codes.d.ts +1 -1
  129. package/dist/schema/call/error-codes.js +1 -1
  130. package/dist/schema/call/guard.d.ts +8 -8
  131. package/dist/schema/call/machine.d.ts +56 -0
  132. package/dist/schema/call/machine.js +1 -1
  133. package/dist/schema/call/order.js +1 -1
  134. package/dist/schema/call/payment.js +1 -1
  135. package/dist/schema/call/semantic.js +1 -1
  136. package/dist/schema/call/service.d.ts +84 -22
  137. package/dist/schema/call/service.js +1 -1
  138. package/dist/schema/common/index.js +1 -1
  139. package/dist/schema/common/tokentype-short-probe.spec.js +1 -0
  140. package/dist/schema/evaluation/index.d.ts +8 -80
  141. package/dist/schema/evaluation/index.js +1 -1
  142. package/dist/schema/goal/index.d.ts +9 -42
  143. package/dist/schema/goal/planning.d.ts +25 -60
  144. package/dist/schema/goal/planning.js +1 -1
  145. package/dist/schema/intent-radar/index.d.ts +2 -20
  146. package/dist/schema/intent-radar/index.js +1 -1
  147. package/dist/schema/interaction/index.d.ts +1 -1
  148. package/dist/schema/keeper/index.d.ts +3 -0
  149. package/dist/schema/keeper/index.js +1 -1
  150. package/dist/schema/local/index.d.ts +8 -0
  151. package/dist/schema/local/index.js +1 -1
  152. package/dist/schema/local/wip.d.ts +73 -0
  153. package/dist/schema/local/wip.js +1 -1
  154. package/dist/schema/operations.d.ts +92 -14
  155. package/dist/schema/operations.js +1 -1
  156. package/dist/schema/persona/index.d.ts +279 -384
  157. package/dist/schema/persona/index.js +1 -1
  158. package/dist/schema/query/bi.d.ts +149 -10
  159. package/dist/schema/query/bi.js +1 -1
  160. package/dist/schema/query/index.d.ts +38 -19
  161. package/dist/schema/query/index.js +1 -1
  162. package/dist/schema/schema-query/index.d.ts +4 -4
  163. package/dist/schema/schema-version.js +1 -1
  164. package/dist/schema/watch/index.d.ts +2 -2
  165. package/dist/schema-query-impl/index.d.ts +1 -0
  166. package/dist/schema-query-impl/index.js +1 -1
  167. package/dist/schemas/account_operation.output.json +3 -2
  168. package/dist/schemas/benchmark_migration_operation.output.json +116 -2
  169. package/dist/schemas/benchmark_migration_operation.schema.json +2 -10
  170. package/dist/schemas/bridge_operation.output.json +3 -2
  171. package/dist/schemas/evaluation_operation.schema.json +7 -70
  172. package/dist/schemas/goal_operation.schema.json +6 -39
  173. package/dist/schemas/index.json +1 -1
  174. package/dist/schemas/intent_radar.output.json +4 -20
  175. package/dist/schemas/keeper_operation.output.json +2 -2
  176. package/dist/schemas/keeper_operation.schema.json +9 -4
  177. package/dist/schemas/local_history_operation.output.json +3 -2
  178. package/dist/schemas/local_info_operation.output.json +3 -2
  179. package/dist/schemas/local_mark_operation.output.json +3 -2
  180. package/dist/schemas/messenger_operation.output.json +2 -2
  181. package/dist/schemas/monitor_events.output.json +2 -2
  182. package/dist/schemas/monitor_subscription.output.json +2 -2
  183. package/dist/schemas/onchain_events.output.json +2 -2
  184. package/dist/schemas/onchain_operations.output.json +7 -6
  185. package/dist/schemas/onchain_operations.schema.json +227 -54
  186. package/dist/schemas/onchain_operations_allocation.schema.json +11 -10
  187. package/dist/schemas/onchain_operations_arbitration.schema.json +13 -13
  188. package/dist/schemas/onchain_operations_machine.schema.json +27 -5
  189. package/dist/schemas/onchain_operations_order.schema.json +1 -1
  190. package/dist/schemas/onchain_operations_payment.schema.json +2 -2
  191. package/dist/schemas/onchain_operations_reward.schema.json +1 -1
  192. package/dist/schemas/onchain_operations_service.schema.json +171 -21
  193. package/dist/schemas/onchain_operations_treasury.schema.json +1 -1
  194. package/dist/schemas/onchain_table_data.output.json +57 -4
  195. package/dist/schemas/persona_operation.output.json +11 -88
  196. package/dist/schemas/persona_operation.schema.json +4 -32
  197. package/dist/schemas/query_toolkit.output.json +320 -22
  198. package/dist/schemas/query_toolkit.schema.json +53 -0
  199. package/dist/schemas/wip_file.output.json +221 -0
  200. package/dist/schemas/wip_file.schema.json +125 -0
  201. package/dist/tools/handlers/benchmark-migration.js +1 -1
  202. package/dist/tools/handlers/config.js +1 -1
  203. package/dist/tools/handlers/dispatch-expectations.spec.js +1 -1
  204. package/dist/tools/handlers/keeper.d.ts +1 -1
  205. package/dist/tools/handlers/onchain.js +1 -1
  206. package/dist/tools/handlers/query.js +1 -1
  207. package/dist/tools/handlers/schema-query.js +1 -1
  208. package/dist/tools/handlers/wip-upload.d.ts +22 -0
  209. package/dist/tools/handlers/wip-upload.js +1 -0
  210. package/dist/tools/handlers/wip.js +1 -1
  211. package/dist/tools/index.js +1 -1
  212. package/dist/tools/move-fn-index.gen.js +1 -1
  213. package/dist/tools/registry/business.js +1 -1
  214. package/dist/tools/registry/files.js +1 -1
  215. package/dist/tools/wip-deploy-assist.js +1 -1
  216. package/dist/tools/wrap.js +1 -1
  217. package/package.json +2 -2
  218. package/dist/knowledge/alloc-audit-policy.spec.js +0 -1
  219. package/dist/knowledge/event-semantics.spec.d.ts +0 -1
  220. package/dist/knowledge/event-semantics.spec.js +0 -1
  221. package/dist/knowledge/facts-sync.spec.d.ts +0 -1
  222. package/dist/knowledge/facts-sync.spec.js +0 -1
  223. package/dist/knowledge/guard-design-patterns.spec.d.ts +0 -1
  224. package/dist/knowledge/guard-design-patterns.spec.js +0 -1
  225. package/dist/knowledge/guard-eval.spec.d.ts +0 -1
  226. package/dist/knowledge/guard-eval.spec.js +0 -1
  227. package/dist/knowledge/rule-node-analyzers.spec.d.ts +0 -1
  228. package/dist/knowledge/rule-node-analyzers.spec.js +0 -1
  229. package/dist/knowledge/safety-rules.extract-amount.spec.d.ts +0 -1
  230. package/dist/knowledge/safety-rules.extract-amount.spec.js +0 -1
  231. package/dist/knowledge/template-loader.spec.d.ts +0 -1
  232. package/dist/knowledge/template-loader.spec.js +0 -1
  233. package/dist/knowledge/template-scanner.spec.d.ts +0 -1
  234. package/dist/knowledge/template-scanner.spec.js +0 -1
  235. /package/dist/{knowledge/alloc-audit-policy.spec.d.ts → schema/common/tokentype-short-probe.spec.d.ts} +0 -0
@@ -112,7 +112,7 @@
112
112
  "type": "string",
113
113
  "description": "Name of the product or service to purchase"
114
114
  },
115
- "stock": {
115
+ "quantity": {
116
116
  "anyOf": [
117
117
  {
118
118
  "type": "number"
@@ -121,16 +121,17 @@
121
121
  "type": "string"
122
122
  }
123
123
  ],
124
- "description": "Quantity of the product or service to purchase"
124
+ "description": "⚠️ PURCHASE QUANTITY, NOT inventory. This is the number of units you are buying; the on-chain order total = sale.price x this value. Do NOT put the product's available stock here — inventory is the separate `stock` field on the Service's sales list. To buy one unit, set quantity: 1. (Legacy callers may still send this as `stock`; it is accepted and treated identically as the purchase quantity.)"
125
125
  },
126
126
  "wip_hash": {
127
- "type": "string",
128
- "description": "WIP file hash of the item. EMPTY string \"\" means only verify the WIP file integrity without comparing to a specific hash (the hash within the wip file will be used). For purchases, it is STRONGLY RECOMMENDED to fill in the hash you saw when viewing the product info (from the Service sale's wip_hash field) to prevent the merchant from replacing the WIP file before your order is placed (a legitimate update operation), which would cause inconsistency between what you saw and what you received."
127
+ "default": "",
128
+ "description": "WIP file hash of the item. OMIT this field (or pass empty string \"\") to AUTO-FILL it from the bound Service sale's wip_hash — the on-chain quote then verifies the WIP file matches that hash (E_WIP_HASH_NOT_MATCH on mismatch), so buyers do NOT need to copy any hash value. Only pass an explicit hash when pinning a value seen earlier: that protects against a legitimate merchant WIP update between viewing the product and placing the order.",
129
+ "type": "string"
129
130
  }
130
131
  },
131
132
  "required": [
132
133
  "name",
133
- "stock",
134
+ "quantity",
134
135
  "wip_hash"
135
136
  ],
136
137
  "additionalProperties": false
@@ -165,7 +166,7 @@
165
166
  "properties": {
166
167
  "coin": {
167
168
  "type": "string",
168
- "description": "Coin object ID or name(local mark). Use a specified Coin object."
169
+ "description": "Coin object ID or name(local mark). WHOLE-COIN TRANSFER: the ENTIRE Coin object is moved to the recipient — the 'amount' is NOT taken from it (testnet lesson: passing your main gas coin transfers its full balance, leaving you unable to pay for anything). Use only for coins whose whole balance is exactly what you intend to send; prefer {balance: <smallest-unit number>} for partial amounts."
169
170
  }
170
171
  },
171
172
  "required": [
@@ -249,7 +250,7 @@
249
250
  "additionalProperties": false
250
251
  },
251
252
  "namedNewOrder": {
252
- "description": "RECOMMENDED: Set a local name for the newly created Order object. Without this, the Order is only referenceable by its on-chain address. Example: {name: 'my_order_v1'} allows subsequent operations to use 'my_order_v1' instead of the address.",
253
+ "description": "RECOMMENDED: Set a local name for the newly created Order object. Without this, the Order is only referenceable by its on-chain address. Example: {name: 'my_order_v1'} allows subsequent operations to use 'my_order_v1' instead of the address. PLACEMENT: this field MUST be inside data.order_new (it is an OrderNew field) — putting namedNewOrder at the data root fails schema validation with 'Unrecognized key'. MIGRATION TIP: for batch/migration order creation, always auto-generate readable names (e.g. '<source>_<service>_<seq>' like 'upwork_svc_v1_0001') — unnamed orders (head.name = null) are only address-referenceable, which breaks downstream queries, displays and audits (E-8).",
253
254
  "type": "object",
254
255
  "properties": {
255
256
  "name": {
@@ -379,7 +380,7 @@
379
380
  "type": "string"
380
381
  }
381
382
  ],
382
- "description": "Current REMAINING stock of the product or service. Each order DECREMENTS it by the ordered quantity (a buy aborts when the remaining stock is lower than the ordered quantity). Writing this field SETS the remaining stock to the given value — it is NOT added to it. To top up one product's stock without resending the whole list, there is no per-item op in this tool; re-issue sales with op:\"set\" carrying the full list and the updated stock for that product."
383
+ "description": "Current REMAINING stock of the product or service. Each order DECREMENTS it by the ordered quantity (a buy aborts when the remaining stock is lower than the ordered quantity). Writing this field SETS the remaining stock to the given value — it is NOT added to it. To change one product without resending the whole list, use the per-item sales ops on onchain_operations service: stock_add / stock_reduce (deltas), price_add / price_reduce (deltas), sale_suspension (suspend/resume one product)."
383
384
  },
384
385
  "suspension": {
385
386
  "type": "boolean",
@@ -450,7 +451,7 @@
450
451
  "type": "string"
451
452
  }
452
453
  ],
453
- "description": "Current REMAINING stock of the product or service. Each order DECREMENTS it by the ordered quantity (a buy aborts when the remaining stock is lower than the ordered quantity). Writing this field SETS the remaining stock to the given value — it is NOT added to it. To top up one product's stock without resending the whole list, there is no per-item op in this tool; re-issue sales with op:\"set\" carrying the full list and the updated stock for that product."
454
+ "description": "Current REMAINING stock of the product or service. Each order DECREMENTS it by the ordered quantity (a buy aborts when the remaining stock is lower than the ordered quantity). Writing this field SETS the remaining stock to the given value — it is NOT added to it. To change one product without resending the whole list, use the per-item sales ops on onchain_operations service: stock_add / stock_reduce (deltas), price_add / price_reduce (deltas), sale_suspension (suspend/resume one product)."
454
455
  },
455
456
  "suspension": {
456
457
  "type": "boolean",
@@ -483,7 +484,7 @@
483
484
  "sales"
484
485
  ],
485
486
  "additionalProperties": false,
486
- "description": "Replaces the ENTIRE sales list: every product NOT included is REMOVED from the Service (its stock and wip binding go with it — there is no per-item update via this op). To change one product (e.g. its price or stock), resend the FULL list including all unchanged products. Removal is immediate and cannot be undone."
487
+ "description": "Replaces the ENTIRE sales list: every product NOT included is REMOVED from the Service (its stock and wip binding go with it). To change ONE product, prefer the per-item ops (price_add / price_reduce / stock_add / stock_reduce / sale_suspension) over re-sending the full list; with op:set you MUST resend ALL unchanged products too. Removal is immediate and cannot be undone."
487
488
  },
488
489
  {
489
490
  "type": "object",
@@ -520,6 +521,154 @@
520
521
  ],
521
522
  "additionalProperties": false,
522
523
  "description": "Clear all sales products or services."
524
+ },
525
+ {
526
+ "type": "object",
527
+ "properties": {
528
+ "op": {
529
+ "type": "string",
530
+ "const": "price_add"
531
+ },
532
+ "sale_name": {
533
+ "type": "string",
534
+ "description": "Name of the product to update"
535
+ },
536
+ "value": {
537
+ "anyOf": [
538
+ {
539
+ "type": "number"
540
+ },
541
+ {
542
+ "type": "string"
543
+ }
544
+ ],
545
+ "description": "Price INCREASE delta in the Service token's smallest units (e.g. 100000000 = +0.1 WOW). Added to the current price (on-chain saturating add). NOT the new absolute price."
546
+ }
547
+ },
548
+ "required": [
549
+ "op",
550
+ "sale_name",
551
+ "value"
552
+ ],
553
+ "additionalProperties": false,
554
+ "description": "Raise one product's price by a delta. Only the named product is touched; an unknown sale_name is silently ignored on-chain (verify with query_toolkit afterwards)."
555
+ },
556
+ {
557
+ "type": "object",
558
+ "properties": {
559
+ "op": {
560
+ "type": "string",
561
+ "const": "price_reduce"
562
+ },
563
+ "sale_name": {
564
+ "type": "string",
565
+ "description": "Name of the product to update"
566
+ },
567
+ "value": {
568
+ "anyOf": [
569
+ {
570
+ "type": "number"
571
+ },
572
+ {
573
+ "type": "string"
574
+ }
575
+ ],
576
+ "description": "Price DECREASE delta in the Service token's smallest units (e.g. 100000000 = -0.1 WOW). If the delta exceeds the current price, the price clamps to 0. NOT the new absolute price."
577
+ }
578
+ },
579
+ "required": [
580
+ "op",
581
+ "sale_name",
582
+ "value"
583
+ ],
584
+ "additionalProperties": false,
585
+ "description": "Lower one product's price by a delta. Only the named product is touched; an unknown sale_name is silently ignored on-chain (verify with query_toolkit afterwards)."
586
+ },
587
+ {
588
+ "type": "object",
589
+ "properties": {
590
+ "op": {
591
+ "type": "string",
592
+ "const": "stock_add"
593
+ },
594
+ "sale_name": {
595
+ "type": "string",
596
+ "description": "Name of the product to update"
597
+ },
598
+ "value": {
599
+ "anyOf": [
600
+ {
601
+ "type": "number"
602
+ },
603
+ {
604
+ "type": "string"
605
+ }
606
+ ],
607
+ "description": "Stock INCREASE delta (a unit COUNT, not money), e.g. 50 = +50 units."
608
+ }
609
+ },
610
+ "required": [
611
+ "op",
612
+ "sale_name",
613
+ "value"
614
+ ],
615
+ "additionalProperties": false,
616
+ "description": "Restock one product by a delta. Only the named product is touched; an unknown sale_name is silently ignored on-chain (verify with query_toolkit afterwards)."
617
+ },
618
+ {
619
+ "type": "object",
620
+ "properties": {
621
+ "op": {
622
+ "type": "string",
623
+ "const": "stock_reduce"
624
+ },
625
+ "sale_name": {
626
+ "type": "string",
627
+ "description": "Name of the product to update"
628
+ },
629
+ "value": {
630
+ "anyOf": [
631
+ {
632
+ "type": "number"
633
+ },
634
+ {
635
+ "type": "string"
636
+ }
637
+ ],
638
+ "description": "Stock DECREASE delta (a unit COUNT, not money), e.g. 10 = -10 units. If the delta exceeds current stock, the stock clamps to 0 (product becomes unsellable)."
639
+ }
640
+ },
641
+ "required": [
642
+ "op",
643
+ "sale_name",
644
+ "value"
645
+ ],
646
+ "additionalProperties": false,
647
+ "description": "Reduce one product's stock by a delta (e.g. write-off damaged units). Only the named product is touched; an unknown sale_name is silently ignored on-chain."
648
+ },
649
+ {
650
+ "type": "object",
651
+ "properties": {
652
+ "op": {
653
+ "type": "string",
654
+ "const": "sale_suspension"
655
+ },
656
+ "sale_name": {
657
+ "type": "string",
658
+ "description": "Name of the product to suspend or resume"
659
+ },
660
+ "suspension": {
661
+ "type": "boolean",
662
+ "description": "true = suspend the product (buy/quote abort with E_SALE_SUSPENDED); false = resume selling."
663
+ }
664
+ },
665
+ "required": [
666
+ "op",
667
+ "sale_name",
668
+ "suspension"
669
+ ],
670
+ "additionalProperties": false,
671
+ "description": "Suspend or resume ONE product without removing it (keeps price/stock/WIP binding). The Amazon-style 'out of stock / listing inactive' state. Only the named product is touched; an unknown sale_name is silently ignored on-chain (verify with query_toolkit afterwards)."
523
672
  }
524
673
  ]
525
674
  },
@@ -969,7 +1118,7 @@
969
1118
  "type": "string"
970
1119
  }
971
1120
  ],
972
- "description": "Allocation value. SEMANTICS DEPEND ON `mode`:\n• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). Allocated first; sum of Amount items cached as `fix`.\n• mode='Rate': basis-points rate, 10000 = 100% (e.g., '7500' for 75%, '2500' for 25%). When no Surplus in same Allocator, sum MUST == 10000; when Surplus present, sum MUST <= 10000.\n• mode='Surplus': IGNORED (contract forces to 0). Set to '0' for clarity. Receives remaining balance after Amount + Rate allocations.\n⚠️ T1 LOSSY POINT (B-2): the value is PRE-CONFIGURED and STATIC. A continuous/conditional amount (e.g. 'pay exactly the assessed loss amount') CANNOT be expressed — there is no runtime formula field. Model variable payouts as (a) a fixed-tier Allocator list guarded by distinct Guards, or (b) an Amount with a `max` cap — both are finite configurations, not free-form formulas."
1121
+ "description": "Allocation value. SEMANTICS DEPEND ON `mode`:\n• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). Allocated first; sum of Amount items cached as `fix`.\n• mode='Rate' (NET): basis-points rate off the post-fix base (balance - fix, or max - fix), 10000 = 100% (e.g., '7500' for 75%, '2500' for 25%). When no Surplus in same Allocator, sum MUST == 10000; when Surplus present, sum MUST <= 10000.\n• mode='RateGross': basis-points rate off the FULL pool (balance) or the `max` cap — the fixed Amount total is NOT subtracted, 10000 = 100%. sum MUST <= 10000 (and, with `max` set, fix×10000 + sum×max <= max×10000). Cannot be mixed with mode='Rate' in the same Allocator while a fixed Amount total is present.\n• mode='Surplus': IGNORED (contract forces to 0). Set to '0' for clarity. Receives remaining balance after Amount + Rate/RateGross allocations.\n⚠️ T1 LOSSY POINT (B-2): the value is PRE-CONFIGURED and STATIC. A continuous/conditional amount (e.g. 'pay exactly the assessed loss amount') CANNOT be expressed — there is no runtime formula field. Model variable payouts as (a) a fixed-tier Allocator list guarded by distinct Guards, or (b) an Amount with a `max` cap — both are finite configurations, not free-form formulas."
973
1122
  },
974
1123
  "mode": {
975
1124
  "anyOf": [
@@ -978,12 +1127,13 @@
978
1127
  "enum": [
979
1128
  "Amount",
980
1129
  "Rate",
981
- "Surplus"
1130
+ "Surplus",
1131
+ "RateGross"
982
1132
  ]
983
1133
  },
984
1134
  {}
985
1135
  ],
986
- "description": "Allocation mode — determines how the `sharing` field is interpreted. Three modes can be used individually OR combined within a single Allocator; when combined, allocation order is strictly: Amount first, then Rate, then Surplus. Understanding these modes allows modeling almost any fund distribution pattern.\n• Amount (0): `sharing` is a FIXED amount in smallest unit (e.g., '750000000' = 0.75 WOW). Allocated FIRST; sum of all Amount items is cached as `fix` by the contract. Validation: when no Rate and no Surplus items exist, sum of Amount items must be >= allocators.threshold (EAMOUNT_BELOW_THRESHOLD=12); when `max` is set, sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13).\n• Rate (1): `sharing` is a basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance - fix (or max - fix if `max` is set). Validation: when no Surplus items exist, sum of all Rate items must be EXACTLY 10000 (ERATE_NOT_10000=4); when Surplus items exist, sum of all Rate items must be <= 10000 (ERATE_EXCEEDS_10000=6).\n• Surplus (2): `sharing` is IGNORED (contract forces it to 0). Allocated LAST; receives the remaining balance after Amount + Rate allocations. Validation: MAX ONE Surplus item per Allocator (EMULTIPLE_SURPLUS=5). When Surplus exists, Rate sum constraint relaxes from == 10000 to <= 10000.\nALLOCATION ORDER (strict): Amount items (fixed, cached as fix) → Rate items (proportional to balance-fix) → Surplus item (remaining).\nRECOMMENDATION: Use Amount mode for known fixed amounts (clearer, no sum constraint). Use Rate mode for proportional splits (requires sum == 10000 unless Surplus present). Use Surplus to capture remainder (e.g., platform fee + host gets rest). Accepts string ('Amount'/'Rate'/'Surplus', recommended) or number (0/1/2)."
1136
+ "description": "Allocation mode — determines how the `sharing` field is interpreted. Four modes can be used individually OR combined within a single Allocator; when combined, allocation order is strictly: Amount first, then Rate/RateGross, then Surplus. Understanding these modes allows modeling almost any fund distribution pattern.\n• Amount (0): `sharing` is a FIXED amount in smallest unit (e.g., '750000000' = 0.75 WOW). Allocated FIRST; sum of all Amount items is cached as `fix` by the contract. Validation: when no Rate and no Surplus items exist, sum of Amount items must be >= allocators.threshold (EAMOUNT_BELOW_THRESHOLD=12); when `max` is set, sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13).\n• Rate (1): `sharing` is a NET basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance - fix (or max - fix if `max` is set) — the cached fixed Amount total IS subtracted. Validation: when no Surplus items exist, sum of all Rate items must be EXACTLY 10000 (ERATE_NOT_10000=4); when Surplus items exist, sum of all Rate items must be <= 10000 (ERATE_EXCEEDS_10000=6).\n• RateGross (3): `sharing` is a GROSS basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance (the full pool) or the `max` cap when set — the fixed Amount total is NOT subtracted, so fixed Amount entries and percentage-of-total rates coexist exactly. Validation: sum of all RateGross items must be <= 10000 (ERATE_EXCEEDS_10000=6); when `max` is set, fix×10000 + sum(rate)×max <= max×10000 must hold (6); with no `max` and a fixed total > 0, sum of RateGross items must be < 10000 (6). RateGross cannot be mixed with NET Rate entries in the same Allocator while a fixed Amount total is present (EMIXED_RATE_BASES=17).\n• Surplus (2): `sharing` is IGNORED (contract forces it to 0). Allocated LAST; receives the remaining balance after Amount + Rate allocations. Validation: MAX ONE Surplus item per Allocator (EMULTIPLE_SURPLUS=5). When Surplus exists, Rate sum constraint relaxes from == 10000 to <= 10000.\nALLOCATION ORDER (strict): Amount items (fixed, cached as fix) → Rate/RateGross items → Surplus item (remaining).\nRECOMMENDATION: Use Amount mode for known fixed amounts (clearer, no sum constraint). Use Rate mode for proportional splits off the post-fix remainder (requires sum == 10000 unless Surplus present). Use RateGross mode for a percentage of the FULL pool/`max` that must coexist with fixed Amount entries. Use Surplus to capture remainder (e.g., platform fee + host gets rest). Accepts string ('Amount'/'Rate'/'Surplus'/'RateGross', recommended) or number (0/1/2/3)."
987
1137
  }
988
1138
  },
989
1139
  "required": [
@@ -992,12 +1142,12 @@
992
1142
  "mode"
993
1143
  ],
994
1144
  "additionalProperties": false,
995
- "description": "Fund allocation item — one recipient's share of the Allocation balance. The `sharing` value's meaning depends on `mode` (see AllocationModeSchema). Multiple items in the same Allocator are evaluated together: Amount items first, Rate items second, Surplus last."
1145
+ "description": "Fund allocation item — one recipient's share of the Allocation balance. The `sharing` value's meaning depends on `mode` (see AllocationModeSchema). Multiple items in the same Allocator are evaluated together: Amount items first, Rate/RateGross items second, Surplus last."
996
1146
  },
997
- "description": "Fund allocation item list. Each item specifies a recipient (who), a value (sharing), and a mode. Items can mix modes (Amount + Rate + Surplus) within the same Allocator. RECIPIENT SEMANTICS: the Guard constrains what each submission slot may be; a recipient's safety follows from the sufficiency of those constraints (run the recipient constraint audit). Canonical order pattern: recipient = the single submitted Order — funds land at that object and are receivable only by its owner. ALLOCATION ORDER: Amount items first (cached as fix) → Rate items (proportional to balance - fix) → Surplus item (remaining). CONSTRAINTS: max ONE Surplus item per Allocator; Rate sum must == 10000 (no Surplus) or <= 10000 (with Surplus); Amount sum must >= threshold (no Rate and no Surplus) and <= max (if max set)."
1147
+ "description": "Fund allocation item list. Each item specifies a recipient (who), a value (sharing), and a mode. Items can mix modes (Amount + Rate/RateGross + Surplus) within the same Allocator. RECIPIENT SEMANTICS: the Guard constrains what each submission slot may be; a recipient's safety follows from the sufficiency of those constraints (run the recipient constraint audit). Canonical order pattern: recipient = the single submitted Order — funds land at that object and are receivable only by its owner. ALLOCATION ORDER: Amount items first (cached as fix) → Rate items (proportional to balance - fix; RateGross proportional to the full pool) → Surplus item (remaining). CONSTRAINTS: max ONE Surplus item per Allocator; NET Rate sum must == 10000 (no Surplus) or <= 10000 (with Surplus); RateGross sum must <= 10000 (never mixed with NET Rate while a fixed total is present); Amount sum must >= threshold (no Rate and no Surplus) and <= max (if max set)."
998
1148
  },
999
1149
  "fix": {
1000
- "description": "OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. Computed by the contract when the allocator is added — DO NOT set this field at creation. Used internally to compute `total_rates = balance - fix` for Rate allocation.",
1150
+ "description": "OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. Computed by the contract when the allocator is added — DO NOT set this field at creation. Used internally to compute `total_rates = balance - fix` for NET Rate allocation (RateGross ignores fix and uses the full pool/`max`).",
1001
1151
  "anyOf": [
1002
1152
  {
1003
1153
  "type": "number"
@@ -1008,7 +1158,7 @@
1008
1158
  ]
1009
1159
  },
1010
1160
  "max": {
1011
- "description": "Maximum allocation cap (OPTIONAL — omit the field or set to null to disable the cap; do NOT set to 0 as that means a cap of zero). Passed through to the contract as Option<u64> when the allocator is added: when null/omitted the contract treats it as `none` (no cap); when set, the contract enforces it. Has THREE effects when set:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: total_rates = max - fix (instead of balance - fix)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort.",
1161
+ "description": "Maximum allocation cap (OPTIONAL — omit the field or set to null to disable the cap; do NOT set to 0 as that means a cap of zero). Passed through to the contract as Option<u64> when the allocator is added: when null/omitted the contract treats it as `none` (no cap); when set, the contract enforces it. Has THREE effects when set:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: NET Rate total_rates = max - fix; RateGross total_rates = max (fix NOT subtracted)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort.",
1012
1162
  "anyOf": [
1013
1163
  {
1014
1164
  "anyOf": [
@@ -1032,7 +1182,7 @@
1032
1182
  "sharing"
1033
1183
  ],
1034
1184
  "additionalProperties": false,
1035
- "description": "Fund allocator — a complete allocation strategy triggered by a Guard. Contains a sharing[] array where items can mix Amount/Rate/Surplus modes. When the Guard passes, the contract allocates funds in strict order: Amount → Rate → Surplus."
1185
+ "description": "Fund allocator — a complete allocation strategy triggered by a Guard. Contains a sharing[] array where items can mix Amount/Rate/RateGross/Surplus modes. When the Guard passes, the contract allocates funds in strict order: Amount → Rate/RateGross → Surplus."
1036
1186
  },
1037
1187
  "description": "Fund allocator list. Each allocator is evaluated in order; the FIRST allocator whose Guard passes wins. This enables mutually exclusive allocation paths (e.g., 3 allocators for 3 forward paths: refund / damage-deduct / arbitrate)."
1038
1188
  }
@@ -1043,7 +1193,7 @@
1043
1193
  "allocators"
1044
1194
  ],
1045
1195
  "additionalProperties": false,
1046
- "description": "Fund allocator list — the top-level allocation configuration attached to an Order. Contains a threshold and a list of Allocators. When funds arrive at the Order, the first Allocator whose Guard passes executes its sharing[] in strict order: Amount → Rate → Surplus. MULTI-TIER ALLOCATION (DOC-04): Each Order binds ONE Allocators template (set on Service.order_allocators before publish). For multi-tier distribution (e.g., customer→agency→suppliers), use a two-phase approach: (1) Tier-1 Allocators on the customer's Order (allocates to agency + refund fund); (2) Tier-2 Allocators on a NEW Order created by the agency (allocates agency's received funds to suppliers). Each tier's Rate-mode sharing[] must independently sum to 10000 (or <= 10000 with Surplus)."
1196
+ "description": "Fund allocator list — the top-level allocation configuration attached to an Order. Contains a threshold and a list of Allocators. When funds arrive at the Order, the first Allocator whose Guard passes executes its sharing[] in strict order: Amount → Rate/RateGross → Surplus. MULTI-TIER ALLOCATION (DOC-04): Each Order binds ONE Allocators template (set on Service.order_allocators before publish). For multi-tier distribution (e.g., customer→agency→suppliers), use a two-phase approach: (1) Tier-1 Allocators on the customer's Order (allocates to agency + refund fund); (2) Tier-2 Allocators on a NEW Order created by the agency (allocates agency's received funds to suppliers). Each tier's NET Rate-mode sharing[] must independently sum to 10000 (or <= 10000 with Surplus); RateGross-mode sharing[] must sum to <= 10000."
1047
1197
  },
1048
1198
  {
1049
1199
  "type": "null"
@@ -1091,7 +1241,7 @@
1091
1241
  "properties": {
1092
1242
  "coin": {
1093
1243
  "type": "string",
1094
- "description": "Coin object ID or name(local mark). Use a specified Coin object."
1244
+ "description": "Coin object ID or name(local mark). WHOLE-COIN TRANSFER: the ENTIRE Coin object is moved to the recipient — the 'amount' is NOT taken from it (testnet lesson: passing your main gas coin transfers its full balance, leaving you unable to pay for anything). Use only for coins whose whole balance is exactly what you intend to send; prefer {balance: <smallest-unit number>} for partial amounts."
1095
1245
  }
1096
1246
  },
1097
1247
  "required": [
@@ -1422,7 +1572,7 @@
1422
1572
  "type": "boolean"
1423
1573
  },
1424
1574
  "publish": {
1425
- "description": "Whether to publish the Service. After publishing, customers can place orders. VERIFIED against Move source + SDK (4-level immutability matrix):\n L1 — PERMANENTLY LOCKED after publish (assert!(!bPublished), no pause+lock exception):\n • machine (workflow template)\n • order_allocators (fund distribution rules)\n L2 — TIME-LOCKED after publish (unpublished-state check — requires pause + setting_lock_duration elapsed):\n • arbitrations remove/clear (dispute resolution objects)\n • rewards remove/clear (reward objects)\n • compensation_fund_withdraw (withdraw ALL funds)\n L3 — REMAIN MUTABLE after publish (no SDK check, no Move check):\n • arbitrations add, rewards add (no assert — can add after publish)\n • buy_guard, sales, discount, description, location, pause, repositories,\n • compensation_fund_add, setting_lock_duration_add, customer_required, um (Contact)\nThese 2 L1-LOCKED fields (machine/order_allocators) MUST be set BEFORE publish=true.\narbitrations/rewards can be ADDED after publish but remove/clear requires pause+lock.\n\n⚠️ COMPENSATION_FUND + ARBITRATION LINKAGE:\n At publish time, if compensation_fund > 0, Arbitration MUST be bound:\n if (balance::value(&self.compensation_fund) > 0) {\n assert!(arbitration_count > 0, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND);\n }\n The MCP handler enforces this as a HARD PRE-CHECK: if publish=true AND compensation_fund_add is set in the same call AND arbitrations is empty, the call is REJECTED before submission. If compensation_fund was deposited in a prior call, a SOFT WARNING is issued.\n\nSCHEMA-03 / P0-01 fix — DEPLOYMENT WORKFLOW (two-phase, avoids circular dependency):\n Phase 1 — CREATE (no publish): object={name:'my-service', type_parameter, permission} + machine + order_allocators + arbitrations.\n NOTE: buy_guard can use a LocalMark NAME (not address) to break the Guard→Service circular dependency.\n The name is resolved to an address at transaction build time.\n Phase 2 — PUBLISH: object='my-service' (string ref) + publish=true.\n All L1-LOCKED fields must be set in Phase 1; Phase 2 only flips the publish flag.\n Post-publish updates: buy_guard, sales, description, repositories (add), rewards (add), arbitrations (add), etc.",
1575
+ "description": "Whether to publish the Service. After publishing, customers can place orders. ⚠️ PRE-PUBLISH EVALUATION (mandatory, stop-node fund-exit coverage): service.allocators MUST cover EVERY stop node of the bound Machine — every node where an order can rest (terminal nodes AND waiting states: review windows, handovers, open disputes) needs BOTH a withdrawal (release) AND a refund allocation rule, and each mapping guard must be satisfiable in BOTH directions. An uncovered stop node strands escrowed funds permanently (order_allocators is L1-immutable). Review-gated release is a TIME VARIANT inside ONE exit guard ('reviewed OR unreviewed after T'), never parallel outgoing edges (race deadlock). See pattern.fund_flow_stop_node_coverage + rules R-M5-03 / R-M5-09. VERIFIED against Move source + SDK (4-level immutability matrix):\n L1 — PERMANENTLY LOCKED after publish (assert!(!bPublished), no pause+lock exception):\n • machine (workflow template)\n • order_allocators (fund distribution rules)\n L2 — TIME-LOCKED after publish (unpublished-state check — requires pause + setting_lock_duration elapsed):\n • arbitrations remove/clear (dispute resolution objects)\n • rewards remove/clear (reward objects)\n • compensation_fund_withdraw (withdraw ALL funds)\n L3 — REMAIN MUTABLE after publish (no SDK check, no Move check):\n • arbitrations add, rewards add (no assert — can add after publish)\n • buy_guard, sales, discount, description, location, pause, repositories,\n • compensation_fund_add, setting_lock_duration_add, customer_required, um (Contact)\nThese 2 L1-LOCKED fields (machine/order_allocators) MUST be set BEFORE publish=true.\narbitrations/rewards can be ADDED after publish but remove/clear requires pause+lock.\n\n⚠️ COMPENSATION_FUND + ARBITRATION LINKAGE:\n At publish time, if compensation_fund > 0, Arbitration MUST be bound:\n if (balance::value(&self.compensation_fund) > 0) {\n assert!(arbitration_count > 0, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND);\n }\n The MCP handler enforces this as a HARD PRE-CHECK: if publish=true AND compensation_fund_add is set in the same call AND arbitrations is empty, the call is REJECTED before submission. If compensation_fund was deposited in a prior call, a SOFT WARNING is issued.\n\nSCHEMA-03 / P0-01 fix — DEPLOYMENT WORKFLOW (two-phase, avoids circular dependency):\n Phase 1 — CREATE (no publish): object={name:'my-service', type_parameter, permission} + machine + order_allocators + arbitrations.\n NOTE: buy_guard can use a LocalMark NAME (not address) to break the Guard→Service circular dependency.\n The name is resolved to an address at transaction build time.\n Phase 2 — PUBLISH: object='my-service' (string ref) + publish=true.\n All L1-LOCKED fields must be set in Phase 1; Phase 2 only flips the publish flag.\n Post-publish updates: buy_guard, sales, description, repositories (add), rewards (add), arbitrations (add), etc.",
1426
1576
  "type": "boolean"
1427
1577
  }
1428
1578
  },
@@ -2415,6 +2565,17 @@
2415
2565
  "type": "string",
2416
2566
  "description": "Node name. ⚠️ T1 LOSSY POINT (B-1): do NOT name a node 'refund'/'refunded'/'deposit_refunded'/'deposit_deducted'/'disputed'/'cancelled' to model fund return or dispute — funds MUST move through the Allocation waterfall (order_allocators), NOT through Machine terminal nodes (R-M1-11). A node named 'refund' is a semantic lie: reaching it does not move funds by itself. Model refund as a refund-to-Order Allocator slot (a { Signer } or Order-owner recipient), and model dispute as the bound Arbitration, not a Machine node."
2417
2567
  },
2568
+ "role": {
2569
+ "description": "OPTIONAL business role tag for display layers and template reuse (E-9). SESSION METADATA ONLY — the on-chain node struct carries name+pairs, so this is NOT stored on-chain; the MCP echoes it back as a NODE ROLES constraint warning and seed templates annotate it. Semantics: draft = pre-start cancellable, active = work in progress, delivered = work submitted awaiting acceptance, final = settlement endpoint (advancing here should trigger the Allocation fund release), cancelled = refund endpoint (advancing here should trigger the refund Allocator).",
2570
+ "type": "string",
2571
+ "enum": [
2572
+ "draft",
2573
+ "active",
2574
+ "delivered",
2575
+ "final",
2576
+ "cancelled"
2577
+ ]
2578
+ },
2418
2579
  "pairs": {
2419
2580
  "type": "array",
2420
2581
  "items": {
@@ -2446,7 +2607,7 @@
2446
2607
  "description": "Forward name"
2447
2608
  },
2448
2609
  "namedOperator": {
2449
- "description": "Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders).",
2610
+ "description": "Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders). SPECIAL CASE: an EMPTY string ('') on an order-bound forward resolves to the ORDER PAYER — the buyer of the order can advance it (progress::IsNamedOperator treats an empty name + order as the order's own operator). Use '' for buyer-side actions (delivery confirmation, review, return request, pre-ship cancel) instead of binding a merchant-only permission index, which aborts E_PERMISSION_DENIED for the buyer.",
2450
2611
  "anyOf": [
2451
2612
  {
2452
2613
  "type": "string"
@@ -2591,6 +2752,17 @@
2591
2752
  "type": "string",
2592
2753
  "description": "Node name. ⚠️ T1 LOSSY POINT (B-1): do NOT name a node 'refund'/'refunded'/'deposit_refunded'/'deposit_deducted'/'disputed'/'cancelled' to model fund return or dispute — funds MUST move through the Allocation waterfall (order_allocators), NOT through Machine terminal nodes (R-M1-11). A node named 'refund' is a semantic lie: reaching it does not move funds by itself. Model refund as a refund-to-Order Allocator slot (a { Signer } or Order-owner recipient), and model dispute as the bound Arbitration, not a Machine node."
2593
2754
  },
2755
+ "role": {
2756
+ "description": "OPTIONAL business role tag for display layers and template reuse (E-9). SESSION METADATA ONLY — the on-chain node struct carries name+pairs, so this is NOT stored on-chain; the MCP echoes it back as a NODE ROLES constraint warning and seed templates annotate it. Semantics: draft = pre-start cancellable, active = work in progress, delivered = work submitted awaiting acceptance, final = settlement endpoint (advancing here should trigger the Allocation fund release), cancelled = refund endpoint (advancing here should trigger the refund Allocator).",
2757
+ "type": "string",
2758
+ "enum": [
2759
+ "draft",
2760
+ "active",
2761
+ "delivered",
2762
+ "final",
2763
+ "cancelled"
2764
+ ]
2765
+ },
2594
2766
  "pairs": {
2595
2767
  "type": "array",
2596
2768
  "items": {
@@ -2622,7 +2794,7 @@
2622
2794
  "description": "Forward name"
2623
2795
  },
2624
2796
  "namedOperator": {
2625
- "description": "Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders).",
2797
+ "description": "Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders). SPECIAL CASE: an EMPTY string ('') on an order-bound forward resolves to the ORDER PAYER — the buyer of the order can advance it (progress::IsNamedOperator treats an empty name + order as the order's own operator). Use '' for buyer-side actions (delivery confirmation, review, return request, pre-ship cancel) instead of binding a merchant-only permission index, which aborts E_PERMISSION_DENIED for the buyer.",
2626
2798
  "anyOf": [
2627
2799
  {
2628
2800
  "type": "string"
@@ -2905,7 +3077,7 @@
2905
3077
  "description": "Forward name"
2906
3078
  },
2907
3079
  "namedOperator": {
2908
- "description": "Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders).",
3080
+ "description": "Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders). SPECIAL CASE: an EMPTY string ('') on an order-bound forward resolves to the ORDER PAYER — the buyer of the order can advance it (progress::IsNamedOperator treats an empty name + order as the order's own operator). Use '' for buyer-side actions (delivery confirmation, review, return request, pre-ship cancel) instead of binding a merchant-only permission index, which aborts E_PERMISSION_DENIED for the buyer.",
2909
3081
  "anyOf": [
2910
3082
  {
2911
3083
  "type": "string"
@@ -3084,7 +3256,7 @@
3084
3256
  "properties": {
3085
3257
  "json_or_markdown_file": {
3086
3258
  "type": "string",
3087
- "description": "Path to a JSON or Markdown file containing node array for COMPLETE REPLACEMENT of all nodes.\n\n**File Format Requirements:**\n- Must contain a JSON ARRAY of node objects: [{\"name\": \"...\", \"pairs\": [...]}, {...}]\n- NOT an operation object with \"op\" field (use NodeSchema for operations)\n- Supports JSON or Markdown (with ```json code blocks)\n\n**Node Structure:**\nEach node is a directed graph element representing workflow states and transitions:\n- name: Node identifier\n- pairs: Array of {prior_node, forwards, threshold} defining connections\n- forwards: Operations available from this node\n- threshold: Required weight to advance\n\n**Behavior:**\n- COMPLETELY REPLACES all existing nodes (equivalent to \"set\" with bReplace=true)\n- Auto-detects format based on file content\n- If parsing fails, error includes line number and column information"
3259
+ "description": "Path to a JSON or Markdown file containing node array for COMPLETE REPLACEMENT of all nodes.\n\n**File Format Requirements:**\n- Must contain a JSON ARRAY of node objects: [{\"name\": \"...\", \"pairs\": [...]}, {...}]\n- NOT an operation object with \"op\" field (use NodeSchema for operations)\n- Supports JSON or Markdown (with ```json code blocks)\n\n**Node Structure:**\nEach node is a directed graph element representing workflow states and transitions:\n- name: Node identifier\n- role: (optional) business role tag for display layers — one of draft/active/delivered/final/cancelled. SESSION METADATA ONLY (not stored on-chain; echoed back as a NODE ROLES warning)\n- pairs: Array of {prior_node, forwards, threshold} defining connections\n- forwards: Operations available from this node\n- threshold: Required weight to advance\n\n**Behavior:**\n- COMPLETELY REPLACES all existing nodes (equivalent to \"set\" with bReplace=true)\n- Auto-detects format based on file content\n- If parsing fails, error includes line number and column information"
3088
3260
  }
3089
3261
  },
3090
3262
  "required": [
@@ -3099,7 +3271,7 @@
3099
3271
  "type": "boolean"
3100
3272
  },
3101
3273
  "publish": {
3102
- "description": "Whether to publish the object. After the object is published, new Progress objects can be generated; and node settings will no longer be changeable.",
3274
+ "description": "Whether to publish the object. After the object is published, new Progress objects can be generated; and node settings will no longer be changeable. ⚠️ Before publishing, enumerate the graph STOP NODES (nodes with no outgoing Pair) plus every waiting state (review window, handover, open dispute) and verify each has a defined fund exit in the Service order_allocators — withdrawal (release) AND refund. Machine + Allocator are immutable after publish (IMMUT-001); an uncovered stop node strands funds permanently (rule R-M5-03, checklist pattern.fund_flow_stop_node_coverage).",
3103
3275
  "type": "boolean"
3104
3276
  },
3105
3277
  "owner_receive": {
@@ -6520,7 +6692,7 @@
6520
6692
  "properties": {
6521
6693
  "coin": {
6522
6694
  "type": "string",
6523
- "description": "Coin object ID or name(local mark). Use a specified Coin object."
6695
+ "description": "Coin object ID or name(local mark). WHOLE-COIN TRANSFER: the ENTIRE Coin object is moved to the recipient — the 'amount' is NOT taken from it (testnet lesson: passing your main gas coin transfers its full balance, leaving you unable to pay for anything). Use only for coins whose whole balance is exactly what you intend to send; prefer {balance: <smallest-unit number>} for partial amounts."
6524
6696
  }
6525
6697
  },
6526
6698
  "required": [
@@ -6574,7 +6746,7 @@
6574
6746
  "type": "string"
6575
6747
  },
6576
6748
  "fee": {
6577
- "description": "Arbitration fee.",
6749
+ "description": "Arbitration filing fee. FORMAT: a direct amount value — NOT wrapped in {balance: ...} (that CoinParam shape is only for dispute.fee, which pays a coin object). Accepted: smallest-unit number or string (e.g. 50000000 = 0.05 WOW at 9 decimals), or display format with the token symbol (e.g. \"0.05WOW\") — the Fund Processing Layer converts it using the Arbitration object's own token decimals. Default 0 on creation: disputes are then free (the filer's coin is fully refunded on filing) and the arbitrator earns no per-case fee.",
6578
6750
  "anyOf": [
6579
6751
  {
6580
6752
  "type": "number"
@@ -6594,7 +6766,7 @@
6594
6766
  "properties": {
6595
6767
  "arb": {
6596
6768
  "type": "string",
6597
- "description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
6769
+ "description": "Arb CASE object — the single dispute case created by `dispute` (the object you may have named via `namedArb`). NOT the arbitrator registration object: that one goes in the ROOT `object` field, while every case-scoped operation (confirm / voting_deadline_change / vote / feedback / arbitration / reset / arb_withdraw) addresses the case through THIS field. Accepts the Arb's 0x address or its LocalMark name."
6598
6770
  },
6599
6771
  "voting_deadline": {
6600
6772
  "default": 0,
@@ -6623,7 +6795,7 @@
6623
6795
  "properties": {
6624
6796
  "arb": {
6625
6797
  "type": "string",
6626
- "description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
6798
+ "description": "Arb CASE object — the single dispute case created by `dispute` (the object you may have named via `namedArb`). NOT the arbitrator registration object: that one goes in the ROOT `object` field, while every case-scoped operation (confirm / voting_deadline_change / vote / feedback / arbitration / reset / arb_withdraw) addresses the case through THIS field. Accepts the Arb's 0x address or its LocalMark name."
6627
6799
  },
6628
6800
  "voting_deadline": {
6629
6801
  "anyOf": [
@@ -6649,7 +6821,7 @@
6649
6821
  "properties": {
6650
6822
  "arb": {
6651
6823
  "type": "string",
6652
- "description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
6824
+ "description": "Arb CASE object — the single dispute case created by `dispute` (the object you may have named via `namedArb`). NOT the arbitrator registration object: that one goes in the ROOT `object` field, while every case-scoped operation (confirm / voting_deadline_change / vote / feedback / arbitration / reset / arb_withdraw) addresses the case through THIS field. Accepts the Arb's 0x address or its LocalMark name."
6653
6825
  },
6654
6826
  "votes": {
6655
6827
  "type": "array",
@@ -6661,7 +6833,7 @@
6661
6833
  "description": "Proposition INDICES (0-based, u8) the voter agrees with — e.g. [0] votes for the first proposition. Re-voting REPLACES the voter's previous vote (old weight removed, new applied). Out-of-range index aborts with E_PROPOSITION_NOT_FOUND."
6662
6834
  },
6663
6835
  "voting_guard": {
6664
- "description": "Optional Voting Guard for weighted voting. THREE PATHS are supported by the SDK and Move contract: (1) voting_guard PROVIDED → Guard-weighted vote (Guard verifies voter + determines vote weight via VoteWeight config); (2) voting_guard OMITTED but other guards trigger passport creation (e.g. env.permission_guard or usage_guard) → permission-only vote via passport; (3) voting_guard OMITTED and no passport context → vote (plain permission-only vote, no Guard). The Guard (when provided) must be in the Arbitration's voting_guard list.",
6836
+ "description": "Voting Guard for WEIGHTED voting. DECISION RULE (contract-enforced):\n(A) Arbitration HAS a non-empty voting_guard list → plain vote is REJECTED on-chain with E_VOTING_GUARD_USED (abort 2). You MUST provide this field set to ONE guard from the Arbitration's voting_guard list, and fill its submission: when the guard's vote_weight is {GuardIdentifier: pos}, the number you submit at that table position IS the vote weight; when it is {FixedValue: v}, no submission is needed (weight is fixed). The SDK then routes the call through the Guard-weighted vote path via a Passport. Omitting this field on such an Arbitration now fails fast pre-call with the list of valid guards.\n(B) Arbitration has NO voting_guard → omit this field; the SDK uses plain vote (weight 1, permission-gated), or the passport-gated vote path when other guards require it.\nBOTH (B) paths still assert ARBITRATION_VOTE=358 on-chain (the SDK now pre-checks 358 and fails fast with 'Missing permissions 358'). An empty voting_guard means EQUAL WEIGHT (1 person 1 vote), NOT permissionless — there is no permission-free vote entry. For genuinely open voting, configure a public voting_guard (op=\"set\") and vote via path (A): the weighted passport path authorizes by the guard and does NOT require 358.\nThe Guard (when provided) MUST be in the Arbitration's voting_guard list — an unlisted guard aborts with E_VOTING_GUARD_NOT_FOUND.",
6665
6837
  "type": "string"
6666
6838
  }
6667
6839
  },
@@ -6677,7 +6849,7 @@
6677
6849
  "properties": {
6678
6850
  "arb": {
6679
6851
  "type": "string",
6680
- "description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
6852
+ "description": "Arb CASE object — the single dispute case created by `dispute` (the object you may have named via `namedArb`). NOT the arbitrator registration object: that one goes in the ROOT `object` field, while every case-scoped operation (confirm / voting_deadline_change / vote / feedback / arbitration / reset / arb_withdraw) addresses the case through THIS field. Accepts the Arb's 0x address or its LocalMark name."
6681
6853
  },
6682
6854
  "feedback": {
6683
6855
  "type": "string",
@@ -6696,7 +6868,7 @@
6696
6868
  "properties": {
6697
6869
  "arb": {
6698
6870
  "type": "string",
6699
- "description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
6871
+ "description": "Arb CASE object — the single dispute case created by `dispute` (the object you may have named via `namedArb`). NOT the arbitrator registration object: that one goes in the ROOT `object` field, while every case-scoped operation (confirm / voting_deadline_change / vote / feedback / arbitration / reset / arb_withdraw) addresses the case through THIS field. Accepts the Arb's 0x address or its LocalMark name."
6700
6872
  },
6701
6873
  "feedback": {
6702
6874
  "type": "string",
@@ -6721,7 +6893,7 @@
6721
6893
  "properties": {
6722
6894
  "arb": {
6723
6895
  "type": "string",
6724
- "description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
6896
+ "description": "Arb CASE object — the single dispute case created by `dispute` (the object you may have named via `namedArb`). NOT the arbitrator registration object: that one goes in the ROOT `object` field, while every case-scoped operation (confirm / voting_deadline_change / vote / feedback / arbitration / reset / arb_withdraw) addresses the case through THIS field. Accepts the Arb's 0x address or its LocalMark name."
6725
6897
  },
6726
6898
  "feedback": {
6727
6899
  "type": "string",
@@ -6735,12 +6907,12 @@
6735
6907
  "additionalProperties": false
6736
6908
  },
6737
6909
  "arb_withdraw": {
6738
- "description": "Withdraw arbitration fees from the Arb object (arbitrator). Immediately from state 5 (Finished); from state 3 only after 30 days from the ruling time (no objection filed — silence = acceptance); rejected in states 0/1/2. State 4 (Objectionable) can NEVER withdraw (protocol 141): a contested case keeps its fee escrowed until the customer closes the objection cycle — reset → order.arb_confirm → new ruling → unchallenged (or accepted via finish).",
6910
+ "description": "Withdraw arbitration fees from the Arb object (arbitrator). Immediately from state 5 (Finished); from state 3 only after 30 days from the ruling time (no objection filed — silence = acceptance); rejected in states 0/1/2. State 4 (Objectionable) can NEVER withdraw (protocol 141): a contested case keeps its fee escrowed until the customer closes the objection cycle — reset → order.arb_confirm → new ruling → unchallenged (or accepted via finish). ⚠️ TWO-STAGE FEE CASH-OUT (verified on testnet): this call does NOT pay the arbitrator's wallet — it moves the case fee into the Arbitration (Registration) object's own balance pool. To actually receive the money: fees_transfer (to a treasury or allocation) → treasury receive: \"recently\" (permission 253) → treasury withdraw → recipient payment receive. A successful arb_withdraw with no wallet balance change is EXPECTED, not a failure.",
6739
6911
  "type": "object",
6740
6912
  "properties": {
6741
6913
  "arb": {
6742
6914
  "type": "string",
6743
- "description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
6915
+ "description": "Arb CASE object — the single dispute case created by `dispute` (the object you may have named via `namedArb`). NOT the arbitrator registration object: that one goes in the ROOT `object` field, while every case-scoped operation (confirm / voting_deadline_change / vote / feedback / arbitration / reset / arb_withdraw) addresses the case through THIS field. Accepts the Arb's 0x address or its LocalMark name."
6744
6916
  }
6745
6917
  },
6746
6918
  "required": [
@@ -6791,7 +6963,7 @@
6791
6963
  "type": "integer",
6792
6964
  "minimum": 0,
6793
6965
  "maximum": 9007199254740991,
6794
- "description": "Payment index."
6966
+ "description": "0-based index of the fee payment inside the Arb case's fees table (query the Arb case with onchain_operations type 'q' / onchain_table_data to list its fees and their indices). REQUIRED — without it the transfer cannot name which fee record to move."
6795
6967
  },
6796
6968
  "newPayment": {
6797
6969
  "description": "Name for the newly created payment object.",
@@ -7085,7 +7257,7 @@
7085
7257
  "object"
7086
7258
  ],
7087
7259
  "additionalProperties": false,
7088
- "description": "On-chain Arbitration operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, type_parameter, permission, ...} to create an Arbitration. NOTE:'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. ⚠️ PERMISSION RULE (contract-enforced): the Arbitration's permission MUST be DIFFERENT from the permission of any Service it will be bound to — binding an Arbitration that SHARES the Service's Permission aborts with E_ARBITRATION_PERMISSION_CONFLICT (error 33). Always create a DEDICATED Permission object for each Arbitration. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation."
7260
+ "description": "On-chain Arbitration operations. TWO OBJECT KINDS — do not confuse them (§5.9): the ROOT 'object' field is the Arbitration (arbitrator REGISTRATION) object; the Arb (single CASE) created by 'dispute' is addressed via each case operation's 'arb' field. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, type_parameter, permission, ...} to create an Arbitration. NOTE:'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. ⚠️ PERMISSION RULE (contract-enforced): the Arbitration's permission MUST be DIFFERENT from the permission of any Service it will be bound to — binding an Arbitration that SHARES the Service's Permission aborts with E_ARBITRATION_PERMISSION_CONFLICT (error 33). Always create a DEDICATED Permission object for each Arbitration. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation."
7089
7261
  },
7090
7262
  "env": {
7091
7263
  "type": "object",
@@ -8885,7 +9057,7 @@
8885
9057
  "properties": {
8886
9058
  "coin": {
8887
9059
  "type": "string",
8888
- "description": "Coin object ID or name(local mark). Use a specified Coin object."
9060
+ "description": "Coin object ID or name(local mark). WHOLE-COIN TRANSFER: the ENTIRE Coin object is moved to the recipient — the 'amount' is NOT taken from it (testnet lesson: passing your main gas coin transfers its full balance, leaving you unable to pay for anything). Use only for coins whose whole balance is exactly what you intend to send; prefer {balance: <smallest-unit number>} for partial amounts."
8889
9061
  }
8890
9062
  },
8891
9063
  "required": [
@@ -10308,7 +10480,7 @@
10308
10480
  "properties": {
10309
10481
  "coin": {
10310
10482
  "type": "string",
10311
- "description": "Coin object ID or name(local mark). Use a specified Coin object."
10483
+ "description": "Coin object ID or name(local mark). WHOLE-COIN TRANSFER: the ENTIRE Coin object is moved to the recipient — the 'amount' is NOT taken from it (testnet lesson: passing your main gas coin transfers its full balance, leaving you unable to pay for anything). Use only for coins whose whole balance is exactly what you intend to send; prefer {balance: <smallest-unit number>} for partial amounts."
10312
10484
  }
10313
10485
  },
10314
10486
  "required": [
@@ -11476,7 +11648,7 @@
11476
11648
  "type": "string"
11477
11649
  }
11478
11650
  ],
11479
- "description": "Allocation value. SEMANTICS DEPEND ON `mode`:\n• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). Allocated first; sum of Amount items cached as `fix`.\n• mode='Rate': basis-points rate, 10000 = 100% (e.g., '7500' for 75%, '2500' for 25%). When no Surplus in same Allocator, sum MUST == 10000; when Surplus present, sum MUST <= 10000.\n• mode='Surplus': IGNORED (contract forces to 0). Set to '0' for clarity. Receives remaining balance after Amount + Rate allocations.\n⚠️ T1 LOSSY POINT (B-2): the value is PRE-CONFIGURED and STATIC. A continuous/conditional amount (e.g. 'pay exactly the assessed loss amount') CANNOT be expressed — there is no runtime formula field. Model variable payouts as (a) a fixed-tier Allocator list guarded by distinct Guards, or (b) an Amount with a `max` cap — both are finite configurations, not free-form formulas."
11651
+ "description": "Allocation value. SEMANTICS DEPEND ON `mode`:\n• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). Allocated first; sum of Amount items cached as `fix`.\n• mode='Rate' (NET): basis-points rate off the post-fix base (balance - fix, or max - fix), 10000 = 100% (e.g., '7500' for 75%, '2500' for 25%). When no Surplus in same Allocator, sum MUST == 10000; when Surplus present, sum MUST <= 10000.\n• mode='RateGross': basis-points rate off the FULL pool (balance) or the `max` cap — the fixed Amount total is NOT subtracted, 10000 = 100%. sum MUST <= 10000 (and, with `max` set, fix×10000 + sum×max <= max×10000). Cannot be mixed with mode='Rate' in the same Allocator while a fixed Amount total is present.\n• mode='Surplus': IGNORED (contract forces to 0). Set to '0' for clarity. Receives remaining balance after Amount + Rate/RateGross allocations.\n⚠️ T1 LOSSY POINT (B-2): the value is PRE-CONFIGURED and STATIC. A continuous/conditional amount (e.g. 'pay exactly the assessed loss amount') CANNOT be expressed — there is no runtime formula field. Model variable payouts as (a) a fixed-tier Allocator list guarded by distinct Guards, or (b) an Amount with a `max` cap — both are finite configurations, not free-form formulas."
11480
11652
  },
11481
11653
  "mode": {
11482
11654
  "anyOf": [
@@ -11485,12 +11657,13 @@
11485
11657
  "enum": [
11486
11658
  "Amount",
11487
11659
  "Rate",
11488
- "Surplus"
11660
+ "Surplus",
11661
+ "RateGross"
11489
11662
  ]
11490
11663
  },
11491
11664
  {}
11492
11665
  ],
11493
- "description": "Allocation mode — determines how the `sharing` field is interpreted. Three modes can be used individually OR combined within a single Allocator; when combined, allocation order is strictly: Amount first, then Rate, then Surplus. Understanding these modes allows modeling almost any fund distribution pattern.\n• Amount (0): `sharing` is a FIXED amount in smallest unit (e.g., '750000000' = 0.75 WOW). Allocated FIRST; sum of all Amount items is cached as `fix` by the contract. Validation: when no Rate and no Surplus items exist, sum of Amount items must be >= allocators.threshold (EAMOUNT_BELOW_THRESHOLD=12); when `max` is set, sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13).\n• Rate (1): `sharing` is a basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance - fix (or max - fix if `max` is set). Validation: when no Surplus items exist, sum of all Rate items must be EXACTLY 10000 (ERATE_NOT_10000=4); when Surplus items exist, sum of all Rate items must be <= 10000 (ERATE_EXCEEDS_10000=6).\n• Surplus (2): `sharing` is IGNORED (contract forces it to 0). Allocated LAST; receives the remaining balance after Amount + Rate allocations. Validation: MAX ONE Surplus item per Allocator (EMULTIPLE_SURPLUS=5). When Surplus exists, Rate sum constraint relaxes from == 10000 to <= 10000.\nALLOCATION ORDER (strict): Amount items (fixed, cached as fix) → Rate items (proportional to balance-fix) → Surplus item (remaining).\nRECOMMENDATION: Use Amount mode for known fixed amounts (clearer, no sum constraint). Use Rate mode for proportional splits (requires sum == 10000 unless Surplus present). Use Surplus to capture remainder (e.g., platform fee + host gets rest). Accepts string ('Amount'/'Rate'/'Surplus', recommended) or number (0/1/2)."
11666
+ "description": "Allocation mode — determines how the `sharing` field is interpreted. Four modes can be used individually OR combined within a single Allocator; when combined, allocation order is strictly: Amount first, then Rate/RateGross, then Surplus. Understanding these modes allows modeling almost any fund distribution pattern.\n• Amount (0): `sharing` is a FIXED amount in smallest unit (e.g., '750000000' = 0.75 WOW). Allocated FIRST; sum of all Amount items is cached as `fix` by the contract. Validation: when no Rate and no Surplus items exist, sum of Amount items must be >= allocators.threshold (EAMOUNT_BELOW_THRESHOLD=12); when `max` is set, sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13).\n• Rate (1): `sharing` is a NET basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance - fix (or max - fix if `max` is set) — the cached fixed Amount total IS subtracted. Validation: when no Surplus items exist, sum of all Rate items must be EXACTLY 10000 (ERATE_NOT_10000=4); when Surplus items exist, sum of all Rate items must be <= 10000 (ERATE_EXCEEDS_10000=6).\n• RateGross (3): `sharing` is a GROSS basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance (the full pool) or the `max` cap when set — the fixed Amount total is NOT subtracted, so fixed Amount entries and percentage-of-total rates coexist exactly. Validation: sum of all RateGross items must be <= 10000 (ERATE_EXCEEDS_10000=6); when `max` is set, fix×10000 + sum(rate)×max <= max×10000 must hold (6); with no `max` and a fixed total > 0, sum of RateGross items must be < 10000 (6). RateGross cannot be mixed with NET Rate entries in the same Allocator while a fixed Amount total is present (EMIXED_RATE_BASES=17).\n• Surplus (2): `sharing` is IGNORED (contract forces it to 0). Allocated LAST; receives the remaining balance after Amount + Rate allocations. Validation: MAX ONE Surplus item per Allocator (EMULTIPLE_SURPLUS=5). When Surplus exists, Rate sum constraint relaxes from == 10000 to <= 10000.\nALLOCATION ORDER (strict): Amount items (fixed, cached as fix) → Rate/RateGross items → Surplus item (remaining).\nRECOMMENDATION: Use Amount mode for known fixed amounts (clearer, no sum constraint). Use Rate mode for proportional splits off the post-fix remainder (requires sum == 10000 unless Surplus present). Use RateGross mode for a percentage of the FULL pool/`max` that must coexist with fixed Amount entries. Use Surplus to capture remainder (e.g., platform fee + host gets rest). Accepts string ('Amount'/'Rate'/'Surplus'/'RateGross', recommended) or number (0/1/2/3)."
11494
11667
  }
11495
11668
  },
11496
11669
  "required": [
@@ -11499,12 +11672,12 @@
11499
11672
  "mode"
11500
11673
  ],
11501
11674
  "additionalProperties": false,
11502
- "description": "Fund allocation item — one recipient's share of the Allocation balance. The `sharing` value's meaning depends on `mode` (see AllocationModeSchema). Multiple items in the same Allocator are evaluated together: Amount items first, Rate items second, Surplus last."
11675
+ "description": "Fund allocation item — one recipient's share of the Allocation balance. The `sharing` value's meaning depends on `mode` (see AllocationModeSchema). Multiple items in the same Allocator are evaluated together: Amount items first, Rate/RateGross items second, Surplus last."
11503
11676
  },
11504
- "description": "Fund allocation item list. Each item specifies a recipient (who), a value (sharing), and a mode. Items can mix modes (Amount + Rate + Surplus) within the same Allocator. RECIPIENT SEMANTICS: the Guard constrains what each submission slot may be; a recipient's safety follows from the sufficiency of those constraints (run the recipient constraint audit). Canonical order pattern: recipient = the single submitted Order — funds land at that object and are receivable only by its owner. ALLOCATION ORDER: Amount items first (cached as fix) → Rate items (proportional to balance - fix) → Surplus item (remaining). CONSTRAINTS: max ONE Surplus item per Allocator; Rate sum must == 10000 (no Surplus) or <= 10000 (with Surplus); Amount sum must >= threshold (no Rate and no Surplus) and <= max (if max set)."
11677
+ "description": "Fund allocation item list. Each item specifies a recipient (who), a value (sharing), and a mode. Items can mix modes (Amount + Rate/RateGross + Surplus) within the same Allocator. RECIPIENT SEMANTICS: the Guard constrains what each submission slot may be; a recipient's safety follows from the sufficiency of those constraints (run the recipient constraint audit). Canonical order pattern: recipient = the single submitted Order — funds land at that object and are receivable only by its owner. ALLOCATION ORDER: Amount items first (cached as fix) → Rate items (proportional to balance - fix; RateGross proportional to the full pool) → Surplus item (remaining). CONSTRAINTS: max ONE Surplus item per Allocator; NET Rate sum must == 10000 (no Surplus) or <= 10000 (with Surplus); RateGross sum must <= 10000 (never mixed with NET Rate while a fixed total is present); Amount sum must >= threshold (no Rate and no Surplus) and <= max (if max set)."
11505
11678
  },
11506
11679
  "fix": {
11507
- "description": "OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. Computed by the contract when the allocator is added — DO NOT set this field at creation. Used internally to compute `total_rates = balance - fix` for Rate allocation.",
11680
+ "description": "OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. Computed by the contract when the allocator is added — DO NOT set this field at creation. Used internally to compute `total_rates = balance - fix` for NET Rate allocation (RateGross ignores fix and uses the full pool/`max`).",
11508
11681
  "anyOf": [
11509
11682
  {
11510
11683
  "type": "number"
@@ -11515,7 +11688,7 @@
11515
11688
  ]
11516
11689
  },
11517
11690
  "max": {
11518
- "description": "Maximum allocation cap (OPTIONAL — omit the field or set to null to disable the cap; do NOT set to 0 as that means a cap of zero). Passed through to the contract as Option<u64> when the allocator is added: when null/omitted the contract treats it as `none` (no cap); when set, the contract enforces it. Has THREE effects when set:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: total_rates = max - fix (instead of balance - fix)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort.",
11691
+ "description": "Maximum allocation cap (OPTIONAL — omit the field or set to null to disable the cap; do NOT set to 0 as that means a cap of zero). Passed through to the contract as Option<u64> when the allocator is added: when null/omitted the contract treats it as `none` (no cap); when set, the contract enforces it. Has THREE effects when set:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: NET Rate total_rates = max - fix; RateGross total_rates = max (fix NOT subtracted)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort.",
11519
11692
  "anyOf": [
11520
11693
  {
11521
11694
  "anyOf": [
@@ -11539,7 +11712,7 @@
11539
11712
  "sharing"
11540
11713
  ],
11541
11714
  "additionalProperties": false,
11542
- "description": "Fund allocator — a complete allocation strategy triggered by a Guard. Contains a sharing[] array where items can mix Amount/Rate/Surplus modes. When the Guard passes, the contract allocates funds in strict order: Amount → Rate → Surplus."
11715
+ "description": "Fund allocator — a complete allocation strategy triggered by a Guard. Contains a sharing[] array where items can mix Amount/Rate/RateGross/Surplus modes. When the Guard passes, the contract allocates funds in strict order: Amount → Rate/RateGross → Surplus."
11543
11716
  },
11544
11717
  "description": "Fund allocator list. Each allocator is evaluated in order; the FIRST allocator whose Guard passes wins. This enables mutually exclusive allocation paths (e.g., 3 allocators for 3 forward paths: refund / damage-deduct / arbitrate)."
11545
11718
  }
@@ -11550,7 +11723,7 @@
11550
11723
  "allocators"
11551
11724
  ],
11552
11725
  "additionalProperties": false,
11553
- "description": "Fund allocator list — the top-level allocation configuration attached to an Order. Contains a threshold and a list of Allocators. When funds arrive at the Order, the first Allocator whose Guard passes executes its sharing[] in strict order: Amount → Rate → Surplus. MULTI-TIER ALLOCATION (DOC-04): Each Order binds ONE Allocators template (set on Service.order_allocators before publish). For multi-tier distribution (e.g., customer→agency→suppliers), use a two-phase approach: (1) Tier-1 Allocators on the customer's Order (allocates to agency + refund fund); (2) Tier-2 Allocators on a NEW Order created by the agency (allocates agency's received funds to suppliers). Each tier's Rate-mode sharing[] must independently sum to 10000 (or <= 10000 with Surplus)."
11726
+ "description": "Fund allocator list — the top-level allocation configuration attached to an Order. Contains a threshold and a list of Allocators. When funds arrive at the Order, the first Allocator whose Guard passes executes its sharing[] in strict order: Amount → Rate/RateGross → Surplus. MULTI-TIER ALLOCATION (DOC-04): Each Order binds ONE Allocators template (set on Service.order_allocators before publish). For multi-tier distribution (e.g., customer→agency→suppliers), use a two-phase approach: (1) Tier-1 Allocators on the customer's Order (allocates to agency + refund fund); (2) Tier-2 Allocators on a NEW Order created by the agency (allocates agency's received funds to suppliers). Each tier's NET Rate-mode sharing[] must independently sum to 10000 (or <= 10000 with Surplus); RateGross-mode sharing[] must sum to <= 10000."
11554
11727
  },
11555
11728
  "coin": {
11556
11729
  "anyOf": [
@@ -11580,7 +11753,7 @@
11580
11753
  "properties": {
11581
11754
  "coin": {
11582
11755
  "type": "string",
11583
- "description": "Coin object ID or name(local mark). Use a specified Coin object."
11756
+ "description": "Coin object ID or name(local mark). WHOLE-COIN TRANSFER: the ENTIRE Coin object is moved to the recipient — the 'amount' is NOT taken from it (testnet lesson: passing your main gas coin transfers its full balance, leaving you unable to pay for anything). Use only for coins whose whole balance is exactly what you intend to send; prefer {balance: <smallest-unit number>} for partial amounts."
11584
11757
  }
11585
11758
  },
11586
11759
  "required": [
@@ -17868,7 +18041,7 @@
17868
18041
  "properties": {
17869
18042
  "coin": {
17870
18043
  "type": "string",
17871
- "description": "Coin object ID or name(local mark). Use a specified Coin object."
18044
+ "description": "Coin object ID or name(local mark). WHOLE-COIN TRANSFER: the ENTIRE Coin object is moved to the recipient — the 'amount' is NOT taken from it (testnet lesson: passing your main gas coin transfers its full balance, leaving you unable to pay for anything). Use only for coins whose whole balance is exactly what you intend to send; prefer {balance: <smallest-unit number>} for partial amounts."
17872
18045
  }
17873
18046
  },
17874
18047
  "required": [
@@ -17967,7 +18140,7 @@
17967
18140
  "receive"
17968
18141
  ],
17969
18142
  "additionalProperties": false,
17970
- "description": "Receive mode: unwrap a CoinWrapper to the caller's wallet. Use after Allocation's alloc_by_guard creates a Payment with your address as a revenue recipient. The CoinWrapper holds your share — call this to convert it to actual coins in your wallet. Provide 'object' to unwrap a specific CoinWrapper, or OMIT it to auto-unwrap every CoinWrapper owned by the caller."
18143
+ "description": "Receive mode: unwrap a CoinWrapper to the caller's wallet. Use after Allocation's alloc_by_guard creates a Payment with your address as a revenue recipient. The CoinWrapper holds your share — call this to convert it to actual coins in your wallet. Provide 'object' to unwrap a specific CoinWrapper, or OMIT it to auto-unwrap every CoinWrapper owned by the caller. AUTO-CLAIM: when the allocation SIGNER and the recipient are the SAME account, the share is credited directly during settlement and NO CoinWrapper is created — a 'no CoinWrapper found' result in that case means the funds already arrived (verify via account_balance), it is NOT a failure."
17971
18144
  }
17972
18145
  ],
17973
18146
  "description": "On-chain Payment operations. TWO modes:\n(1) CREATE: Set 'object' with {name, type_parameter, ...}, 'revenue', and 'info' to create a new Payment.\n(2) RECEIVE: Set {receive: true} to unwrap CoinWrappers to your wallet. Provide 'object' (<coinwrapper_id_or_name>) to unwrap a specific one, or OMIT it to auto-unwrap every CoinWrapper owned by the caller. type_parameter optional — auto-derived from the CoinWrapper's type."
@@ -19232,7 +19405,7 @@
19232
19405
  "additionalProperties": false
19233
19406
  },
19234
19407
  "required_info": {
19235
- "description": "Contact object ID (recipient) or WTS Proof object (delivery proof) that information has been delivered via Wowok Messenger.",
19408
+ "description": "Credential recorded on the order: the merchant's IM user address resolved from the Service's Contact (zero cost) or a WTS Proof object id (on-chain delivery proof embedding that IM address and timestamp; costs gas). The information itself is delivered via Wowok Messenger.",
19236
19409
  "anyOf": [
19237
19410
  {
19238
19411
  "type": "string",