@wowok/agent-mcp 2.7.1 → 2.7.2
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/config/index.js +1 -1
- package/dist/config/runtime.js +1 -238
- package/dist/customer/customer-advice.js +1 -130
- package/dist/customer/index.js +1 -11
- package/dist/customer/industry-risks.js +1 -438
- package/dist/customer/info-puzzle.js +1 -681
- package/dist/customer/order-monitor.js +1 -328
- package/dist/customer/order-strategy.js +1 -373
- package/dist/customer/post-purchase.js +1 -351
- package/dist/customer/preorder-compare.js +1 -34
- package/dist/customer/reminder-system.js +1 -316
- package/dist/customer/risk-assessment.js +1 -397
- package/dist/customer/types.js +1 -13
- package/dist/customer/user-preferences.js +1 -460
- package/dist/evaluation/arbitration-game.d.ts +9 -2
- package/dist/evaluation/arbitration-game.js +1 -48
- package/dist/evaluation/builtins/demand-match.js +1 -153
- package/dist/evaluation/builtins/index.js +1 -10
- package/dist/evaluation/builtins/service-risk.js +1 -55
- package/dist/evaluation/capability.js +1 -13
- package/dist/evaluation/composer.js +1 -40
- package/dist/evaluation/engine.js +1 -175
- package/dist/evaluation/extract.js +1 -115
- package/dist/evaluation/game-strategy.d.ts +27 -0
- package/dist/evaluation/game-strategy.js +1 -0
- package/dist/evaluation/gap.js +1 -100
- package/dist/evaluation/index.d.ts +1 -0
- package/dist/evaluation/index.js +1 -11
- package/dist/evaluation/node-game.d.ts +31 -3
- package/dist/evaluation/node-game.js +1 -57
- package/dist/evaluation/region.js +1 -36
- package/dist/evaluation/types.d.ts +1 -0
- package/dist/evaluation/types.js +1 -1
- package/dist/evaluation/user-injection.js +1 -27
- package/dist/experience/experience-reuse.js +1 -103
- package/dist/experience/index.js +1 -5
- package/dist/experience/intent-distill.js +1 -83
- package/dist/experience/realtime-feedback.js +1 -94
- package/dist/experience/types.js +1 -1
- package/dist/experience/user-profile.js +1 -171
- package/dist/extensions/business-modules.js +1 -287
- package/dist/extensions/capability-manifest.js +1 -781
- package/dist/extensions/constraint-registry.js +1 -198
- package/dist/extensions/index.js +1 -6
- package/dist/extensions/metric-registry.js +1 -257
- package/dist/extensions/mode-evaluator.js +1 -170
- package/dist/extensions/modes.js +1 -499
- package/dist/extensions/registry.js +1 -717
- package/dist/extensions/types.js +1 -1
- package/dist/harness/auto-escalation.js +1 -68
- package/dist/harness/checkpoint.js +1 -129
- package/dist/harness/index.js +1 -78
- package/dist/harness/plan.js +1 -315
- package/dist/harness/recover.js +1 -139
- package/dist/harness/types.js +1 -1
- package/dist/harness/verify.js +1 -237
- package/dist/index.js +1 -273
- package/dist/intent/enrich.js +1 -67
- package/dist/intent/index.js +1 -60
- package/dist/intent/matcher.js +1 -81
- package/dist/intent/store.js +1 -55
- package/dist/intent/types.js +1 -10
- package/dist/knowledge/acquisition-flywheel.js +1 -192
- package/dist/knowledge/allocation-confirm.js +1 -534
- package/dist/knowledge/allocation-context.js +1 -249
- package/dist/knowledge/allocation-ledger.js +1 -463
- package/dist/knowledge/allocation-puzzle.js +1 -298
- package/dist/knowledge/allocation-risk.js +1 -568
- package/dist/knowledge/allocation-templates.js +1 -970
- package/dist/knowledge/allocation-translation.js +1 -585
- package/dist/knowledge/arb-risk.js +1 -210
- package/dist/knowledge/arbitration-confirm.js +1 -559
- package/dist/knowledge/arbitration-context.js +1 -505
- package/dist/knowledge/arbitration-ledger.js +1 -521
- package/dist/knowledge/arbitration-puzzle.js +1 -304
- package/dist/knowledge/arbitration-risk.js +1 -423
- package/dist/knowledge/arbitration-templates.js +1 -276
- package/dist/knowledge/arbitration-translation.js +1 -487
- package/dist/knowledge/arbitration-trust.js +1 -117
- package/dist/knowledge/audit-rules.js +1 -141
- package/dist/knowledge/bridge-risk.js +1 -263
- package/dist/knowledge/contact-risk.js +1 -200
- package/dist/knowledge/contact-templates.js +1 -60
- package/dist/knowledge/demand-confirm.js +1 -206
- package/dist/knowledge/demand-matching.js +1 -132
- package/dist/knowledge/demand-risk.js +1 -240
- package/dist/knowledge/demand-translation.js +1 -354
- package/dist/knowledge/deployment-scanner.js +1 -823
- package/dist/knowledge/dynamic-pricing.js +1 -87
- package/dist/knowledge/examples-scanner-cli.js +1 -26
- package/dist/knowledge/examples-scanner.js +1 -843
- package/dist/knowledge/flywheel-loop.js +1 -404
- package/dist/knowledge/fund-layer.js +1 -973
- package/dist/knowledge/glossary.js +1 -211
- package/dist/knowledge/guard-confirm.js +1 -406
- package/dist/knowledge/guard-context.js +1 -287
- package/dist/knowledge/guard-design-patterns.js +1 -360
- package/dist/knowledge/guard-ledger.js +1 -260
- package/dist/knowledge/guard-lint.js +1 -670
- package/dist/knowledge/guard-migration.js +1 -228
- package/dist/knowledge/guard-puzzle.js +1 -805
- package/dist/knowledge/guard-render.js +1 -700
- package/dist/knowledge/guard-risk.js +1 -1879
- package/dist/knowledge/guard-submission-prompt.js +1 -171
- package/dist/knowledge/guard-templates.js +1 -1105
- package/dist/knowledge/guard-translation.js +1 -1119
- package/dist/knowledge/index.js +1 -436
- package/dist/knowledge/industry-evolution.js +1 -323
- package/dist/knowledge/industry-generalizer.js +1 -381
- package/dist/knowledge/industry-registry.js +1 -174
- package/dist/knowledge/intent-metrics.d.ts +4 -3
- package/dist/knowledge/intent-metrics.js +1 -566
- package/dist/knowledge/machine-confirm.js +1 -559
- package/dist/knowledge/machine-context.js +1 -833
- package/dist/knowledge/machine-ledger.js +1 -338
- package/dist/knowledge/machine-puzzle.js +1 -494
- package/dist/knowledge/machine-render.js +1 -565
- package/dist/knowledge/machine-risk.js +1 -669
- package/dist/knowledge/machine-templates.js +1 -1597
- package/dist/knowledge/machine-topology.js +1 -234
- package/dist/knowledge/machine-translation.js +1 -513
- package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
- package/dist/knowledge/mcp-schema-audit.js +1 -777
- package/dist/knowledge/onchain-constants.js +1 -35
- package/dist/knowledge/order-confirm.js +1 -573
- package/dist/knowledge/order-context.js +1 -390
- package/dist/knowledge/order-ledger.js +1 -341
- package/dist/knowledge/order-puzzle.js +1 -255
- package/dist/knowledge/order-risk.js +1 -653
- package/dist/knowledge/order-templates.js +1 -368
- package/dist/knowledge/order-translation.js +1 -550
- package/dist/knowledge/overrides-loader.js +1 -65
- package/dist/knowledge/passport-confirm.js +1 -531
- package/dist/knowledge/passport-context.js +1 -306
- package/dist/knowledge/passport-ledger.js +1 -282
- package/dist/knowledge/passport-puzzle.js +1 -333
- package/dist/knowledge/passport-risk.js +1 -450
- package/dist/knowledge/passport-templates.js +1 -568
- package/dist/knowledge/passport-translation.js +1 -516
- package/dist/knowledge/payment-risk.js +1 -249
- package/dist/knowledge/permission-confirm.js +1 -426
- package/dist/knowledge/permission-context.js +1 -224
- package/dist/knowledge/permission-ledger.js +1 -403
- package/dist/knowledge/permission-puzzle.js +1 -173
- package/dist/knowledge/permission-risk.js +1 -411
- package/dist/knowledge/permission-templates.js +1 -234
- package/dist/knowledge/permission-translation.js +1 -350
- package/dist/knowledge/personal-risk.js +1 -212
- package/dist/knowledge/process-model.js +1 -160
- package/dist/knowledge/progress-confirm.js +1 -456
- package/dist/knowledge/progress-context.js +1 -452
- package/dist/knowledge/progress-ledger.js +1 -330
- package/dist/knowledge/progress-puzzle.js +1 -219
- package/dist/knowledge/progress-risk.js +1 -461
- package/dist/knowledge/progress-templates.js +1 -228
- package/dist/knowledge/progress-translation.js +1 -405
- package/dist/knowledge/proof-confirm.js +1 -187
- package/dist/knowledge/proof-risk.js +1 -207
- package/dist/knowledge/proof-translation.js +1 -283
- package/dist/knowledge/registrar-risk.js +1 -217
- package/dist/knowledge/repository-confirm.js +1 -286
- package/dist/knowledge/repository-risk.js +1 -373
- package/dist/knowledge/repository-translation.js +1 -445
- package/dist/knowledge/reputation-rules.js +1 -99
- package/dist/knowledge/resource-risk.js +1 -157
- package/dist/knowledge/reward-confirm.js +1 -526
- package/dist/knowledge/reward-context.js +1 -504
- package/dist/knowledge/reward-ledger.js +1 -502
- package/dist/knowledge/reward-puzzle.js +1 -300
- package/dist/knowledge/reward-risk.js +1 -627
- package/dist/knowledge/reward-templates.js +1 -197
- package/dist/knowledge/reward-translation.js +1 -501
- package/dist/knowledge/safety-rules.js +1 -404
- package/dist/knowledge/scenario-modes.js +1 -321
- package/dist/knowledge/service-confirm.js +1 -807
- package/dist/knowledge/service-context.js +1 -403
- package/dist/knowledge/service-ledger.js +1 -609
- package/dist/knowledge/service-puzzle.js +1 -236
- package/dist/knowledge/service-risk.js +1 -651
- package/dist/knowledge/service-templates.js +1 -456
- package/dist/knowledge/service-translation.js +1 -622
- package/dist/knowledge/template-registry.js +1 -353
- package/dist/knowledge/tool-constraints.js +1 -195
- package/dist/knowledge/tools-reference.js +1 -178
- package/dist/knowledge/treasury-confirm.js +1 -512
- package/dist/knowledge/treasury-context.js +1 -363
- package/dist/knowledge/treasury-ledger.js +1 -300
- package/dist/knowledge/treasury-puzzle.js +1 -216
- package/dist/knowledge/treasury-risk.js +1 -440
- package/dist/knowledge/treasury-templates.js +1 -358
- package/dist/knowledge/treasury-translation.js +1 -498
- package/dist/knowledge/trust-metrics.js +1 -198
- package/dist/knowledge/util-risk.js +1 -135
- package/dist/loop-engineering/aggregate.js +1 -132
- package/dist/loop-engineering/context-collect.js +1 -83
- package/dist/loop-engineering/diagnose.js +1 -273
- package/dist/loop-engineering/improve.js +1 -405
- package/dist/loop-engineering/index.js +1 -4
- package/dist/loop-engineering/pipeline.js +1 -56
- package/dist/mode-market/index.js +1 -3
- package/dist/mode-market/registry.js +1 -124
- package/dist/mode-market/review.js +1 -214
- package/dist/mode-market/submission.js +1 -85
- package/dist/participation/collaborator-interest.d.ts +23 -0
- package/dist/participation/collaborator-interest.js +1 -0
- package/dist/participation/customer-interest.d.ts +25 -0
- package/dist/participation/customer-interest.js +1 -0
- package/dist/participation/merchant-interest.js +1 -100
- package/dist/participation/radar-core.d.ts +13 -3
- package/dist/participation/radar-core.js +1 -269
- package/dist/participation/supplier-interest.d.ts +25 -0
- package/dist/participation/supplier-interest.js +1 -0
- package/dist/persona/analyzer.js +1 -66
- package/dist/persona/bridge.js +1 -86
- package/dist/persona/defaults.js +1 -195
- package/dist/persona/experience-bridge.js +1 -23
- package/dist/persona/index.js +1 -71
- package/dist/persona/model.js +1 -111
- package/dist/persona/store.js +1 -62
- package/dist/persona/types.d.ts +3 -1
- package/dist/persona/types.js +1 -5
- package/dist/project/business-puzzle.js +1 -383
- package/dist/project/context-assembly.js +1 -254
- package/dist/project/deployment-bridge.js +1 -120
- package/dist/project/deployment-doc.js +1 -1126
- package/dist/project/edit-planner.js +1 -1342
- package/dist/project/evaluation.js +1 -2011
- package/dist/project/game-theory.js +1 -177
- package/dist/project/graph-builder.js +1 -656
- package/dist/project/graph.js +1 -340
- package/dist/project/handlers.js +1 -1784
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +1 -301
- package/dist/project/intent-analyzer.js +1 -149
- package/dist/project/machine-nodes.js +1 -36
- package/dist/project/merchant-guide.js +1 -264
- package/dist/project/migration.js +1 -125
- package/dist/project/mode-actions.js +1 -309
- package/dist/project/namespace.js +1 -206
- package/dist/project/participation-radar.js +1 -428
- package/dist/project/pipeline-actions.js +1 -109
- package/dist/project/project-store.js +1 -422
- package/dist/project/query.js +1 -153
- package/dist/project/reverse-mapping.d.ts +34 -0
- package/dist/project/reverse-mapping.js +1 -0
- package/dist/project/risk-aggregator.js +1 -295
- package/dist/project/rollback-policy.js +1 -290
- package/dist/project/semantic-assembler.js +1 -345
- package/dist/project/semantic-graph.js +1 -292
- package/dist/project/stage-gate.js +1 -369
- package/dist/project/substep-trace.js +1 -332
- package/dist/project/task-tracker.js +1 -78
- package/dist/role/derivation.d.ts +18 -0
- package/dist/role/derivation.js +1 -0
- package/dist/role/index.d.ts +5 -0
- package/dist/role/index.js +1 -0
- package/dist/role/model.d.ts +8 -0
- package/dist/role/model.js +1 -0
- package/dist/role/resolution.d.ts +11 -0
- package/dist/role/resolution.js +1 -0
- package/dist/role/types.d.ts +11 -0
- package/dist/role/types.js +1 -0
- package/dist/rules.js +1 -52
- package/dist/safety/confirm-gate.js +1 -88
- package/dist/safety/index.js +1 -3
- package/dist/safety/preview.js +1 -52
- package/dist/schema/call/allocation.js +1 -34
- package/dist/schema/call/arbitration.js +1 -113
- package/dist/schema/call/base.d.ts +15 -15
- package/dist/schema/call/base.js +1 -370
- package/dist/schema/call/bridge-handler.js +1 -265
- package/dist/schema/call/bridge.d.ts +7 -7
- package/dist/schema/call/bridge.js +1 -458
- package/dist/schema/call/contact.js +1 -37
- package/dist/schema/call/demand.js +1 -47
- package/dist/schema/call/guard.js +1 -161
- package/dist/schema/call/handler.js +1 -322
- package/dist/schema/call/index.js +1 -20
- package/dist/schema/call/machine.js +1 -193
- package/dist/schema/call/order.js +1 -35
- package/dist/schema/call/payment.js +1 -37
- package/dist/schema/call/permission-handler.js +1 -54
- package/dist/schema/call/permission.js +1 -105
- package/dist/schema/call/personal.js +1 -78
- package/dist/schema/call/progress.js +1 -47
- package/dist/schema/call/proof.js +1 -33
- package/dist/schema/call/repository.js +1 -77
- package/dist/schema/call/reward.js +1 -30
- package/dist/schema/call/semantic.js +1 -1679
- package/dist/schema/call/service.js +1 -184
- package/dist/schema/call/treasury.js +1 -71
- package/dist/schema/common/index.js +1 -407
- package/dist/schema/config/index.js +1 -68
- package/dist/schema/evaluation/index.d.ts +213 -16
- package/dist/schema/evaluation/index.js +1 -356
- package/dist/schema/index.js +1 -17
- package/dist/schema/intent-radar/index.d.ts +13 -13
- package/dist/schema/intent-radar/index.js +1 -89
- package/dist/schema/local/index.d.ts +21 -21
- package/dist/schema/local/index.js +1 -927
- package/dist/schema/local/wip.js +1 -187
- package/dist/schema/messenger/index.d.ts +7 -7
- package/dist/schema/messenger/index.js +1 -475
- package/dist/schema/operations.d.ts +7 -7
- package/dist/schema/operations.js +1 -520
- package/dist/schema/persona/index.d.ts +54 -54
- package/dist/schema/persona/index.js +1 -148
- package/dist/schema/project/index.d.ts +94 -48
- package/dist/schema/project/index.js +1 -2057
- package/dist/schema/query/index.d.ts +423 -7
- package/dist/schema/query/index.js +1 -1646
- package/dist/schema/schema-query/index.js +1 -104
- package/dist/schema/schema-version.js +1 -76
- package/dist/schema/sync-layer4.js +1 -286
- package/dist/schema/task-status.js +1 -36
- package/dist/schema/trust/index.js +1 -314
- package/dist/schema/utils/guard-parser.js +1 -419
- package/dist/schema/utils/guard-query-utils.js +1 -46
- package/dist/schema/utils/node-parser.js +1 -369
- package/dist/schema/utils/object-type-utils.js +1 -35
- package/dist/schema/utils/permission-index-utils.js +1 -7
- package/dist/schema/utils/permission-machine-check.js +1 -121
- package/dist/schema/utils/skills-recommendation.js +1 -77
- package/dist/schema-query/index.js +1 -810
- package/dist/schemas/account_operation.output.json +5 -2
- package/dist/schemas/bridge_operation.output.json +5 -2
- package/dist/schemas/evaluation_operation.output.json +112 -7
- package/dist/schemas/evaluation_operation.schema.json +93 -6
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +4 -1
- package/dist/schemas/intent_radar.schema.json +4 -1
- package/dist/schemas/local_info_operation.output.json +5 -2
- package/dist/schemas/local_mark_operation.output.json +5 -2
- package/dist/schemas/messenger_operation.output.json +5 -2
- package/dist/schemas/onchain_events.output.json +5 -2
- package/dist/schemas/onchain_operations.output.json +5 -2
- package/dist/schemas/onchain_operations.schema.json +4 -4
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +2 -2
- package/dist/schemas/onchain_operations_service.schema.json +1 -1
- package/dist/schemas/onchain_table_data.output.json +6 -3
- package/dist/schemas/persona_operation.output.json +4 -1
- package/dist/schemas/persona_operation.schema.json +4 -1
- package/dist/schemas/project_operation.output.json +28 -8
- package/dist/schemas/query_toolkit.output.json +8 -5
- package/dist/schemas/wowok_buildin_info.output.json +132 -0
- package/dist/schemas/wowok_buildin_info.schema.json +14 -0
- package/dist/telemetry/index.js +1 -112
- package/dist/telemetry/redact.js +1 -23
- package/dist/telemetry/storage.js +1 -80
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/config.js +1 -74
- package/dist/tools/handlers/evaluation.js +1 -123
- package/dist/tools/handlers/file-export.js +1 -90
- package/dist/tools/handlers/intent-radar.js +1 -76
- package/dist/tools/handlers/local.js +1 -53
- package/dist/tools/handlers/messenger.js +1 -188
- package/dist/tools/handlers/onchain.js +1 -1180
- package/dist/tools/handlers/persona.js +1 -89
- package/dist/tools/handlers/project.js +1 -211
- package/dist/tools/handlers/query.js +1 -434
- package/dist/tools/handlers/schema-query.js +1 -176
- package/dist/tools/handlers/task-status.js +1 -26
- package/dist/tools/handlers/trust.js +1 -380
- package/dist/tools/handlers/wip.js +1 -90
- package/dist/tools/index.js +1 -1382
- package/dist/tools/retry.js +1 -85
- package/dist/tools/rules-hook.js +1 -23
- package/dist/tools/shared.js +1 -130
- package/dist/tools/types.js +1 -1
- package/dist/tools/upgrade-check.d.ts +19 -0
- package/dist/tools/upgrade-check.js +1 -0
- package/dist/tools/wip-deploy-assist.js +1 -306
- package/dist/tools/wrap.js +1 -500
- package/package.json +4 -2
|
@@ -1,177 +1 @@
|
|
|
1
|
-
export const GAME_THEORY_CONSTRAINTS = [
|
|
2
|
-
{
|
|
3
|
-
scenario: "merchant_may_deliver_late",
|
|
4
|
-
conflict: "Merchant incentive: collect payment fast, deliver at own pace (or never). User bears schedule risk with no leverage once funds leave their wallet.",
|
|
5
|
-
userProtection: {
|
|
6
|
-
mechanism: "Milestone escrow — funds locked in Order, released per verified milestone",
|
|
7
|
-
object: "Order + Allocation",
|
|
8
|
-
guard: "milestone forward guard verifies deliverable before release",
|
|
9
|
-
},
|
|
10
|
-
merchantConstraint: {
|
|
11
|
-
requiredDeposit: true,
|
|
12
|
-
timeoutPenalty: "compensation_fund covers refund for unstarted milestones",
|
|
13
|
-
},
|
|
14
|
-
evaluationMetric: "timeout_protection",
|
|
15
|
-
mitigationSignals: [
|
|
16
|
-
["edge:has_order_allocators", "node:main_machine"],
|
|
17
|
-
["module:milestone_escrow"],
|
|
18
|
-
],
|
|
19
|
-
mitigatingModules: ["milestone_escrow", "refund_guarantee"],
|
|
20
|
-
recommendation: "Adopt milestone_escrow module: bind order_allocators + Machine so funds release only per verified milestone. Add compensation_fund for late-delivery refunds.",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
scenario: "merchant_may_abandon",
|
|
24
|
-
conflict: "Merchant incentive: maximize intake then abandon the service (exit scam). User has no recourse without locked funds or deposit.",
|
|
25
|
-
userProtection: {
|
|
26
|
-
mechanism: "Escrow + compensation fund — user refunds from on-chain fund even if merchant vanishes",
|
|
27
|
-
object: "Service.compensation_fund + Order",
|
|
28
|
-
guard: "refund_guard validates claim conditions",
|
|
29
|
-
},
|
|
30
|
-
merchantConstraint: {
|
|
31
|
-
requiredDeposit: true,
|
|
32
|
-
requiredArbitration: true,
|
|
33
|
-
},
|
|
34
|
-
evaluationMetric: "escrow_quality",
|
|
35
|
-
mitigationSignals: [
|
|
36
|
-
["edge:has_order_allocators", "module:refund_guarantee"],
|
|
37
|
-
["module:refund_guarantee", "node:main_arbitration"],
|
|
38
|
-
],
|
|
39
|
-
mitigatingModules: ["refund_guarantee", "milestone_escrow", "reputation_on_chain"],
|
|
40
|
-
recommendation: "Adopt refund_guarantee module: compensation_fund_add > 0 with refund_guard. Escrow via order_allocators prevents merchant from touching funds before delivery.",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
scenario: "customer_may_deny_acceptance",
|
|
44
|
-
conflict: "Customer incentive: withhold acceptance confirmation to delay payment indefinitely while using the deliverable. Merchant's funds stay locked.",
|
|
45
|
-
userProtection: {
|
|
46
|
-
mechanism: "Accept timeout — after N days without response, order auto-advances (adminUnhold) and merchant gets paid",
|
|
47
|
-
object: "Machine forward + Progress",
|
|
48
|
-
guard: "time_guard on accept forward",
|
|
49
|
-
},
|
|
50
|
-
merchantConstraint: {
|
|
51
|
-
timeoutPenalty: "user silence past timeout = implicit acceptance",
|
|
52
|
-
},
|
|
53
|
-
evaluationMetric: "timeout_protection",
|
|
54
|
-
mitigationSignals: [
|
|
55
|
-
["module:accept_timeout_protection"],
|
|
56
|
-
["node:guard_accept_timeout_protection"],
|
|
57
|
-
],
|
|
58
|
-
mitigatingModules: ["accept_timeout_protection"],
|
|
59
|
-
recommendation: "Adopt accept_timeout_protection module: time_guard on the accept forward (e.g. 7 days) + PROGRESS_UNHOLD permission so the workflow auto-advances on customer silence.",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
scenario: "customer_may_false_claim",
|
|
63
|
-
conflict: "Customer incentive: claim non-delivery or defect to obtain refund while keeping the goods/service. Merchant loses both deliverable and payment.",
|
|
64
|
-
userProtection: {
|
|
65
|
-
mechanism: "WIP provenance — delivery hash committed on-chain before/at delivery; independent arbitration verifies evidence",
|
|
66
|
-
object: "Repository + Arbitration",
|
|
67
|
-
guard: "Guard compares proof.signer/proof.time against committed WIP hash",
|
|
68
|
-
},
|
|
69
|
-
merchantConstraint: {
|
|
70
|
-
requiredProof: "wip_hash committed to Repository before fund release",
|
|
71
|
-
requiredArbitration: true,
|
|
72
|
-
},
|
|
73
|
-
evaluationMetric: "proof_integrity",
|
|
74
|
-
mitigationSignals: [
|
|
75
|
-
["node:main_repository", "node:main_arbitration"],
|
|
76
|
-
["module:wip_provenance", "node:main_arbitration"],
|
|
77
|
-
],
|
|
78
|
-
mitigatingModules: ["wip_provenance", "independent_arbitration", "damage_attestation"],
|
|
79
|
-
recommendation: "Adopt wip_provenance + independent_arbitration modules: Repository stores WIP hashes as tamper-proof delivery evidence; Arbitration (independent Permission) resolves false claims against on-chain proof.",
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
scenario: "supplier_may_not_deliver",
|
|
83
|
-
conflict: "Supplier incentive: accept sub-order payment terms then under-deliver, leaving the merchant liable to the end customer. Multi-party opacity hides the failure point.",
|
|
84
|
-
userProtection: {
|
|
85
|
-
mechanism: "Supplier visibility — Demand + sub-order flow with multi-tier Allocation; each tier paid only on its own verified delivery",
|
|
86
|
-
object: "Demand + Allocation (multi-tier)",
|
|
87
|
-
guard: "per-tier release guard",
|
|
88
|
-
},
|
|
89
|
-
merchantConstraint: {
|
|
90
|
-
requiredProof: "sub-delivery proof per Allocation tier",
|
|
91
|
-
},
|
|
92
|
-
evaluationMetric: "supplier_visibility",
|
|
93
|
-
mitigationSignals: [
|
|
94
|
-
["module:supplier_collaboration"],
|
|
95
|
-
["module:multi_tier_allocation"],
|
|
96
|
-
],
|
|
97
|
-
mitigatingModules: ["supplier_collaboration", "multi_tier_allocation"],
|
|
98
|
-
recommendation: "Adopt supplier_collaboration module: publish Demand referencing the main Service, split Allocation across tiers so each supplier is paid only for verified sub-delivery.",
|
|
99
|
-
},
|
|
100
|
-
];
|
|
101
|
-
function evalSignal(token, graph, intent) {
|
|
102
|
-
const [kind, value] = token.split(":", 2);
|
|
103
|
-
switch (kind) {
|
|
104
|
-
case "node":
|
|
105
|
-
return graph.nodes.some((n) => n.id === value);
|
|
106
|
-
case "edge":
|
|
107
|
-
return graph.edges.some((e) => e.relation === value);
|
|
108
|
-
case "module":
|
|
109
|
-
return graph.adoptedModules.includes(value);
|
|
110
|
-
case "type":
|
|
111
|
-
return graph.nodes.some((n) => n.type === value);
|
|
112
|
-
case "trust": {
|
|
113
|
-
const v = intent.trust;
|
|
114
|
-
return v[value] === true || (typeof v[value] === "string" && v[value] !== "none");
|
|
115
|
-
}
|
|
116
|
-
default:
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
export function checkGameTheoryConstraints(graph, intent) {
|
|
121
|
-
const results = [];
|
|
122
|
-
for (const c of GAME_THEORY_CONSTRAINTS) {
|
|
123
|
-
let matched = null;
|
|
124
|
-
let bestPartial = [];
|
|
125
|
-
let bestPartialScore = -1;
|
|
126
|
-
for (const group of c.mitigationSignals) {
|
|
127
|
-
const hits = group.filter((s) => evalSignal(s, graph, intent));
|
|
128
|
-
if (hits.length === group.length) {
|
|
129
|
-
matched = group;
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
const score = hits.length / group.length;
|
|
133
|
-
if (hits.length > 0 && score > bestPartialScore) {
|
|
134
|
-
bestPartialScore = score;
|
|
135
|
-
bestPartial = hits;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
results.push({
|
|
139
|
-
scenario: c.scenario,
|
|
140
|
-
conflict: c.conflict,
|
|
141
|
-
covered: matched !== null,
|
|
142
|
-
matchedSignals: matched ?? [],
|
|
143
|
-
partialSignals: matched ? [] : bestPartial,
|
|
144
|
-
userProtection: `${c.userProtection.mechanism} (${c.userProtection.object}${c.userProtection.guard ? `, guard: ${c.userProtection.guard}` : ""})`,
|
|
145
|
-
evaluationMetric: c.evaluationMetric,
|
|
146
|
-
recommendation: matched ? undefined : c.recommendation,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
const covered = results.filter((r) => r.covered);
|
|
150
|
-
const exposed = results.filter((r) => !r.covered);
|
|
151
|
-
const wowAlignments = [];
|
|
152
|
-
if (graph.edges.some((e) => e.relation === "has_order_allocators")) {
|
|
153
|
-
wowAlignments.push("Milestone escrow: funds locked in Order, released per verified milestone — merchant paid for delivery, user pays for value");
|
|
154
|
-
}
|
|
155
|
-
if (graph.adoptedModules.includes("accept_timeout_protection")) {
|
|
156
|
-
wowAlignments.push("Accept timeout: customer silence past N days = implicit acceptance — merchant protected from payment stalling");
|
|
157
|
-
}
|
|
158
|
-
if (graph.nodes.some((n) => n.id === "main_repository")) {
|
|
159
|
-
wowAlignments.push("WIP provenance: delivery hash on-chain — false claims verifiable against tamper-proof evidence");
|
|
160
|
-
}
|
|
161
|
-
if (graph.nodes.some((n) => n.id === "main_arbitration")) {
|
|
162
|
-
wowAlignments.push("Micro-arbitration: Guard-weighted voting with independent Permission — low-cost dispute resolution without platform fees");
|
|
163
|
-
}
|
|
164
|
-
if (graph.adoptedModules.includes("reputation_on_chain")) {
|
|
165
|
-
wowAlignments.push("On-chain reputation: both sides' behavior permanently recorded — future transactions price the risk");
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
results,
|
|
169
|
-
coveredCount: covered.length,
|
|
170
|
-
totalCount: results.length,
|
|
171
|
-
exposedScenarios: exposed.map((r) => r.scenario),
|
|
172
|
-
wowAlignments,
|
|
173
|
-
summary: exposed.length === 0
|
|
174
|
-
? `All ${results.length} adversarial scenarios have on-chain mitigations.`
|
|
175
|
-
: `${exposed.length}/${results.length} adversarial scenarios EXPOSED: ${exposed.map((r) => r.scenario).join(", ")}. Apply the recommendations to align incentives.`,
|
|
176
|
-
};
|
|
177
|
-
}
|
|
1
|
+
export const GAME_THEORY_CONSTRAINTS=[{'scenario':'merchant_may_deliver_late','conflict':'Merchant\x20incentive:\x20collect\x20payment\x20fast,\x20deliver\x20at\x20own\x20pace\x20(or\x20never).\x20User\x20bears\x20schedule\x20risk\x20with\x20no\x20leverage\x20once\x20funds\x20leave\x20their\x20wallet.','userProtection':{'mechanism':'Milestone\x20escrow\x20—\x20funds\x20locked\x20in\x20Order,\x20released\x20per\x20verified\x20milestone','object':'Order\x20+\x20Allocation','guard':'milestone\x20forward\x20guard\x20verifies\x20deliverable\x20before\x20release'},'merchantConstraint':{'requiredDeposit':!![],'timeoutPenalty':'compensation_fund\x20covers\x20refund\x20for\x20unstarted\x20milestones'},'evaluationMetric':'timeout_protection','mitigationSignals':[['edge:has_order_allocators','node:main_machine'],['module:milestone_escrow']],'mitigatingModules':['milestone_escrow','refund_guarantee'],'recommendation':'Adopt\x20milestone_escrow\x20module:\x20bind\x20order_allocators\x20+\x20Machine\x20so\x20funds\x20release\x20only\x20per\x20verified\x20milestone.\x20Add\x20compensation_fund\x20for\x20late-delivery\x20refunds.'},{'scenario':'merchant_may_abandon','conflict':'Merchant\x20incentive:\x20maximize\x20intake\x20then\x20abandon\x20the\x20service\x20(exit\x20scam).\x20User\x20has\x20no\x20recourse\x20without\x20locked\x20funds\x20or\x20deposit.','userProtection':{'mechanism':'Escrow\x20+\x20compensation\x20fund\x20—\x20user\x20refunds\x20from\x20on-chain\x20fund\x20even\x20if\x20merchant\x20vanishes','object':'Service.compensation_fund\x20+\x20Order','guard':'refund_guard\x20validates\x20claim\x20conditions'},'merchantConstraint':{'requiredDeposit':!![],'requiredArbitration':!![]},'evaluationMetric':'escrow_quality','mitigationSignals':[['edge:has_order_allocators','module:refund_guarantee'],['module:refund_guarantee','node:main_arbitration']],'mitigatingModules':['refund_guarantee','milestone_escrow','reputation_on_chain'],'recommendation':'Adopt\x20refund_guarantee\x20module:\x20compensation_fund_add\x20>\x200\x20with\x20refund_guard.\x20Escrow\x20via\x20order_allocators\x20prevents\x20merchant\x20from\x20touching\x20funds\x20before\x20delivery.'},{'scenario':'customer_may_deny_acceptance','conflict':'Customer\x20incentive:\x20withhold\x20acceptance\x20confirmation\x20to\x20delay\x20payment\x20indefinitely\x20while\x20using\x20the\x20deliverable.\x20Merchant\x27s\x20funds\x20stay\x20locked.','userProtection':{'mechanism':'Accept\x20timeout\x20—\x20after\x20N\x20days\x20without\x20response,\x20order\x20auto-advances\x20(adminUnhold)\x20and\x20merchant\x20gets\x20paid','object':'Machine\x20forward\x20+\x20Progress','guard':'time_guard\x20on\x20accept\x20forward'},'merchantConstraint':{'timeoutPenalty':'user\x20silence\x20past\x20timeout\x20=\x20implicit\x20acceptance'},'evaluationMetric':'timeout_protection','mitigationSignals':[['module:accept_timeout_protection'],['node:guard_accept_timeout_protection']],'mitigatingModules':['accept_timeout_protection'],'recommendation':'Adopt\x20accept_timeout_protection\x20module:\x20time_guard\x20on\x20the\x20accept\x20forward\x20(e.g.\x207\x20days)\x20+\x20PROGRESS_UNHOLD\x20permission\x20so\x20the\x20workflow\x20auto-advances\x20on\x20customer\x20silence.'},{'scenario':'customer_may_false_claim','conflict':'Customer\x20incentive:\x20claim\x20non-delivery\x20or\x20defect\x20to\x20obtain\x20refund\x20while\x20keeping\x20the\x20goods/service.\x20Merchant\x20loses\x20both\x20deliverable\x20and\x20payment.','userProtection':{'mechanism':'WIP\x20provenance\x20—\x20delivery\x20hash\x20committed\x20on-chain\x20before/at\x20delivery;\x20independent\x20arbitration\x20verifies\x20evidence','object':'Repository\x20+\x20Arbitration','guard':'Guard\x20compares\x20proof.signer/proof.time\x20against\x20committed\x20WIP\x20hash'},'merchantConstraint':{'requiredProof':'wip_hash\x20committed\x20to\x20Repository\x20before\x20fund\x20release','requiredArbitration':!![]},'evaluationMetric':'proof_integrity','mitigationSignals':[['node:main_repository','node:main_arbitration'],['module:wip_provenance','node:main_arbitration']],'mitigatingModules':['wip_provenance','independent_arbitration','damage_attestation'],'recommendation':'Adopt\x20wip_provenance\x20+\x20independent_arbitration\x20modules:\x20Repository\x20stores\x20WIP\x20hashes\x20as\x20tamper-proof\x20delivery\x20evidence;\x20Arbitration\x20(independent\x20Permission)\x20resolves\x20false\x20claims\x20against\x20on-chain\x20proof.'},{'scenario':'supplier_may_not_deliver','conflict':'Supplier\x20incentive:\x20accept\x20sub-order\x20payment\x20terms\x20then\x20under-deliver,\x20leaving\x20the\x20merchant\x20liable\x20to\x20the\x20end\x20customer.\x20Multi-party\x20opacity\x20hides\x20the\x20failure\x20point.','userProtection':{'mechanism':'Supplier\x20visibility\x20—\x20Demand\x20+\x20sub-order\x20flow\x20with\x20multi-tier\x20Allocation;\x20each\x20tier\x20paid\x20only\x20on\x20its\x20own\x20verified\x20delivery','object':'Demand\x20+\x20Allocation\x20(multi-tier)','guard':'per-tier\x20release\x20guard'},'merchantConstraint':{'requiredProof':'sub-delivery\x20proof\x20per\x20Allocation\x20tier'},'evaluationMetric':'supplier_visibility','mitigationSignals':[['module:supplier_collaboration'],['module:multi_tier_allocation']],'mitigatingModules':['supplier_collaboration','multi_tier_allocation'],'recommendation':'Adopt\x20supplier_collaboration\x20module:\x20publish\x20Demand\x20referencing\x20the\x20main\x20Service,\x20split\x20Allocation\x20across\x20tiers\x20so\x20each\x20supplier\x20is\x20paid\x20only\x20for\x20verified\x20sub-delivery.'}];function evalSignal(a,b,c){const [d,e]=a['split'](':',0x2);switch(d){case'node':return b['nodes']['some'](f=>f['id']===e);case'edge':return b['edges']['some'](f=>f['relation']===e);case'module':return b['adoptedModules']['includes'](e);case'type':return b['nodes']['some'](f=>f['type']===e);case'trust':{const f=c['trust'];return f[e]===!![]||typeof f[e]==='string'&&f[e]!=='none';}default:return![];}}export function checkGameTheoryConstraints(a,b){const d=[];for(const h of GAME_THEORY_CONSTRAINTS){let i=null,j=[],k=-0x1;for(const l of h['mitigationSignals']){const m=l['filter'](o=>evalSignal(o,a,b));if(m['length']===l['length']){i=l;break;}const n=m['length']/l['length'];m['length']>0x0&&n>k&&(k=n,j=m);}d['push']({'scenario':h['scenario'],'conflict':h['conflict'],'covered':i!==null,'matchedSignals':i??[],'partialSignals':i?[]:j,'userProtection':h['userProtection']['mechanism']+'\x20('+h['userProtection']['object']+(h['userProtection']['guard']?',\x20guard:\x20'+h['userProtection']['guard']:'')+')','evaluationMetric':h['evaluationMetric'],'recommendation':i?undefined:h['recommendation']});}const e=d['filter'](o=>o['covered']),f=d['filter'](o=>!o['covered']),g=[];return a['edges']['some'](o=>o['relation']==='has_order_allocators')&&g['push']('Milestone\x20escrow:\x20funds\x20locked\x20in\x20Order,\x20released\x20per\x20verified\x20milestone\x20—\x20merchant\x20paid\x20for\x20delivery,\x20user\x20pays\x20for\x20value'),a['adoptedModules']['includes']('accept_timeout_protection')&&g['push']('Accept\x20timeout:\x20customer\x20silence\x20past\x20N\x20days\x20=\x20implicit\x20acceptance\x20—\x20merchant\x20protected\x20from\x20payment\x20stalling'),a['nodes']['some'](o=>o['id']==='main_repository')&&g['push']('WIP\x20provenance:\x20delivery\x20hash\x20on-chain\x20—\x20false\x20claims\x20verifiable\x20against\x20tamper-proof\x20evidence'),a['nodes']['some'](o=>o['id']==='main_arbitration')&&g['push']('Micro-arbitration:\x20Guard-weighted\x20voting\x20with\x20independent\x20Permission\x20—\x20low-cost\x20dispute\x20resolution\x20without\x20platform\x20fees'),a['adoptedModules']['includes']('reputation_on_chain')&&g['push']('On-chain\x20reputation:\x20both\x20sides\x27\x20behavior\x20permanently\x20recorded\x20—\x20future\x20transactions\x20price\x20the\x20risk'),{'results':d,'coveredCount':e['length'],'totalCount':d['length'],'exposedScenarios':f['map'](o=>o['scenario']),'wowAlignments':g,'summary':f['length']===0x0?'All\x20'+d['length']+'\x20adversarial\x20scenarios\x20have\x20on-chain\x20mitigations.':f['length']+'/'+d['length']+'\x20adversarial\x20scenarios\x20EXPOSED:\x20'+f['map'](o=>o['scenario'])['join'](',\x20')+'.\x20Apply\x20the\x20recommendations\x20to\x20align\x20incentives.'};}
|