@wowok/agent-mcp 2.6.1 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/customer/customer-advice.d.ts +31 -0
- package/dist/customer/customer-advice.js +129 -0
- package/dist/customer/index.d.ts +2 -0
- package/dist/customer/index.js +2 -0
- package/dist/customer/info-puzzle.d.ts +9 -2
- package/dist/customer/info-puzzle.js +34 -7
- package/dist/customer/order-monitor.d.ts +2 -0
- package/dist/customer/order-monitor.js +3 -2
- package/dist/customer/post-purchase.d.ts +2 -0
- package/dist/customer/post-purchase.js +6 -5
- package/dist/customer/preorder-compare.d.ts +24 -0
- package/dist/customer/preorder-compare.js +34 -0
- package/dist/customer/reminder-system.d.ts +2 -0
- package/dist/customer/reminder-system.js +2 -1
- package/dist/customer/risk-assessment.js +30 -7
- package/dist/customer/types.d.ts +7 -0
- package/dist/examples/arbitration-dispute-create.json +41 -0
- package/dist/examples/arbitration-vote-weighted.json +35 -0
- package/dist/examples/arbitration-voting-guard-add.json +38 -0
- package/dist/examples/demand-present-service.json +33 -0
- package/dist/examples/gen-passport-verify-guard.json +48 -0
- package/dist/examples/guard-template-balance-check.json +59 -0
- package/dist/examples/guard-template-time-lock.json +60 -0
- package/dist/examples/insurance-guard-claim-timelock.json +75 -0
- package/dist/examples/insurance-guard-withdraw-allocation.json +96 -0
- package/dist/examples/insurance-machine-create-publish.json +75 -0
- package/dist/examples/insurance-service-allocators-publish.json +56 -0
- package/dist/examples/machine-multisig-threshold.json +86 -0
- package/dist/examples/machine-template-7node-rental.json +119 -0
- package/dist/examples/payment-scenario-bound.json +45 -0
- package/dist/examples/rental-ziroom-machine-create.json +149 -0
- package/dist/examples/rental-ziroom-permission-create.json +42 -0
- package/dist/examples/rental-ziroom-service-create.json +89 -0
- package/dist/examples/retail-adv-guard-customer-win-create.json +80 -0
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +65 -0
- package/dist/examples/retail-adv-guard-reward-timeout-create.json +92 -0
- package/dist/examples/retail-adv-reward-guard-add.json +51 -0
- package/dist/examples/retail-myshop-allocation-activate.json +55 -0
- package/dist/examples/retail-myshop-arbitration-create.json +40 -0
- package/dist/examples/retail-myshop-contact-create.json +43 -0
- package/dist/examples/retail-myshop-order-create.json +56 -0
- package/dist/examples/retail-myshop-progress-operate.json +38 -0
- package/dist/examples/retail-myshop-reward-create.json +35 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/examples/service-discount-issue.json +46 -0
- package/dist/examples/threebody-guard-create.json +56 -0
- package/dist/examples/threebody-machine-create.json +72 -0
- package/dist/examples/threebody-permission-create.json +38 -0
- package/dist/examples/threebody-service-allocators.json +49 -0
- package/dist/examples/travel-guard-time-lock.json +69 -0
- package/dist/examples/travel-guard-weather-oracle.json +70 -0
- package/dist/examples/travel-machine-create.json +136 -0
- package/dist/examples/travel-repository-create.json +47 -0
- package/dist/examples/travel-service-create.json +102 -0
- package/dist/examples/travel-treasury-create.json +34 -0
- package/dist/examples/treasury-deposit.json +37 -0
- package/dist/examples/treasury-withdraw.json +38 -0
- package/dist/extensions/business-modules.d.ts +49 -0
- package/dist/extensions/business-modules.js +287 -0
- package/dist/extensions/capability-manifest.js +216 -29
- package/dist/extensions/constraint-registry.js +21 -19
- package/dist/extensions/metric-registry.js +14 -14
- package/dist/extensions/mode-evaluator.js +16 -16
- package/dist/extensions/modes.js +141 -49
- package/dist/extensions/registry.d.ts +16 -9
- package/dist/extensions/registry.js +132 -44
- package/dist/extensions/types.d.ts +2 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +138 -0
- package/dist/knowledge/fund-layer.js +969 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/guard-templates.d.ts +10 -0
- package/dist/knowledge/guard-templates.js +50 -0
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +2 -2
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-risk.js +4 -1
- package/dist/knowledge/machine-templates.js +4 -4
- package/dist/knowledge/progress-context.js +1 -1
- package/dist/knowledge/progress-ledger.js +3 -3
- package/dist/knowledge/progress-templates.js +1 -1
- package/dist/knowledge/progress-translation.js +1 -1
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/safety-rules.d.ts +83 -1
- package/dist/knowledge/safety-rules.js +166 -2
- package/dist/knowledge/scenario-modes.d.ts +1 -1
- package/dist/knowledge/scenario-modes.js +13 -11
- package/dist/knowledge/service-confirm.d.ts +1 -1
- package/dist/knowledge/service-confirm.js +3 -3
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- package/dist/knowledge/template-registry.d.ts +48 -0
- package/dist/knowledge/template-registry.js +341 -0
- package/dist/knowledge/tool-constraints.js +6 -6
- package/dist/knowledge/tools-reference.js +11 -8
- package/dist/participation/merchant-interest.d.ts +32 -0
- package/dist/participation/merchant-interest.js +100 -0
- package/dist/participation/radar-core.d.ts +104 -0
- package/dist/participation/radar-core.js +269 -0
- package/dist/project/context-assembly.js +8 -0
- package/dist/project/deployment-bridge.js +6 -5
- package/dist/project/deployment-doc.js +5 -5
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1342 -0
- package/dist/project/evaluation.d.ts +36 -0
- package/dist/project/evaluation.js +734 -68
- package/dist/project/game-theory.d.ts +43 -0
- package/dist/project/game-theory.js +177 -0
- package/dist/project/graph-builder.js +7 -1
- package/dist/project/handlers.d.ts +137 -2
- package/dist/project/handlers.js +423 -51
- package/dist/project/intent-analyzer.d.ts +71 -0
- package/dist/project/intent-analyzer.js +149 -0
- package/dist/project/machine-nodes.d.ts +2 -0
- package/dist/project/machine-nodes.js +36 -0
- package/dist/project/merchant-guide.d.ts +165 -0
- package/dist/project/merchant-guide.js +264 -0
- package/dist/project/mode-actions.d.ts +199 -0
- package/dist/project/mode-actions.js +309 -0
- package/dist/project/participation-radar.d.ts +18 -0
- package/dist/project/participation-radar.js +428 -0
- package/dist/project/pipeline-actions.d.ts +101 -0
- package/dist/project/pipeline-actions.js +109 -0
- package/dist/project/semantic-graph.d.ts +95 -0
- package/dist/project/semantic-graph.js +245 -0
- package/dist/project/stage-gate.js +4 -4
- package/dist/schema/call/allocation.d.ts +11 -11
- package/dist/schema/call/allocation.js +13 -3
- package/dist/schema/call/arbitration.d.ts +21 -21
- package/dist/schema/call/arbitration.js +30 -9
- package/dist/schema/call/base.d.ts +2 -2
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +127 -127
- package/dist/schema/call/bridge.js +12 -12
- package/dist/schema/call/contact.d.ts +3 -3
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +3 -3
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +2072 -679
- package/dist/schema/call/machine.js +51 -5
- package/dist/schema/call/order.d.ts +7 -7
- package/dist/schema/call/order.js +3 -6
- package/dist/schema/call/payment.d.ts +3 -3
- package/dist/schema/call/permission.d.ts +3 -3
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/personal.d.ts +337 -3
- package/dist/schema/call/personal.js +10 -0
- package/dist/schema/call/progress.d.ts +177 -9
- package/dist/schema/call/progress.js +7 -3
- package/dist/schema/call/proof.d.ts +6 -6
- package/dist/schema/call/repository.d.ts +3 -3
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.d.ts +57 -57
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.js +48 -2
- package/dist/schema/call/service.d.ts +285 -113
- package/dist/schema/call/service.js +92 -28
- package/dist/schema/call/treasury.d.ts +57 -57
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +2 -0
- package/dist/schema/common/index.js +46 -10
- package/dist/schema/local/index.js +5 -1
- package/dist/schema/messenger/index.js +4 -1
- package/dist/schema/operations.d.ts +1318 -317
- package/dist/schema/operations.js +76 -7
- package/dist/schema/project/index.d.ts +5662 -164
- package/dist/schema/project/index.js +1136 -5
- package/dist/schema/query/index.d.ts +580 -19
- package/dist/schema/query/index.js +88 -36
- package/dist/schema/schema-query/index.d.ts +59 -3
- package/dist/schema/schema-query/index.js +45 -6
- package/dist/schema/trust/index.d.ts +1012 -6
- package/dist/schema/trust/index.js +212 -11
- package/dist/schema/utils/node-parser.js +13 -0
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +77 -0
- package/dist/schema-query/index.d.ts +17 -1
- package/dist/schema-query/index.js +359 -3
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/bridge_operation.schema.json +14 -7
- package/dist/schemas/guard2file.schema.json +2 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +2 -0
- package/dist/schemas/messenger_operation.schema.json +1 -1
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +255 -65
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +14 -10
- package/dist/schemas/onchain_operations_contact.schema.json +4 -3
- package/dist/schemas/onchain_operations_demand.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -2
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
- package/dist/schemas/onchain_operations_guard.schema.json +579 -1
- package/dist/schemas/onchain_operations_machine.schema.json +5 -4
- package/dist/schemas/onchain_operations_order.schema.json +7 -6
- package/dist/schemas/onchain_operations_payment.schema.json +2 -1
- package/dist/schemas/onchain_operations_permission.schema.json +3 -2
- package/dist/schemas/onchain_operations_personal.schema.json +37 -0
- package/dist/schemas/onchain_operations_progress.schema.json +91 -4
- package/dist/schemas/onchain_operations_proof.schema.json +2 -1
- package/dist/schemas/onchain_operations_repository.schema.json +4 -3
- package/dist/schemas/onchain_operations_reward.schema.json +7 -6
- package/dist/schemas/onchain_operations_service.schema.json +80 -19
- package/dist/schemas/onchain_operations_treasury.schema.json +5 -4
- package/dist/schemas/onchain_table_data.output.json +1 -1
- package/dist/schemas/onchain_table_data.schema.json +10 -9
- package/dist/schemas/project_operation.output.json +3318 -57
- package/dist/schemas/project_operation.schema.json +728 -4
- package/dist/schemas/query_toolkit.output.json +16 -16
- package/dist/schemas/query_toolkit.schema.json +40 -3
- package/dist/schemas/schema_query.output.json +65 -2
- package/dist/schemas/schema_query.schema.json +31 -5
- package/dist/schemas/trust_score.output.json +392 -1
- package/dist/schemas/trust_score.schema.json +275 -1
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/onchain.js +636 -6
- package/dist/tools/handlers/project.js +71 -2
- package/dist/tools/handlers/query.js +117 -2
- package/dist/tools/handlers/schema-query.js +65 -1
- package/dist/tools/handlers/trust.js +192 -6
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +229 -15
- package/dist/tools/wrap.js +194 -15
- package/package.json +2 -2
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Machine Template: 2-of-3 Multi-Sig Approval Workflow (threshold > 1)",
|
|
3
|
+
"description": "Four-node workflow where the 'approved' node requires cumulative weight 2 from three distinct approver forwards (permissionIndex 1001/1002/1003, weight 1 each) — the on-chain multi-signature approval pattern.",
|
|
4
|
+
"tags": ["machine", "template", "multisig", "threshold", "approval", "governance"],
|
|
5
|
+
"industry": "general",
|
|
6
|
+
"operation_type": "machine",
|
|
7
|
+
"source": "constructed under T-09 authorization; grounded in MachineNodePairSchema threshold + MachineForwardSchema weight — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "machine",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "multisig_approval_machine"
|
|
16
|
+
},
|
|
17
|
+
"node": {
|
|
18
|
+
"op": "add",
|
|
19
|
+
"bReplace": true,
|
|
20
|
+
"nodes": [
|
|
21
|
+
{
|
|
22
|
+
"name": "submitted",
|
|
23
|
+
"pairs": [
|
|
24
|
+
{
|
|
25
|
+
"prev_node": "",
|
|
26
|
+
"threshold": 1,
|
|
27
|
+
"forwards": [
|
|
28
|
+
{ "name": "Submit", "weight": 1, "namedOperator": "" }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "under_review",
|
|
35
|
+
"pairs": [
|
|
36
|
+
{
|
|
37
|
+
"prev_node": "submitted",
|
|
38
|
+
"threshold": 1,
|
|
39
|
+
"forwards": [
|
|
40
|
+
{ "name": "Start Review", "weight": 1, "permissionIndex": 1000 }
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "approved",
|
|
47
|
+
"pairs": [
|
|
48
|
+
{
|
|
49
|
+
"prev_node": "under_review",
|
|
50
|
+
"threshold": 2,
|
|
51
|
+
"forwards": [
|
|
52
|
+
{ "name": "Approve Alice", "weight": 1, "permissionIndex": 1001 },
|
|
53
|
+
{ "name": "Approve Bob", "weight": 1, "permissionIndex": 1002 },
|
|
54
|
+
{ "name": "Approve Carol", "weight": 1, "permissionIndex": 1003 }
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "completed",
|
|
61
|
+
"pairs": [
|
|
62
|
+
{
|
|
63
|
+
"prev_node": "approved",
|
|
64
|
+
"threshold": 1,
|
|
65
|
+
"forwards": [
|
|
66
|
+
{ "name": "Finalize", "weight": 1, "permissionIndex": 1000 }
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"env": {
|
|
75
|
+
"network": "testnet"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"notes": [
|
|
79
|
+
"MULTI-SIG MECHANICS: pair threshold=2 means Progress advances from 'under_review' to 'approved' only when the CUMULATIVE weight of completed DISTINCT forwards on that pair reaches 2. Each of the three approver forwards contributes weight 1, so any 2 of the 3 approvers must act — a 2-of-3 signature scheme.",
|
|
80
|
+
"Each approver calls progress operate with their OWN forward name (e.g. 'Approve Alice'). The same forward cannot be double-counted; distinct forwards by the same operator would still count separately, so map each forward to a distinct permissionIndex (1001/1002/1003 = three approver roles in the Permission table).",
|
|
81
|
+
"threshold semantics (MachineNodePairSchema): 'If total Forward weight is greater than or equal to threshold, node advancement is triggered.' Weighted variants are possible — e.g. give a senior approver weight 2 so they can approve alone (threshold 2 met by one forward).",
|
|
82
|
+
"Entry-node rule: 'submitted' has prev_node='' with at least one forward (schema-enforced FIX-002). namedOperator='' = order owner; permissionIndex references Permission table entries.",
|
|
83
|
+
"Compare with machine-template-7node-rental.json where every pair uses threshold 1 (single-signature sequential flow).",
|
|
84
|
+
"This Machine is a TEMPLATE object: bind it to a Service and each order gets a Progress instance whose multi-sig approvals are tracked per order."
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Machine Template: 7-Node Rental Workflow (Simplified, R-M1-11 Compliant)",
|
|
3
|
+
"description": "Simplified rental workflow without damage/arbitration paths. Refund flows through an Allocator triggered by the return_approved routing node — never through a Machine terminal node.",
|
|
4
|
+
"tags": ["machine", "template", "rental", "simplified", "r-m1-11"],
|
|
5
|
+
"industry": "rental",
|
|
6
|
+
"operation_type": "machine",
|
|
7
|
+
"source": "template",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "machine",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "rental_machine_simple"
|
|
16
|
+
},
|
|
17
|
+
"node": {
|
|
18
|
+
"op": "add",
|
|
19
|
+
"bReplace": true,
|
|
20
|
+
"nodes": [
|
|
21
|
+
{
|
|
22
|
+
"name": "reserved",
|
|
23
|
+
"pairs": [
|
|
24
|
+
{
|
|
25
|
+
"prev_node": "",
|
|
26
|
+
"threshold": 1,
|
|
27
|
+
"forwards": [
|
|
28
|
+
{ "name": "Pay", "weight": 1, "namedOperator": "" }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "paid",
|
|
35
|
+
"pairs": [
|
|
36
|
+
{
|
|
37
|
+
"prev_node": "reserved",
|
|
38
|
+
"threshold": 1,
|
|
39
|
+
"forwards": [
|
|
40
|
+
{ "name": "Confirm Payment", "weight": 1, "permissionIndex": 1000 }
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "in_use",
|
|
47
|
+
"pairs": [
|
|
48
|
+
{
|
|
49
|
+
"prev_node": "paid",
|
|
50
|
+
"threshold": 1,
|
|
51
|
+
"forwards": [
|
|
52
|
+
{ "name": "Deliver Item", "weight": 1, "permissionIndex": 1000 }
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "returned",
|
|
59
|
+
"pairs": [
|
|
60
|
+
{
|
|
61
|
+
"prev_node": "in_use",
|
|
62
|
+
"threshold": 1,
|
|
63
|
+
"forwards": [
|
|
64
|
+
{ "name": "Return Item", "weight": 1, "namedOperator": "" }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "inspected",
|
|
71
|
+
"pairs": [
|
|
72
|
+
{
|
|
73
|
+
"prev_node": "returned",
|
|
74
|
+
"threshold": 1,
|
|
75
|
+
"forwards": [
|
|
76
|
+
{ "name": "Inspect", "weight": 1, "permissionIndex": 1001 }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "return_approved",
|
|
83
|
+
"pairs": [
|
|
84
|
+
{
|
|
85
|
+
"prev_node": "inspected",
|
|
86
|
+
"threshold": 1,
|
|
87
|
+
"forwards": [
|
|
88
|
+
{ "name": "Approve Return", "weight": 1, "permissionIndex": 1002 }
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "completed",
|
|
95
|
+
"pairs": [
|
|
96
|
+
{
|
|
97
|
+
"prev_node": "return_approved",
|
|
98
|
+
"threshold": 1,
|
|
99
|
+
"forwards": [
|
|
100
|
+
{ "name": "Complete", "weight": 1, "permissionIndex": 1000 }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"env": {
|
|
109
|
+
"network": "testnet"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"notes": [
|
|
113
|
+
"R-M1-11: 'return_approved' is a ROUTING node — the actual refund MUST be executed by an Allocator (bound via Service.order_allocators) whose Guard checks progress.current == 'return_approved'. A node named 'refunded' implies the Machine itself moves funds, which Machines cannot do; funds would lock in the Order escrow.",
|
|
114
|
+
"Forwards describe INCOMING transitions: the forward in a node's pair (prev_node='X') is the action that advances Progress FROM X INTO this node.",
|
|
115
|
+
"The entry node (prev_node='') MUST have at least one forward — schema-enforced (FIX-002).",
|
|
116
|
+
"namedOperator='' means OrderHolder (customer). permissionIndex references Permission table entries (1000=operator, 1001=inspector, 1002=finance).",
|
|
117
|
+
"Simplified version — no damage or arbitration paths. Use for short-term rentals without damage risk."
|
|
118
|
+
]
|
|
119
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Scenario-Bound Payment (for_object + for_guard)",
|
|
3
|
+
"description": "Create a Payment of 0.05 WOW to alice whose payment_info binds it to a Demand object and a KYC Guard, making the fund flow auditable against a business scenario.",
|
|
4
|
+
"tags": ["payment", "scenario", "for_object", "for_guard", "audit"],
|
|
5
|
+
"industry": "general",
|
|
6
|
+
"operation_type": "payment",
|
|
7
|
+
"source": "constructed under T-09 authorization; grounded in CallPayment_CreateSchema + PaymentInfoSchema — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "payment",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "kyc_bounty_payment_v1",
|
|
16
|
+
"type_parameter": "0x2::wow::WOW"
|
|
17
|
+
},
|
|
18
|
+
"revenue": [
|
|
19
|
+
{
|
|
20
|
+
"recipient": { "name_or_address": "alice" },
|
|
21
|
+
"amount": { "balance": 50000000 }
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"info": {
|
|
25
|
+
"for_object": "toy_repair_demand_v1",
|
|
26
|
+
"for_guard": "kyc_level_guard",
|
|
27
|
+
"remark": "Bounty payout for completed KYC verification demand",
|
|
28
|
+
"index": 0
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"env": {
|
|
32
|
+
"network": "testnet",
|
|
33
|
+
"no_cache": true,
|
|
34
|
+
"confirmed": true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"notes": [
|
|
38
|
+
"SCENARIO BINDING: info.for_object ties the Payment to a business object (here the Demand it settles); info.for_guard ties it to the Guard whose verification justified the payout (here the KYC Guard). Both are optional but together make the payment self-describing on-chain — auditors can trace WHY the money moved.",
|
|
39
|
+
"Payment is IMMUTABLE once created: it can only be created, never modified. revenue[] is the full recipient/amount split in one shot (single recipient here; multiple entries split the total).",
|
|
40
|
+
"amount uses CoinParam {balance: <smallest unit>} — 50000000 = 0.05 WOW (9 decimals). recipient is AccountOrMark_Address OBJECT form {name_or_address}.",
|
|
41
|
+
"info.remark and info.index are REQUIRED (PaymentInfoSchema); index numbers the payment record for later reference by fees_transfer-style operations.",
|
|
42
|
+
"The OTHER payment mode (not shown): {object: '<coinwrapper_id>', receive: true, type_parameter: '0x2::wow::WOW'} unwraps a CoinWrapper received from an Allocation split into spendable coins — see CallPayment_ReceiveSchema and the allocation-activate example for the full flow.",
|
|
43
|
+
"type_parameter goes INSIDE 'object' (TypeNamedObjectSchema) and must match the coin being paid."
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create 9-Node Machine for Rental Lifecycle (Ziroom, R-M1-11 Compliant)",
|
|
3
|
+
"description": "9-node workflow: reserved → paid_deposit → in_use → returned → inspected, then three competing routing branches: return_approved (refund Allocator fires) / damage_confirmed (deduction Allocator fires) / arbiter_rule (off-Machine arbitration). completed follows return_approved.",
|
|
4
|
+
"tags": ["machine", "rental", "workflow", "nodes", "permission_index", "r-m1-11"],
|
|
5
|
+
"industry": "rental",
|
|
6
|
+
"operation_type": "machine",
|
|
7
|
+
"source": "ziroom testnet deployment 2026-07-29 (repaired to current schema + R-M1-11)",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "machine",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "ziroom_machine_v1",
|
|
16
|
+
"tags": ["rental", "machine"],
|
|
17
|
+
"replaceExistName": true,
|
|
18
|
+
"permission": "ziroom_permission_v1"
|
|
19
|
+
},
|
|
20
|
+
"node": {
|
|
21
|
+
"op": "add",
|
|
22
|
+
"bReplace": true,
|
|
23
|
+
"nodes": [
|
|
24
|
+
{
|
|
25
|
+
"name": "reserved",
|
|
26
|
+
"pairs": [
|
|
27
|
+
{
|
|
28
|
+
"prev_node": "",
|
|
29
|
+
"threshold": 1,
|
|
30
|
+
"forwards": [
|
|
31
|
+
{ "name": "Reserve", "weight": 1, "namedOperator": "" }
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "paid_deposit",
|
|
38
|
+
"pairs": [
|
|
39
|
+
{
|
|
40
|
+
"prev_node": "reserved",
|
|
41
|
+
"threshold": 1,
|
|
42
|
+
"forwards": [
|
|
43
|
+
{ "name": "Pay Deposit", "weight": 1, "namedOperator": "" }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "in_use",
|
|
50
|
+
"pairs": [
|
|
51
|
+
{
|
|
52
|
+
"prev_node": "paid_deposit",
|
|
53
|
+
"threshold": 1,
|
|
54
|
+
"forwards": [
|
|
55
|
+
{ "name": "Handover", "weight": 1, "permissionIndex": 1000 }
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "returned",
|
|
62
|
+
"pairs": [
|
|
63
|
+
{
|
|
64
|
+
"prev_node": "in_use",
|
|
65
|
+
"threshold": 1,
|
|
66
|
+
"forwards": [
|
|
67
|
+
{ "name": "Return Keys", "weight": 1, "namedOperator": "" }
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "inspected",
|
|
74
|
+
"pairs": [
|
|
75
|
+
{
|
|
76
|
+
"prev_node": "returned",
|
|
77
|
+
"threshold": 1,
|
|
78
|
+
"forwards": [
|
|
79
|
+
{ "name": "Inspect", "weight": 1, "permissionIndex": 1001 }
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "return_approved",
|
|
86
|
+
"pairs": [
|
|
87
|
+
{
|
|
88
|
+
"prev_node": "inspected",
|
|
89
|
+
"threshold": 1,
|
|
90
|
+
"forwards": [
|
|
91
|
+
{ "name": "Approve Refund", "weight": 1, "permissionIndex": 1002 }
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "damage_confirmed",
|
|
98
|
+
"pairs": [
|
|
99
|
+
{
|
|
100
|
+
"prev_node": "inspected",
|
|
101
|
+
"threshold": 1,
|
|
102
|
+
"forwards": [
|
|
103
|
+
{ "name": "Confirm Damage", "weight": 1, "permissionIndex": 1001 }
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "arbiter_rule",
|
|
110
|
+
"pairs": [
|
|
111
|
+
{
|
|
112
|
+
"prev_node": "inspected",
|
|
113
|
+
"threshold": 1,
|
|
114
|
+
"forwards": [
|
|
115
|
+
{ "name": "Escalate Arbitration", "weight": 1, "permissionIndex": 1500 }
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "completed",
|
|
122
|
+
"pairs": [
|
|
123
|
+
{
|
|
124
|
+
"prev_node": "return_approved",
|
|
125
|
+
"threshold": 1,
|
|
126
|
+
"forwards": [
|
|
127
|
+
{ "name": "Complete", "weight": 1, "permissionIndex": 1000 }
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"env": {
|
|
136
|
+
"network": "testnet",
|
|
137
|
+
"no_cache": true,
|
|
138
|
+
"project": "ziroom"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"notes": [
|
|
142
|
+
"R-M1-11: return_approved / damage_confirmed / arbiter_rule are ROUTING nodes. Fund movement (deposit refund / deduction) MUST be executed by Allocators (Service.order_allocators) whose Guards check progress.current == <routing node>. Never name nodes 'deposit_refunded'/'deposit_deducted'/'refunded' — Machines have no fund movement primitive; misnamed nodes leave funds locked in the Order escrow.",
|
|
143
|
+
"The three branches from 'inspected' are competing pairs (each threshold=1): the first forward executed wins and the other branches are abandoned for this session.",
|
|
144
|
+
"Forwards describe INCOMING transitions: a forward in a node's pair (prev_node='X') advances Progress FROM X INTO this node.",
|
|
145
|
+
"permission lives INSIDE 'object' (NamedObjectWithPermissionSchema) — it references existing Permission 'ziroom_permission_v1' by LocalMark name.",
|
|
146
|
+
"namedOperator='' means OrderHolder (customer), NOT 'anyone'. permissionIndex maps to Permission table entries (1000=operator, 1001=inspector, 1002=finance, 1500=arbiter).",
|
|
147
|
+
"Machine nodes are immutable after publish — create a new Machine to change the workflow."
|
|
148
|
+
]
|
|
149
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Permission with Role-Based Indexes (Ziroom Rental)",
|
|
3
|
+
"description": "Single Permission with indexes: 1000=operator, 1001=inspector, 1002=finance, 1500=arbiter",
|
|
4
|
+
"tags": ["permission", "rental", "role", "index"],
|
|
5
|
+
"industry": "rental",
|
|
6
|
+
"operation_type": "permission",
|
|
7
|
+
"source": "ziroom testnet deployment 2026-07-29 (repaired to current schema)",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "permission",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "ziroom_permission_v1",
|
|
16
|
+
"tags": ["project:ziroom", "type:permission"],
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"table": {
|
|
20
|
+
"op": "add perm by index",
|
|
21
|
+
"index": 1000,
|
|
22
|
+
"entity": {
|
|
23
|
+
"entities": [
|
|
24
|
+
{ "name_or_address": "ziroom_operator" }
|
|
25
|
+
],
|
|
26
|
+
"check_all_founded": false
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"env": {
|
|
31
|
+
"network": "testnet",
|
|
32
|
+
"no_cache": true,
|
|
33
|
+
"project": "ziroom"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"notes": [
|
|
37
|
+
"Custom indexes range 1000-65535 (0-999 are protocol-reserved)",
|
|
38
|
+
"Single Permission recommended for centralized control across all objects",
|
|
39
|
+
"Use 'add perm by index' to grant one permission to many entities",
|
|
40
|
+
"entity is ManyAccountOrMark_AddressSchema OBJECT form {entities: [{name_or_address}], check_all_founded?} — NOT a bare array (schema drift repair 2026-07-30: the 2026-07-29 deployment used the legacy array form; current schema requires the object wrapper). Recipient shown as the operator's local mark name; the original deployment used raw 0x addresses (desensitized)."
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Service with 3-path Allocation (Ziroom Rental)",
|
|
3
|
+
"description": "Create a Service with machine, buy_guard, contact, and 3-path order_allocators (rent to operator / refund to customer signer / damage deduction to operator)",
|
|
4
|
+
"tags": ["service", "allocation", "rental", "order_allocators", "guard"],
|
|
5
|
+
"industry": "rental",
|
|
6
|
+
"operation_type": "service",
|
|
7
|
+
"source": "ziroom testnet deployment 2026-07-29 (repaired to current schema)",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "service",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "ziroom_service_v1",
|
|
16
|
+
"tags": ["project:ziroom", "type:service"],
|
|
17
|
+
"replaceExistName": true,
|
|
18
|
+
"permission": "ziroom_permission_v1",
|
|
19
|
+
"type_parameter": "0x2::wow::WOW"
|
|
20
|
+
},
|
|
21
|
+
"machine": "ziroom_machine_v1",
|
|
22
|
+
"buy_guard": "ziroom_buy_guard_v1",
|
|
23
|
+
"um": "ziroom_contact_v1",
|
|
24
|
+
"sales": {
|
|
25
|
+
"op": "add",
|
|
26
|
+
"sales": [
|
|
27
|
+
{
|
|
28
|
+
"name": "ziroom_apartment_v1",
|
|
29
|
+
"price": 2000000000,
|
|
30
|
+
"stock": 1,
|
|
31
|
+
"suspension": false,
|
|
32
|
+
"wip": "",
|
|
33
|
+
"wip_hash": ""
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"order_allocators": {
|
|
38
|
+
"description": "3-path allocation: rent to operator, refund to customer, damage deductions",
|
|
39
|
+
"threshold": 1000000000,
|
|
40
|
+
"allocators": [
|
|
41
|
+
{
|
|
42
|
+
"guard": "ziroom_buy_guard_v1",
|
|
43
|
+
"sharing": [
|
|
44
|
+
{
|
|
45
|
+
"who": { "Entity": { "name_or_address": "ziroom_operator" } },
|
|
46
|
+
"sharing": 1000000000,
|
|
47
|
+
"mode": "Amount"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"guard": "ziroom_refund_guard_v1",
|
|
53
|
+
"sharing": [
|
|
54
|
+
{
|
|
55
|
+
"who": { "Signer": "signer" },
|
|
56
|
+
"sharing": 1000000000,
|
|
57
|
+
"mode": "Amount"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"guard": "ziroom_damage_guard_v1",
|
|
63
|
+
"sharing": [
|
|
64
|
+
{
|
|
65
|
+
"who": { "Entity": { "name_or_address": "ziroom_operator" } },
|
|
66
|
+
"sharing": 1000000000,
|
|
67
|
+
"mode": "Amount"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"env": {
|
|
75
|
+
"network": "testnet",
|
|
76
|
+
"no_cache": true,
|
|
77
|
+
"project": "ziroom"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"notes": [
|
|
81
|
+
"order_allocators is PERMANENTLY IMMUTABLE after publish (service.move:503) — set it BEFORE publish=true.",
|
|
82
|
+
"Signer recipient means the tx sender at alloc() time — the customer must call alloc_by_guard THEMSELVES for refunds (if the operator calls it, the operator receives the funds).",
|
|
83
|
+
"Amount mode: fixed amount in smallest unit, not percentage. Use Rate mode (10000=100%) for proportional splits; Rate items must sum to exactly 10000 when no Surplus item exists.",
|
|
84
|
+
"sales is an op discriminated union: {op:'add'|'set', sales:[...]} or {op:'remove', sales_name:[...]} or {op:'clear'} — never a bare array.",
|
|
85
|
+
"permission and type_parameter live INSIDE 'object' (TypeNamedObjectWithPermissionSchema). wip/wip_hash empty strings skip verification (TESTING ONLY — production must use real WIP URLs).",
|
|
86
|
+
"machine must be PUBLISHED before binding here; buy_guard may use a LocalMark NAME to break the Guard↔Service circular dependency (Phase-1 create without publish, then publish in Phase 2).",
|
|
87
|
+
"Entity recipient shown as local mark name 'ziroom_operator' (desensitization repair 2026-07-30): the original deployment used the operator's raw 0x address; Entity resolves names via LocalMark to a FIXED static address, so the name form is equivalent and recommended."
|
|
88
|
+
]
|
|
89
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Guard: Complete Multi-Condition Pattern (progress node + Signer==order.owner + order.service) — Customer-Win Allocator",
|
|
3
|
+
"description": "The 'complete pattern' allocation Guard: logic_and of (1) order at a customer-win node (Lost / Return Complete) via progress.current with convert_witness OrderProgress, (2) Level-2 dynamic identity binding Signer == query(order.owner), and (3) cross-service-theft prevention query(order.service) == this Service. Used as a Service order_allocators guard whose sharing.who is {Signer:'signer'} — the Signer binding is what makes Signer-recipient allocation safe (R-C3-06).",
|
|
4
|
+
"tags": ["guard", "allocation", "multi-condition", "logic_and", "level2-dynamic-binding", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "docs/examples/MyShop_Advanced — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "guard",
|
|
13
|
+
"data": {
|
|
14
|
+
"namedNew": {
|
|
15
|
+
"name": "service_customer_win_v2",
|
|
16
|
+
"tags": ["order", "customer-win", "level2-dynamic-binding"],
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"description": "Verify order at customer win nodes (Lost, Return Complete) AND signer is the order owner AND order belongs to three_body_signature_service_v2. VERIFIER CONSTRAINT LEVEL 2 (dynamic identity binding): Signer bound to query('order.owner') — only the order's rightful owner can trigger the refund. Three-fold verification: (1) order at customer win node, (2) signer is order.owner (dynamic query, prevents fund theft), (3) order belongs to this service (prevents cross-service theft, R-C3-05).",
|
|
20
|
+
"table": [
|
|
21
|
+
{ "identifier": 0, "b_submission": true, "value_type": "Address", "name": "order_id" },
|
|
22
|
+
{ "identifier": 1, "b_submission": false, "value_type": "String", "value": "Lost" },
|
|
23
|
+
{ "identifier": 2, "b_submission": false, "value_type": "String", "value": "Return Complete" },
|
|
24
|
+
{ "identifier": 3, "b_submission": false, "value_type": "Address", "name": "service_address", "value": "three_body_signature_service_v2" }
|
|
25
|
+
],
|
|
26
|
+
"root": {
|
|
27
|
+
"type": "logic_and",
|
|
28
|
+
"nodes": [
|
|
29
|
+
{
|
|
30
|
+
"type": "logic_or",
|
|
31
|
+
"nodes": [
|
|
32
|
+
{
|
|
33
|
+
"type": "logic_string_nocase_equal",
|
|
34
|
+
"nodes": [
|
|
35
|
+
{ "type": "query", "query": "progress.current", "object": { "identifier": 0, "convert_witness": "OrderProgress" }, "parameters": [] },
|
|
36
|
+
{ "type": "identifier", "identifier": 1 }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "logic_string_nocase_equal",
|
|
41
|
+
"nodes": [
|
|
42
|
+
{ "type": "query", "query": "progress.current", "object": { "identifier": 0, "convert_witness": "OrderProgress" }, "parameters": [] },
|
|
43
|
+
{ "type": "identifier", "identifier": 2 }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "logic_equal",
|
|
50
|
+
"nodes": [
|
|
51
|
+
{ "type": "query", "query": "order.owner", "object": { "identifier": 0 }, "parameters": [] },
|
|
52
|
+
{ "type": "context", "context": "Signer" }
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "logic_equal",
|
|
57
|
+
"nodes": [
|
|
58
|
+
{ "type": "query", "query": "order.service", "object": { "identifier": 0 }, "parameters": [] },
|
|
59
|
+
{ "type": "identifier", "identifier": 3 }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"env": {
|
|
66
|
+
"network": "testnet",
|
|
67
|
+
"no_cache": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"notes": [
|
|
71
|
+
"COMPLETE PATTERN (BUG-01): root = logic_and of [node-set check via logic_or(logic_string_nocase_equal x2) on progress.current, Signer==order.owner, order.service==service]. All three conditions must pass; logic_and accepts 2-8 children (this uses 3).",
|
|
72
|
+
"Schema-verified: CallGuard_DataSchema (guard.ts) — creation uses namedNew (NOT 'object'); table items use GuardTableItemBaseSchema (common/index.ts) which REJECTS the output-only object_type field; root validated against GuardNodeSchema (query/index.ts) and must return Bool — logic_and is in the allowed root-type list.",
|
|
73
|
+
"Query names verified against knowledge/guard-templates.ts: progress.current (id 1253, String), order.owner (id 1562, Address), order.service (id 1563, Address). convert_witness 'OrderProgress' (id 100) is a valid WitnessTypeSchema string — the Order address submitted at runtime is converted to its Progress object before querying the current node.",
|
|
74
|
+
"Why the Signer binding matters: the paired allocator uses sharing.who = {Signer:'signer'} (funds go to the caller). Condition 2 binds the caller to query(order.owner), so only the customer who placed the order can receive the refund — without it anyone could steal 100% of the allocation (R-C3-06).",
|
|
75
|
+
"Shorthand variant (not used here): the logic_or of two logic_string_nocase_equal can collapse into one VecString constant + vec_contains_string_nocase — semantically equivalent per guard-examples-lint.spec.ts 'Semantic Equivalence' tests. Original form kept for clarity of the complete pattern.",
|
|
76
|
+
"Prerequisites: the Service 'three_body_signature_service_v2' must already exist (created unpublished) so the identifier-3 name resolves at transaction build time. Guard is IMMUTABLE after creation.",
|
|
77
|
+
"Desensitization: doc ran on mainnet with local-mark account myshop_merchant — network switched to testnet and account omitted (use your own default/local-mark account). Object names (service_customer_win_v2, three_body_signature_service_v2) are local marks, not real identities. No personal data or real 0x addresses present. replaceExistName:true kept from the doc's full-rerun convention — omit for one-off deployments.",
|
|
78
|
+
"Runtime use: bound as Service order_allocators[].guard; the customer triggers allocation.alloc_by_guard with submission of identifier 0 = their Order address (see the doc Part 4 'Customer Wins' example)."
|
|
79
|
+
]
|
|
80
|
+
}
|