@wowok/agent-mcp 3.4.2 → 3.4.3
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/.build-stamp.json +5 -0
- package/dist/chain-semantics/composition-truth.js +1 -1
- package/dist/chain-semantics/eval-order.js +1 -1
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +10 -3
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.d.ts +30 -2
- package/dist/composition/emit-phases.js +1 -1
- package/dist/composition/guard-fill.d.ts +8 -0
- package/dist/composition/guard-fill.js +1 -1
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/input-normalize.js +1 -1
- package/dist/composition/materialize.d.ts +2 -0
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.js +1 -1
- package/dist/composition/param-disclosure.js +1 -1
- package/dist/composition/plan-retry-ledger.d.ts +16 -0
- package/dist/composition/plan-retry-ledger.js +1 -1
- package/dist/composition/plan.d.ts +15 -1
- package/dist/composition/plan.js +1 -1
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/config/judgment.d.ts +5 -0
- package/dist/config/judgment.js +1 -1
- package/dist/evaluation/builtins/arbitration-score.d.ts +1 -0
- package/dist/evaluation/builtins/arbitration-score.js +1 -1
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.d.ts +8 -0
- package/dist/evaluation/builtins/graph-service.js +1 -1
- package/dist/evaluation/capability.d.ts +9 -0
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/extract.d.ts +9 -1
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/evaluation/match-policy.d.ts +5 -3
- package/dist/evaluation/match-policy.js +1 -1
- package/dist/evaluation/standards.d.ts +1 -0
- package/dist/evaluation/standards.js +1 -1
- package/dist/evaluation/structured-lines.js +1 -1
- package/dist/evaluation/types.d.ts +1 -0
- package/dist/extensions/capability.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/intent/types.d.ts +1 -1
- package/dist/intent/types.js +1 -1
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +17 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +7 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/arbitration-rail-verifier.d.ts +35 -0
- package/dist/knowledge/arbitration-rail-verifier.js +1 -0
- package/dist/knowledge/audit-rules.d.ts +11 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/judgment-baselines.json +1 -0
- package/dist/knowledge/baselines/rules/guard.json +7 -6
- package/dist/knowledge/baselines/rules/progress.json +4 -4
- package/dist/knowledge/baselines/rules/reward.json +118 -3
- package/dist/knowledge/builtin-templates.d.ts +3 -2
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/chain-query-registry.d.ts +14 -0
- package/dist/knowledge/chain-query-registry.js +1 -0
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fee-param-bindings.d.ts +2 -0
- package/dist/knowledge/fee-param-bindings.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-binding-table.js +1 -1
- package/dist/knowledge/guard-binding-verifier.d.ts +7 -0
- package/dist/knowledge/guard-binding-verifier.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-host-context.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +3 -1
- package/dist/knowledge/guard-node-gates.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +2 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +2 -0
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.js +1 -1
- package/dist/knowledge/param-schema.d.ts +1 -1
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.d.ts +2 -0
- package/dist/knowledge/param-tiers.js +1 -1
- package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
- package/dist/knowledge/pattern-resolutions.d.ts +2 -0
- package/dist/knowledge/pattern-resolutions.js +1 -1
- package/dist/knowledge/product-detail-source.d.ts +37 -0
- package/dist/knowledge/product-detail-source.js +1 -0
- package/dist/knowledge/product-doc-b5.d.ts +16 -0
- package/dist/knowledge/product-doc-b5.js +1 -0
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/publish-gate.d.ts +20 -0
- package/dist/knowledge/publish-gate.js +1 -0
- package/dist/knowledge/publish-readiness.d.ts +25 -0
- package/dist/knowledge/publish-readiness.js +1 -0
- package/dist/knowledge/publish-surface-contract.d.ts +16 -0
- package/dist/knowledge/publish-surface-contract.js +1 -0
- package/dist/knowledge/rail-exit-satisfiability.d.ts +25 -0
- package/dist/knowledge/rail-exit-satisfiability.js +1 -0
- package/dist/knowledge/reward-ledger.d.ts +1 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-risk.d.ts +1 -1
- package/dist/knowledge/reward-risk.js +1 -1
- package/dist/knowledge/service-ledger.d.ts +3 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/template-loader.d.ts +41 -2
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +17 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +4 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/normalize.d.ts +1 -1
- package/dist/monitor/normalize.js +1 -1
- package/dist/monitor/types.js +1 -1
- package/dist/participation/game-context.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +28 -3
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +4 -0
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/order.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +24 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +11 -7
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.d.ts +4 -0
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +28 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +21 -0
- package/dist/schema/call/contact.d.ts +4 -0
- package/dist/schema/call/demand.d.ts +4 -0
- package/dist/schema/call/guard.d.ts +12 -0
- package/dist/schema/call/handler.d.ts +1 -0
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +16 -8
- package/dist/schema/call/normalize-error.d.ts +1 -0
- package/dist/schema/call/normalize-error.js +1 -0
- package/dist/schema/call/order.d.ts +7 -3
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.d.ts +7 -3
- package/dist/schema/call/permission.d.ts +4 -0
- package/dist/schema/call/personal.d.ts +4 -0
- package/dist/schema/call/progress.d.ts +4 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/proof.d.ts +8 -0
- package/dist/schema/call/receipt.js +1 -1
- package/dist/schema/call/repository.d.ts +4 -0
- package/dist/schema/call/reward.d.ts +6 -2
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.d.ts +2 -2
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +6 -2
- package/dist/schema/call/treasury.d.ts +10 -6
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/envelope-unify.d.ts +1 -0
- package/dist/schema/envelope-unify.js +1 -1
- package/dist/schema/evaluation/index.d.ts +43 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +14 -2
- package/dist/schema/goal/planning.d.ts +18 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +12 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +1 -0
- package/dist/schema/local/index.d.ts +10 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/messenger/index.d.ts +1 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +95 -12
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +22 -0
- package/dist/schema/query/bi.d.ts +28 -2
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +67 -61
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workflow/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +1 -0
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +2 -1
- package/dist/schemas/benchmark_migration_operation.output.json +74 -0
- package/dist/schemas/benchmark_migration_operation.schema.json +32 -0
- package/dist/schemas/bridge_operation.output.json +2 -1
- package/dist/schemas/bridge_operation.schema.json +40 -0
- package/dist/schemas/evaluation_operation.output.json +96 -0
- package/dist/schemas/evaluation_operation.schema.json +39 -0
- package/dist/schemas/goal_operation.schema.json +32 -0
- package/dist/schemas/guard2file.schema.json +8 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +10 -2
- package/dist/schemas/intent_radar.schema.json +5 -1
- package/dist/schemas/keeper_operation.output.json +2 -1
- package/dist/schemas/local_cache_operation.output.json +2 -1
- package/dist/schemas/local_history_operation.output.json +2 -1
- package/dist/schemas/local_info_operation.output.json +2 -1
- package/dist/schemas/local_mark_operation.output.json +2 -1
- package/dist/schemas/local_mark_operation.schema.json +10 -1
- package/dist/schemas/machineNode2file.schema.json +8 -0
- package/dist/schemas/messenger_operation.output.json +2 -1
- package/dist/schemas/messenger_operation.schema.json +2 -1
- package/dist/schemas/monitor_events.output.json +2 -1
- package/dist/schemas/monitor_subscription.output.json +2 -1
- package/dist/schemas/onchain_events.output.json +206 -13
- package/dist/schemas/onchain_events.schema.json +16 -0
- package/dist/schemas/onchain_operations.output.json +22 -3
- package/dist/schemas/onchain_operations.schema.json +971 -326
- package/dist/schemas/onchain_operations_allocation.schema.json +19 -12
- package/dist/schemas/onchain_operations_arbitration.schema.json +9 -1
- package/dist/schemas/onchain_operations_contact.schema.json +8 -0
- package/dist/schemas/onchain_operations_demand.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_guard.schema.json +654 -114
- package/dist/schemas/onchain_operations_machine.schema.json +11 -3
- package/dist/schemas/onchain_operations_order.schema.json +14 -11
- package/dist/schemas/onchain_operations_payment.schema.json +12 -9
- package/dist/schemas/onchain_operations_permission.schema.json +8 -0
- package/dist/schemas/onchain_operations_personal.schema.json +8 -0
- package/dist/schemas/onchain_operations_progress.schema.json +9 -1
- package/dist/schemas/onchain_operations_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_repository.schema.json +8 -0
- package/dist/schemas/onchain_operations_reward.schema.json +14 -11
- package/dist/schemas/onchain_operations_service.schema.json +13 -10
- package/dist/schemas/onchain_operations_treasury.schema.json +17 -19
- package/dist/schemas/onchain_table_data.output.json +52 -10
- package/dist/schemas/persona_operation.output.json +57 -0
- package/dist/schemas/persona_operation.schema.json +9 -0
- package/dist/schemas/query_toolkit.output.json +325 -22
- package/dist/schemas/query_toolkit.schema.json +18 -5
- package/dist/schemas/wip_file.output.json +2 -2
- package/dist/schemas/wip_file.schema.json +2 -2
- package/dist/schemas/workflow_operation.schema.json +1 -1
- package/dist/tools/error-catalog.d.ts +17 -0
- package/dist/tools/error-catalog.js +1 -0
- package/dist/tools/handlers/benchmark-migration.d.ts +20 -8
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/entry-edge-recipe.d.ts +101 -0
- package/dist/tools/handlers/entry-edge-recipe.js +1 -0
- package/dist/tools/handlers/escrow-deficit.d.ts +10 -0
- package/dist/tools/handlers/escrow-deficit.js +1 -0
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/fund-rail-recipe.d.ts +10 -0
- package/dist/tools/handlers/fund-rail-recipe.js +1 -0
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/mark-namespace.d.ts +30 -0
- package/dist/tools/handlers/mark-namespace.js +1 -0
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain-name-registration.d.ts +1 -0
- package/dist/tools/handlers/onchain-name-registration.js +1 -1
- package/dist/tools/handlers/onchain-name-registration.spec.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +30 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/publish-binding-echo.d.ts +22 -0
- package/dist/tools/handlers/publish-binding-echo.js +1 -0
- package/dist/tools/handlers/query.d.ts +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/review-chain.d.ts +1 -0
- package/dist/tools/handlers/review-chain.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/stale-build-check.d.ts +9 -0
- package/dist/tools/handlers/stale-build-check.js +1 -0
- package/dist/tools/handlers/submission-assembly.d.ts +55 -0
- package/dist/tools/handlers/submission-assembly.js +1 -0
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/publish-gate-state.d.ts +5 -0
- package/dist/tools/publish-gate-state.js +1 -0
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/retry.js +1 -1
- package/dist/tools/runtime-health.js +1 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/upgrade-check.d.ts +1 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wip-verify-ledger.d.ts +2 -0
- package/dist/tools/wip-verify-ledger.js +1 -1
- package/dist/tools/wrap.d.ts +15 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PUBLISH_SURFACE_CONTRACT_VERSION='1.3.0';export const PUBLISH_SURFACE_CONTRACT=[{'id':'MC-TOPOLOGY-01','gate':'auditMachineNodes','faces':['machine_publish'],'enforcement':'always','defect_class':'R-M1-11\x20dispute\x20nodes\x20on-Machine\x20/\x20MC-C-04\x20missing\x20entry\x20pair\x20/\x20operator\x20sanity\x20on\x20effective\x20node\x20set\x20(inline\x20AND\x20by-reference)','origin':'R-M1-11,\x20MC-C-04;\x20F-001\x20effective-state\x20fix','wired_in':'wrap'},{'id':'MC-CLOSURE-01','gate':'closureFindings','faces':['machine_publish'],'enforcement':'always','defect_class':'publish\x20closure\x20findings\x20on\x20machine\x20graph\x20(unreachable/terminal\x20anomalies)','origin':'PG-CLOSURE-01\x20(gf32)','wired_in':'wrap'},{'id':'MC-TASKBIND-01','gate':'lintForwardGuardsTaskBinding','faces':['machine_publish'],'enforcement':'always','defect_class':'forward\x20guards\x20with\x20task-row\x20binding\x20gaps\x20—\x20unauthorized\x20dual-rail\x20advance','origin':'gfm31\x20P05\x20(1000/1002\x20unauthorized\x20dual-track,\x20chain-rejected\x20within\x20minutes)','wired_in':'wrap'},{'id':'MC-REVIEWLOCK-01','gate':'lintForwardReviewLocks','faces':['machine_publish'],'enforcement':'always','defect_class':'review-window\x20forward\x20locks\x20missing/mispinned','origin':'proactive\x20consolidation','wired_in':'wrap'},{'id':'MC-ARBRAIL-01','gate':'lintForwardArbRulingRails','faces':['machine_publish'],'enforcement':'always','defect_class':'an\x20arbitration\x20OUTCOME\x20that\x20cannot\x20move\x20the\x20order,\x20judged\x20on\x20the\x20frozen\x20graph\x20by\x20QUERY\x20SEMANTICS\x20(never\x20template_id\x20or\x20node\x20name):\x20ARB_RULING_PRESENCE_ONLY\x20/\x20ARB_RULING_STATUS_GATE\x20block;\x20ARB_RULING_VENUE_UNBOUND\x20/\x20ARB_RULING_ZERO_EXIT\x20warn;\x20ARB_RULING_ONE_SIDED\x20discloses','origin':'publish-face\x20twin\x20of\x20the\x20scan-only\x20R-DIR-01/02\x20+\x20R-ARB-ZERO-EXIT,\x20which\x20classify\x20by\x20template_id\x20and\x20semantic_role\x20—\x20neither\x20survives\x20to\x20the\x20chain,\x20so\x20a\x20hand-composed\x20store\x20never\x20saw\x20them\x20(the\x20same\x20gap\x20that\x20made\x20SV-RAILPAIR-01\x20unconditional).\x20Severity\x20per\x20measurement\x20over\x20v170:\x20presence-only\x20and\x20arb.status\x20are\x200/16\x20arbitration\x20archetypes\x20(blockable);\x20won-only\x20is\x208/16\x20and\x20the\x20only\x202\x20ruling-only\x20waypoints\x20are\x20declared-final\x20post-settlement\x20re-routers\x20whose\x20drained-escrow\x20exemption\x20is\x20NOT\x20statically\x20decidable\x20at\x20publish\x20(disclose/warn\x20only)','wired_in':'wrap'},{'id':'MC-TIMEPROFILE-01','gate':'lintForwardGuardsTimeProfile','faces':['machine_publish'],'enforcement':'always','defect_class':'forward\x20guard\x20time-profile\x20contradictions\x20(timeout\x20vs\x20window).\x20NAMED\x20DEGRADE\x20(N8\x20ktt6\x20F-14\x20re-carving\x202026-11-04):\x20env.window_profile=\x27test\x27\x20downgrades\x20the\x20numeric\x20violations\x20to\x20loud\x20disclosures\x20for\x20a\x20DISPOSABLE\x20trial\x20run\x20—\x20but\x20a\x20test-profile\x20publish\x20on\x20an\x20explicit\x20real\x20network\x20(testnet/mainnet)\x20is\x20BLOCKED\x20on\x20every\x20face\x20in\x20the\x20harness\x20pre-publish\x20hook','origin':'R7-01\x20family','wired_in':'wrap'},{'id':'MC-SVCCONST-01','gate':'lintForwardGuardServiceConstants','faces':['machine_publish'],'enforcement':'always','defect_class':'guard\x20pinned\x20to\x20wrong-shop\x20Service\x20constant\x20slot\x20—\x20order\x20strands\x20(guard\x20creation\x20module\x20conflict\x20on-chain)','origin':'P0-3\x20mtb-tn-261030','wired_in':'wrap'},{'id':'MC-BINDSEM-01','gate':'lintGuardBindingSemantics','faces':['machine_publish','service_publish','guard_binding'],'enforcement':'always','defect_class':'per-host\x20guard\x20binding\x20semantics\x20—\x20drain\x20surface\x20/\x20T10\x20hijack\x20binds\x20(MF_SLOT_IDENTITY_ANCHOR\x20family)','origin':'ruling\x202026-10-31\x20(G2)','wired_in':'wrap'},{'id':'MC-TASKBIND-PRE-01','gate':'lintMachineTaskBindingPreflight','faces':['machine_publish'],'enforcement':'always','defect_class':'machine-side\x20task\x20binding\x20preflight\x20(order/task\x20row\x20anchors\x20resolvable)','origin':'K4R\x20claimed_by\x20ordering\x20leg\x20batch','wired_in':'wrap'},{'id':'MC-SVCCONST-REF-01','gate':'lintMachineGuardServiceConstants','faces':['machine_publish','service_publish'],'enforcement':'always','defect_class':'by-reference\x20machine\x20publish:\x20guard\x20constants\x20pinned\x20to\x20foreign\x20Service','origin':'P0-3\x20residual\x20(machine\x20ref\x20publish\x20face)','wired_in':'wrap'},{'id':'MC-EVIDENCE-01','gate':'lintForwardGuardEvidenceMarkers','faces':['machine_publish'],'enforcement':'always','defect_class':'forward\x20guard\x20evidence\x20markers\x20(proof/event\x20anchors)\x20malformed','origin':'proactive\x20consolidation','wired_in':'wrap'},{'id':'SV-PERMAUTH-01','gate':'checkPermissionAuthorization','faces':['service_publish'],'enforcement':'strict_audit_only','defect_class':'IMMUT-002\x20—\x20custom\x20permission\x20index\x20grants\x20unauthorized\x20writers\x20(immutable\x20after\x20publish)','origin':'IMMUT-002\x20(OUTAGE\x20vs\x20EVIDENCE\x20degrade)','wired_in':'wrap'},{'id':'SV-WIPBIND-01','gate':'lintSalesWipBindings','faces':['service_publish'],'enforcement':'always','defect_class':'sales\x20payload\x20WIP\x20bindings\x20dangling\x20(price/stock\x20refs\x20unresolvable)','origin':'TPL-P1-04/05\x20family','wired_in':'wrap'},{'id':'SV-ALLOCGUARD-01','gate':'lintAllocatorGuards','faces':['service_publish'],'enforcement':'always','defect_class':'allocator-bound\x20guard\x20roots\x20unresolvable\x20/\x20fund-safety\x20contradiction\x20(chain-grounded).\x20Its\x20R-TIME-PROFILE\x20leg\x20shares\x20the\x20MC-TIMEPROFILE-01\x20named\x20degrade\x20(env.window_profile=\x27test\x27;\x20real-network\x20formal\x20publish\x20still\x20BLOCKS)','origin':'allocator-rail-verifier\x20publish\x20face\x20(ledger\x20rule\x208\x20authority)','wired_in':'wrap'},{'id':'SV-ESCROWEXIT-01','gate':'lintServiceEscrowExitCoverage','faces':['service_publish'],'enforcement':'always','defect_class':'R-ESCROW-LEAF\x20—\x20terminal\x20node\x20with\x20NO\x20drain\x20entry\x20exists\x20→\x20escrow\x20strands\x20(1.0\x20WOW实证)','origin':'R-ESCROW-LEAF\x20(4R-05)','wired_in':'wrap'},{'id':'SV-RAILEXIT-01','gate':'verifyRailExitSatisfiability','faces':['service_publish'],'enforcement':'always','defect_class':'the\x20SATISFIABILITY\x20half\x20of\x20R-ESCROW-LEAF\x20—\x20a\x20terminal\x20whose\x20rails\x20all\x20pin\x20the\x20right\x20node\x20yet\x20none\x20can\x20ever\x20FIRE,\x20so\x20the\x20escrow\x20strands\x20while\x20SV-ESCROWEXIT-01\x20reports\x20green:\x20RAIL_EXIT_WINDOW_CLOSED\x20(a\x20monotone-closing\x20clock\x20leg\x20in\x20an\x20unavoidable\x20position\x20—\x20draining\x20escrow\x20through\x20a\x20rail\x20is\x20an\x20explicit\x20call\x20needing\x20a\x20same-tx\x20passport,\x20so\x20once\x20the\x20window\x20shuts\x20no\x20signer\x20can\x20produce\x20one,\x20and\x20the\x20pool\x20is\x20append-only\x20with\x20no\x20drain\x20backdoor)\x20/\x20RAIL_EXIT_ARB_GATED\x20(an\x20unavoidable\x20arb.*\x20read,\x20which\x20returns\x20W_OBJECT_NOT_FOUND\x20and\x20ABORTS\x20the\x20whole\x20tx\x20rather\x20than\x20evaluating\x20false,\x20so\x20the\x20never-disputed\x20majority\x20has\x20no\x20exit)','origin':'R-ESCROW-LEAF\x20upgrade\x20(task\x20③,\x202026-11-04).\x20Severity\x20per\x20two-layer\x20measurement\x20over\x20v170:\x20LAYER\x20A\x20—\x20of\x20127\x20declared\x20rail\x20keys,\x2078\x20resolve\x20to\x20a\x20concrete\x20body\x20through\x20the\x20compiler\x27s\x20own\x20default-resolution\x20chain\x20and\x20ZERO\x20trips\x20either\x20code;\x20LAYER\x20B\x20is\x20resolution-independent\x20and\x20carries\x20the\x20argument\x20—\x20pattern.time_window_upper_bound\x20(the\x20closing\x20design)\x20is\x20bound\x20to\x20machine_forward\x20ONLY\x20across\x20all\x2030\x20archetypes,\x20exactly\x20as\x20its\x20own\x20`host`\x20field\x20declares,\x20and\x20no\x20arb-reading\x20tpl_*\x20is\x20bound\x20to\x20any\x20rail.\x20A\x20hit\x20therefore\x20means\x20the\x20payload\x20diverged\x20from\x20every\x20shipped\x20archetype.\x20Doctrine\x20source:\x20pattern.time_window_upper_bound\x27s\x20EXPIRY\x20SEMANTICS\x20note\x20—\x20\x27an\x20expired\x20window\x20only\x20fails\x20the\x20FORWARD\x20it\x20gates\x20…\x20pair\x20with\x20a\x20machine\x20expiry\x20node\x20or\x20an\x20allocator\x20recover\x20rail\x20for\x20the\x20post-window\x20fund\x20path\x27;\x20a\x20closing\x20leg\x20ON\x20the\x20fund\x20rail\x20is\x20that\x20pairing\x20inverted','wired_in':'wrap'},{'id':'SV-ARBNEUTRAL-01','gate':'checkArbitrationNeutrality','faces':['service_publish'],'enforcement':'strict_audit_only','defect_class':'R2-04\x20—\x20arbitrator-neutral\x20object\x20bound\x20as\x20merchant-biased\x20referee\x20(degraded\x20read\x20degrades\x20verdict)','origin':'R2-04\x20(OUTAGE\x20vs\x20EVIDENCE\x20degrade)','wired_in':'wrap'},{'id':'SV-RAILPAIR-01','gate':'lintAllocatorRailPairing','faces':['service_publish'],'enforcement':'always','defect_class':'H1B-03\x20—\x20symbolic\x20rail\x20verification\x20over\x20the\x20allocator\x20guards\x20(RAIL_TERMINAL_UNCOVERED\x20/\x20RAIL_AWARD_EXIT_MISSING\x20/\x20RAIL_CLAIMED_BY_LEG\x20/\x20RAIL_NO_CALLER_IDENTITY_BOUND\x20/\x20RAIL_DEAD_LITERAL).\x20UNCONDITIONAL\x20since\x202026-11-04\x20(was\x20arbitration-scoped),\x20fed\x20a\x20TOPOLOGY-DERIVED\x20node\x20matrix\x20via\x20chainNodeRailMatrix\x20—\x20the\x20chain\x20stores\x20no\x20semantic\x20role,\x20so\x20the\x20former\x20bare\x20{name}\x20rows\x20left\x20`terminals`\x20empty\x20and\x20RAIL_TERMINAL_UNCOVERED\x20could\x20never\x20fire\x20on\x20a\x20publish\x20payload\x20—\x20and,\x20from\x20the\x20same\x20day,\x20fed\x20the\x20SERVICE\x27S\x20EFFECTIVE\x20ON-CHAIN\x20BINDING:\x20a\x20publish-by-reference\x20(staged)\x20call\x20carries\x20neither\x20allocators\x20nor\x20a\x20machine\x20because\x20both\x20were\x20bound\x20in\x20earlier\x20calls,\x20so\x20the\x20payload-only\x20read\x20returned\x20silent\x20on\x20exactly\x20the\x20hand-compose\x20flow\x20this\x20incident\x20class\x20lives\x20in.\x20`serviceRef`\x20now\x20resolves\x20the\x20Service\x20object\x20once\x20and\x20its\x20`order_allocators`/`machine`\x20backfill\x20both\x20gaps\x20(same\x20move\x20as\x20the\x20R-ESCROW-LEAF\x20cure);\x20an\x20unresolvable\x20ref\x20is\x20graded\x20by\x20face\x20—\x20a\x20FAILED\x20read\x20blocks\x20only\x20the\x20strict\x20dry_run\x20audit\x20and\x20warns\x20on\x20the\x20formal\x20publish\x20(OUTAGE\x20vs\x20EVIDENCE),\x20a\x20read\x20that\x20resolved\x20NO\x20Service\x20object\x20warns\x20on\x20both','origin':'H1B-03\x20(1.0\x20WOW\x20stranded);\x20scope+matrix\x20cure\x202026-11-04\x20(publish\x20face\x20was\x20strictly\x20weaker\x20than\x20the\x20compile\x20face,\x20which\x20runs\x20the\x20same\x20verifier\x20on\x20every\x20archetype);\x20staged-binding\x20cure\x202026-11-04\x20(the\x20\x27UNCONDITIONAL\x27\x20claim\x20was\x20false\x20for\x20publish-by-reference\x20until\x20the\x20on-chain\x20binding\x20became\x20the\x20fallback\x20source)\x20—\x20landing\x20risk\x20measured\x20over\x20the\x20catalog\x20before\x20enabling:\x2030\x20archetypes\x20/\x20119\x20resolved\x20rails\x20/\x200\x20publish-face\x20criticals,\x2083\x20info\x20receipts\x20(builtin-allocator-rails.spec.ts\x20invariant\x20(d)),\x20plus\x20the\x20matrix\x20half\x20in\x20publish-rail-matrix.spec.ts','wired_in':'wrap'},{'id':'SV-ECHO-01','gate':'echoServicePublishBindings','faces':['service_publish'],'enforcement':'always','defect_class':'et21\x20ISS-015\x20—\x20last-chance\x20binding\x20echo:\x20every\x20named\x20binding\x20this\x20payload\x20will\x20freeze\x20(machine\x20/\x20order_allocators\x20guards\x20+\x20Entity\x20recipients\x20/\x20order_allocators_append\x20/\x20arbitrations\x20/\x20rewards\x20/\x20object.permission)\x20is\x20resolved\x20name\x20→\x20address\x20→\x20on-chain\x20object\x20type\x20through\x20the\x20namespace-aware\x20LocalMark\x20resolver.\x20An\x20UNRESOLVABLE\x20local\x20name\x20or\x20a\x20resolved\x20type\x20that\x20does\x20not\x20match\x20the\x20slot\x20(expected\x20Entity\x20payee\x20resolving\x20to\x20a\x20Guard)\x20BLOCKS\x20the\x20FORMAL\x20publish\x20—\x20order_allocators\x20is\x20append-only\x20after\x20publish\x20(the\x20allocator\x20table\x20can\x20never\x20be\x20edited\x20once\x20the\x20service\x20is\x20live),\x20so\x20a\x20mis-bound\x20payee\x20is\x20permanently\x20wrong;\x20the\x20dry_run\x20strict\x20audit\x20echoes\x20WITHOUT\x20blocking\x20(the\x20formal\x20dispatch\x20is\x20the\x20irreversible\x20step).\x20Cross-build\x20bare-name\x20collision\x20advisories\x20ride\x20the\x20same\x20resolver\x20(LocalMark\x20write-path\x20namespace,\x20same\x20slice)','origin':'et21\x20ISS-015\x20(publish-face\x20audit\x20ledger\x20P0#4;\x20binding-manifest\x20echo\x20first\x20slice,\x202026-11-04)','wired_in':'wrap'},{'id':'AUTH-COMPILE-01','gate':'checkAllocatorRails','faces':['service_publish','machine_publish'],'enforcement':'always','defect_class':'compile.ts\x20rail\x20blockers\x20—\x20RAIL_TERMINAL_UNCOVERED\x20/\x20RAIL_CLAIMED_BY_LEG\x20/\x20RAIL_NO_CALLER_IDENTITY_BOUND\x20/\x20REFUND_GATE_POLARITY_MIX\x20(template/DSL\x20path)','origin':'allocator-rail-verifier\x20(compile-time\x20authority)','wired_in':'compile'},{'id':'AUTH-AUDITRULES-01','gate':'audit_machine_bound','faces':['service_publish'],'enforcement':'advisory','defect_class':'audit-rules\x20catalog\x20—\x20machine\x20bound\x20/\x20dangling\x20deps\x20/\x20repo\x20integrity\x20caller\x20legs\x20(aggregate_risks\x20face,\x20wowok-auditor\x20consumer)','origin':'audit-rules.ts\x20catalog','wired_in':'audit-rules'},{'id':'SV-REFUNDSAT-01','gate':'checkRefundRecipientSatisfiability','faces':['service_publish'],'enforcement':'always','defect_class':'T10-10\x20—\x20a\x20refund\x20guard\x20pinning\x20its\x20recipient\x20identifier\x20to\x20context(Signer)\x20is\x20unsatisfiable\x20against\x20the\x20order-anchored\x20escrow,\x20so\x20order\x20funds\x20strand\x20permanently\x20once\x20the\x20allocators\x20lock\x20(fail-soft\x20to\x20advisory\x20on\x20fetch\x20error)','origin':'T10-10\x20(GuardIdentifier\x20x\x20for_object\x20x\x20Guard-equality\x20triple)','wired_in':'onchain'},{'id':'SV-ARBDECOR-01','gate':'checkArbitrationsBeforePublish','faces':['service_publish'],'enforcement':'always','defect_class':'decorative\x20dispute\x20path\x20—\x20a\x20bound\x20Arbitration\x20whose\x20voting_guard\x20roster\x20leaves\x20the\x20arb-side\x20admin\x20as\x20the\x20only\x20voter\x20AND\x20the\x20judge\x20(R-ARB-VOTE-LOCK\x20concentration);\x20fail-soft\x20to\x20advisory\x20on\x20resolution/query\x20error','origin':'R-ARB-VOTE-LOCK','wired_in':'onchain'},{'id':'SV-RECIPIENT-01','gate':'checkEntityRecipientGate','faces':['service_publish'],'enforcement':'always','defect_class':'R-RECIPIENT-03\x20—\x20a\x20blank/omitted\x20allocator\x20recipient\x20resolves\x20to\x20the\x20DEFAULT\x20LOCAL\x20ACCOUNT,\x20silently\x20routing\x20customer\x20escrow\x20to\x20the\x20builder;\x20blocks\x20rather\x20than\x20warns\x20because\x20order_allocators\x20is\x20L1-immutable\x20after\x20publish\x20(the\x20same\x20gate\x20also\x20covers\x20allocation.allocators)','origin':'R-RECIPIENT-03\x20(direct-sales\x20Entity\x20recipient)','wired_in':'onchain'},{'id':'SV-ALLOCPLAN-01','gate':'checkOrderAllocatorsPrePublish','faces':['service_publish'],'enforcement':'always','defect_class':'R-A-1\x20allocator-plan\x20structural\x20family\x20+\x20R-A-2-03\x20duplicate\x20guards\x20—\x20the\x20subset\x20decidable\x20without\x20Guard\x20table/root\x20evidence\x20blocks;\x20everything\x20else\x20degrades\x20to\x20a\x20warning,\x20and\x20an\x20internal\x20error\x20never\x20blocks\x20(the\x20gate\x20must\x20not\x20become\x20a\x20new\x20failure\x20mode)','origin':'R-A-1\x20/\x20R-A-2-03','wired_in':'onchain'},{'id':'SV-WIPNET-01','gate':'checkSalesWipNetworkDeployment','faces':['service_publish'],'enforcement':'always','defect_class':'a\x20localnet-only\x20WIP\x20is\x20unreachable\x20from\x20testnet/mainnet\x20machines,\x20so\x20every\x20order\x20fails\x20100%\x20—\x20hard-blocked\x20on\x20those\x20networks,\x20advisory\x20on\x20localnet','origin':'WIP-B\x20network\x20calibration','wired_in':'onchain'},{'id':'SV-ZEROPRICE-01','gate':'checkSalesZeroPrice','faces':['service_publish'],'enforcement':'always','defect_class':'F-BS-76\x20—\x20sale()\x20has\x20no\x20price\x20floor\x20so\x20price\x200\x20lists\x20fine,\x20then\x20NOBODY\x20can\x20ever\x20buy\x20it\x20(client\x20zero-total\x20gate\x20and\x20the\x20on-chain\x20zero-total\x20abort\x20both\x20refuse);\x20discovery\x20cost\x20one\x20run\x201\x20679\x20440\x20gas\x20to\x20add\x20and\x20787\x20124\x20to\x20remove','origin':'F-BS-76\x20(bs-mn-261022)','wired_in':'onchain'},{'id':'SV-UMIMS-01','gate':'checkUmContactHasIm','faces':['service_publish'],'enforcement':'always','defect_class':'an\x20empty\x20Contact\x20ims\x20vector\x20leaves\x20pre-order\x20negotiation,\x20customer_required\x20private-info\x20delivery\x20and\x20post-sale\x20support\x20with\x20NO\x20channel\x20—\x20Messenger\x20routes\x20to\x20ims\x20members,\x20so\x20the\x20store\x20publishes\x20unreachable','origin':'on-chain\x20contact\x20ims\x20routing','wired_in':'onchain'},{'id':'SV-AUDITCAT-01','gate':'auditService','faces':['service_publish'],'enforcement':'advisory','defect_class':'audit-rules\x20service\x20catalog\x20(SKIP_RULES-filtered)\x20—\x20NOTE:\x20an\x20`error`-severity\x20finding\x20is\x20pushed\x20as\x20an\x20[AUDIT\x20ERROR]\x20constraintWarning\x20and\x20does\x20NOT\x20block,\x20so\x20the\x20catalog\x27s\x20own\x20severity\x20scale\x20is\x20cosmetic\x20on\x20this\x20face','origin':'audit-rules.ts\x20catalog','wired_in':'onchain'},{'id':'MC-PERMISS-01','gate':'checkMachinePermissionBeforePublish','faces':['machine_publish'],'enforcement':'advisory','defect_class':'a\x20forward\x27s\x20permissionIndex\x20with\x20no\x20entity\x20granted\x20on\x20the\x20bound\x20Permission\x20—\x20the\x20edge\x20is\x20unadvanceable\x20by\x20anyone\x20(advisory\x20because\x20a\x20new\x20Permission\x20may\x20be\x20granted\x20after\x20publish)','origin':'permission-index\x20grant\x20coverage','wired_in':'onchain'},{'id':'MC-ORPHANGUARD-01','gate':'lintMachineGuardBindings','faces':['machine_publish'],'enforcement':'advisory','defect_class':'F-29\x20—\x20the\x20session\x20created\x20Guard\x20object(s)\x20but\x20the\x20publishable\x20graph\x20binds\x20ZERO\x20of\x20them\x20on\x20any\x20forward\x20(the\x20silent-drop\x20shape:\x20$ref\x20pre-evaluated\x20to\x20undefined,\x20JSON.stringify\x20drops\x20the\x20key,\x20publish\x20succeeds,\x20edges\x20freeze\x20unguarded)','origin':'F-29\x20(tv8-tn-261030)','wired_in':'onchain'},{'id':'MC-ANCHORREACH-01','gate':'checkGuardAnchorReachability','faces':['machine_publish'],'enforcement':'advisory','defect_class':'a\x20guard\x20time-anchor\x20that\x20no\x20reachable\x20node\x20ever\x20establishes\x20makes\x20its\x20window\x20unsatisfiable\x20—\x20the\x20guard\x20can\x20never\x20pass,\x20so\x20the\x20rail\x20it\x20gates\x20is\x20dead\x20(Dijkstra\x20over\x20the\x20anchor\x20x\x20node\x20profile)','origin':'guard-anchor-reach.ts','wired_in':'onchain'},{'id':'GD-NODEGATE-01','gate':'lintGuardNodeGates','faces':['guard_binding'],'enforcement':'advisory','defect_class':'guard\x20node-gate\x20advisory\x20on\x20the\x20guard\x20create/update\x20face\x20—\x20a\x20node\x20pin\x20that\x20the\x20intended\x20host\x20machine\x20never\x20enters','origin':'guard\x20node-gate\x20parse\x20(parseGuardNodeGates)','wired_in':'onchain'},{'id':'GD-REWARDONCE-01','gate':'checkRewardOnceArming','faces':['guard_binding'],'enforcement':'advisory','defect_class':'a\x20funded\x20Reward\x20pool\x20whose\x20mounted\x20guard\x20carries\x20no\x20once-stamp\x20is\x20replayable,\x20and\x20the\x20bsw4\x20F-11\x20window-delay\x20advisory\x20rides\x20the\x20same\x20sweep;\x20reward\x20guard_add\x20is\x20a\x20bind\x20face\x20per\x20isGuardBindingOperation','origin':'bsw4\x20F-11\x20/\x20reward\x20replay\x20stamp','wired_in':'onchain'},{'id':'GD-REWARDEVID-01','gate':'verifyRewardEvidenceBindings','faces':['guard_binding'],'enforcement':'advisory','defect_class':'reward\x20evidence\x20bindings\x20that\x20the\x20deployed\x20package\x20drops\x20on\x20read-back\x20—\x20fail-soft,\x20never\x20masks\x20the\x20operation\x27s\x20own\x20outcome','origin':'reward\x20evidence\x20read-back','wired_in':'onchain'}];export const PUBLISH_SURFACE_EXEMPT_GATES={'checkAllocatorRails':'compile-face\x20authority\x20(template\x20path);\x20invoked\x20by\x20the\x20compile\x20pipeline,\x20registered\x20as\x20AUTH-COMPILE-01','auditRepoIntegrityAndCallerLegs':'plan-level\x20repo\x20integrity\x20(plan\x20build\x20face,\x20not\x20the\x20dispatch\x20publish\x20gate)','checkForeignServicePins':'plan-level\x20foreign\x20pin\x20disclosure\x20(plan\x20build\x20face)','checkDaysUnitSlots':'compile\x20normalization\x20check\x20(plan\x20build\x20face)','checkWindowTruncation':'compile\x20normalization\x20check\x20(plan\x20build\x20face)','dropEmptyVecGuards':'compile\x20normalization\x20step\x20(not\x20a\x20gate)','checkProjectStage':'project\x20tool\x20stage\x20hint\x20(wip_file/project\x20face,\x20not\x20publish)','lintAllocatorGuardSet':'internal\x20helper\x20behind\x20lintAllocatorGuards\x20and\x20the\x20pre-buy\x20screening\x20gate','lintTaskBindingAdvisories':'internal\x20helper\x20behind\x20the\x20task-binding\x20advisory\x20family\x20(protocol\x20254)','lintGuard':'guard-lint\x20module\x20entry\x20invoked\x20INSIDE\x20composing\x20lints,\x20not\x20a\x20publish\x20gate\x20itself','lintReviewLockedTerminals':'internal\x20helper\x20behind\x20lintForwardReviewLocks','verifyAllocatorRails':'internal\x20helper\x20behind\x20lintAllocatorRailPairing\x20(single-source\x20verifier\x20core)','verifyArbitrationRulingRails':'internal\x20helper\x20behind\x20lintForwardArbRulingRails\x20(single-source\x20ruling-rail\x20verifier\x20core)','verifyCollectedGuardBindings':'internal\x20helper\x20behind\x20lintGuardBindingSemantics\x20(batch\x20collection)','verifyGuardBinding':'internal\x20helper\x20behind\x20verifyCollectedGuardBindings\x20(single\x20host)','auditGuardRelies':'internal\x20helper\x20inside\x20verifyCollectedGuardBindings\x20(guard-relies\x20audit)','checkEntityRecipients':'internal\x20helper\x20behind\x20checkEntityRecipientGate\x20(registered\x20as\x20SV-RECIPIENT-01)','checkArbitrationVenueOrder':'Arbitration\x20CREATION\x20face\x20(venue\x20ordering\x20findings\x20at\x20arb\x20build),\x20not\x20a\x20Service/Machine\x20publish\x20gate','checkClientSchemaCompatibility':'client\x20schema-version\x20negotiation\x20(schema\x20layer),\x20not\x20a\x20publish\x20gate','checkDiscountFloorBeforeIssue':'discount\x20ISSUANCE\x20face\x20—\x20judged\x20when\x20a\x20discount\x20is\x20created,\x20not\x20at\x20publish','checkDiscountThresholdBeforeBuy':'BUY\x20face\x20—\x20the\x20pre_buy\x20gate\x20(wrap.ts\x20runPreBuyChecks)\x20owns\x20purchase-time\x20screening','verifyGuardFailureLegs':'runtime\x20E_VERIFY_FAILED\x20diagnosis\x20(leg-by-leg\x20replay\x20of\x20a\x20FAILED\x20guard\x20submission),\x20not\x20a\x20pre-publish\x20gate','verifyOrderNewLanded':'post-transaction\x20read-back\x20of\x20an\x20order_new\x20landing,\x20not\x20a\x20pre-publish\x20gate'};export function gatesForFace(a){return PUBLISH_SURFACE_CONTRACT['filter'](b=>b['faces']['includes'](a));}export function blockingGatesForFace(a){return gatesForFace(a)['filter'](b=>b['enforcement']==='always');}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type GuardTableRow, type GuardTreeNode } from "./allocator-rail-verifier.js";
|
|
2
|
+
export declare function classifyTimeComparison(node: GuardTreeNode | undefined, table: GuardTableRow[]): "closing" | "opening" | "neutral";
|
|
3
|
+
export declare function closingWindowUnavoidable(root: unknown, table: GuardTableRow[]): boolean;
|
|
4
|
+
export declare function arbReadUnavoidable(root: unknown): boolean;
|
|
5
|
+
export type RailExitFindingCode = "RAIL_EXIT_WINDOW_CLOSED" | "RAIL_EXIT_ARB_GATED";
|
|
6
|
+
export type RailExitFindingLevel = "critical" | "info";
|
|
7
|
+
export interface RailExitFinding {
|
|
8
|
+
code: RailExitFindingCode;
|
|
9
|
+
level: RailExitFindingLevel;
|
|
10
|
+
detail: string;
|
|
11
|
+
node: string;
|
|
12
|
+
refs: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface RailExitInput {
|
|
15
|
+
ref: string;
|
|
16
|
+
root: unknown;
|
|
17
|
+
table?: GuardTableRow[];
|
|
18
|
+
pos: Set<string>;
|
|
19
|
+
neg: Set<string>;
|
|
20
|
+
}
|
|
21
|
+
export interface RailExitVerifyInput {
|
|
22
|
+
rails: RailExitInput[];
|
|
23
|
+
terminals: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare function verifyRailExitSatisfiability(input: RailExitVerifyInput): RailExitFinding[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ObjectType}from'@wowok/wowok';import{getGuardQueryByIdOrName}from'../schema/utils/guard-query-utils.js';import{resolveValue}from'./allocator-rail-verifier.js';const CMP_GREATER='logic_as_u256_greater',CMP_LESSER='logic_as_u256_lesser',CMP_GREATER_EQ='logic_as_u256_greater_or_equal',CMP_LESSER_EQ='logic_as_u256_lesser_or_equal',COMPARISONS=new Set([CMP_GREATER,CMP_LESSER,CMP_GREATER_EQ,CMP_LESSER_EQ]);function asNode(a){if(typeof a!=='object'||a===null)return undefined;const b=a['type'];return typeof b==='string'?a:undefined;}function childrenOf(a){const b=[];if(Array['isArray'](a['nodes']))for(const e of a['nodes']){const f=asNode(e);if(f)b['push'](f);}const d=asNode(a['node']);if(d)b['push'](d);for(const g of['left','right','nodeLeft','nodeRight']){const h=asNode(a[g]);if(h)b['push'](h);}return b;}function typeOf(a){const b=asNode(a);return b===undefined?'':String(b['type']??'');}function timeSourceOf(a){const b=asNode(a);if(!b)return undefined;if(b['type']==='time_until')return'time_until';if(b['type']==='context'&&String(b['context']??'')['toLowerCase']()==='clock')return'clock';for(const d of childrenOf(b)){const e=timeSourceOf(d);if(e)return e;}return undefined;}function numericOf(a,b){if(!b)return undefined;if(b['type']==='constant'){const e=b['value'];if(typeof e==='number'&&Number['isFinite'](e))return e;if(typeof e==='string'&&e['trim']()!==''&&Number['isFinite'](Number(e)))return Number(e);}const c=resolveValue(a,b);if(!c['known'])return undefined;const d=c['value'];if(typeof d==='number'&&Number['isFinite'](d))return d;if(typeof d==='bigint')return Number(d);if(typeof d==='string'&&d['trim']()!==''&&Number['isFinite'](Number(d)))return Number(d);return undefined;}function flip(a){if(a===CMP_GREATER)return CMP_LESSER;if(a===CMP_LESSER)return CMP_GREATER;if(a===CMP_GREATER_EQ)return CMP_LESSER_EQ;if(a===CMP_LESSER_EQ)return CMP_GREATER_EQ;return a;}export function classifyTimeComparison(a,b){if(!a||!COMPARISONS['has'](String(a['type']??'')))return'neutral';const c=Array['isArray'](a['nodes'])?a['nodes']['map'](asNode):[];if(c['length']<0x2)return'neutral';const [d,e]=c,f=timeSourceOf(d),g=timeSourceOf(e);if(f&&g)return'neutral';const h=f??g;if(!h)return'neutral';const i=f?e:d;if(timeSourceOf(i))return'neutral';const j=f?String(a['type']):flip(String(a['type'])),l=numericOf(b,i);if(h==='clock')return j===CMP_GREATER||j===CMP_GREATER_EQ?'opening':'closing';if(j===CMP_GREATER)return l!==undefined&&l>=0x0?'closing':'neutral';if(j===CMP_GREATER_EQ)return l!==undefined&&l>0x0?'closing':'neutral';return'opening';}function containsClosingComparison(a,b){const c=asNode(a);if(!c)return![];if(classifyTimeComparison(c,b)==='closing')return!![];return childrenOf(c)['some'](d=>containsClosingComparison(d,b));}function isArbQueryLeaf(a){const b=asNode(a);if(!b||b['type']!=='query')return![];const c=b['query'];if(typeof c!=='number'&&typeof c!=='string')return![];return getGuardQueryByIdOrName(c)?.['objectType']===ObjectType['Arb'];}function containsArbQuery(a){const b=asNode(a);if(!b)return![];if(isArbQueryLeaf(b))return!![];return childrenOf(b)['some'](d=>containsArbQuery(d));}export function closingWindowUnavoidable(a,b){const c=asNode(a);if(!c)return![];const d=childrenOf(c);switch(String(c['type']??'')){case'logic_and':return d['some'](e=>closingWindowUnavoidable(e,b));case'logic_or':return d['length']>0x0&&d['every'](e=>closingWindowUnavoidable(e,b));case'logic_not':return![];default:return containsClosingComparison(c,b);}}export function arbReadUnavoidable(a){const b=asNode(a);if(!b)return![];const c=String(b['type']??''),d=childrenOf(b);switch(c){case'logic_and':return d['some'](e=>arbReadUnavoidable(e));case'logic_or':return d['length']>0x0&&d['every'](e=>arbReadUnavoidable(e));case'logic_not':return d['some'](e=>arbReadUnavoidable(e));default:return containsArbQuery(b);}}function covers(a,b){return a['pos']['size']>0x0?a['pos']['has'](b):!a['neg']['has'](b);}export function verifyRailExitSatisfiability(a){const b=[],{rails:c,terminals:d}=a;if(c['length']===0x0||d['length']===0x0)return b;const e=c['map'](f=>({'rail':f,'closed':closingWindowUnavoidable(f['root'],f['table']??[]),'arbGated':arbReadUnavoidable(f['root'])}));for(const f of d){const g=e['filter'](i=>covers(i['rail'],f));if(g['length']===0x0)continue;const h=g['map'](i=>i['rail']['ref']);g['every'](i=>i['closed'])&&b['push']({'code':'RAIL_EXIT_WINDOW_CLOSED','level':'critical','node':f,'refs':h,'detail':'terminal\x20\x22'+f+'\x22\x20has\x20'+g['length']+'\x20allocator\x20rail(s)\x20('+h['join'](',\x20')+')\x20and\x20EVERY\x20one\x20of\x20them\x20'+'carries\x20a\x20monotone-CLOSING\x20clock\x20leg\x20in\x20an\x20unavoidable\x20position\x20—\x20a\x20comparison\x20that\x20becomes\x20permanently\x20'+'false\x20once\x20wall-clock\x20passes\x20its\x20bound.\x20The\x20on-chain\x20clock\x20only\x20ever\x20advances,\x20the\x20remaining-time\x20helper\x20'+'saturates\x20to\x20zero\x20forever\x20past\x20its\x20target,\x20and\x20the\x20anchors\x20these\x20legs\x20are\x20compared\x20against\x20are\x20immutable\x20'+'once\x20written;\x20an\x20order\x20rests\x20at\x20a\x20terminal\x20indefinitely,\x20so\x20the\x20window\x20is\x20guaranteed\x20to\x20close\x20while\x20it\x20is\x20'+'still\x20sitting\x20there.\x0a'+'Consequence:\x20draining\x20escrow\x20through\x20an\x20allocator\x20rail\x20is\x20an\x20EXPLICIT\x20call\x20that\x20the\x20chain\x20honours\x20only\x20'+'when\x20the\x20caller\x20presents\x20a\x20passport\x20proving\x20this\x20very\x20root\x20evaluated\x20true\x20inside\x20the\x20same\x20transaction\x20—\x20'+'no\x20state\x20transition\x20fires\x20it\x20for\x20you.\x20Once\x20the\x20window\x20closes,\x20NO\x20signer\x20can\x20produce\x20that\x20passport,\x20so\x20the\x20'+'terminal\x27s\x20escrow\x20has\x20no\x20exit\x20at\x20all.\x20The\x20allocation\x20pool\x20is\x20append-only\x20with\x20no\x20drain\x20backdoor\x20'+'(F-BS-32:\x20mainnet\x20pool\x200x1dcf3f3a\x20is\x20permanently\x20frozen\x20exactly\x20this\x20way),\x20and\x20rails\x20are\x20immutable\x20after\x20'+'publish\x20(IMMUT-002),\x20so\x20this\x20is\x20unrecoverable\x20on\x20chain.\x0a'+'This\x20is\x20the\x20sanctioned\x20pairing\x20inverted:\x20closing\x20windows\x20belong\x20on\x20a\x20machine\x20FORWARD\x20'+'(pattern.time_window_upper_bound,\x20host:\x20\x22machine_forward\x22),\x20whose\x20own\x20note\x20says\x20\x22an\x20expired\x20window\x20only\x20'+'fails\x20the\x20FORWARD\x20it\x20gates\x20—\x20it\x20does\x20not\x20refund\x20or\x20cancel\x20by\x20itself;\x20pair\x20with\x20a\x20machine\x20expiry\x20node\x20or\x20an\x20'+'allocator\x20recover\x20rail\x20for\x20the\x20post-window\x20fund\x20path\x22.\x20Here\x20the\x20post-window\x20fund\x20path\x20IS\x20what\x20closed.\x0a'+'Fix\x20before\x20publish:\x20keep\x20the\x20closing\x20window\x20on\x20the\x20forward\x20that\x20leaves\x20the\x20pre-terminal\x20node,\x20and\x20give\x20the\x20'+'terminal\x20an\x20OPENING\x20fund\x20rail\x20—\x20pattern.time_lock_progress\x20(Clock\x20>=\x20anchor\x20+\x20lock,\x20permanently\x20true\x20'+'afterwards)\x20or\x20no\x20time\x20leg\x20at\x20all\x20—\x20so\x20money\x20can\x20always\x20leave.\x20A\x20zero-value\x20anchor\x20row\x20on\x20the\x20terminal\x20rail\x20'+'is\x20the\x20sanctioned\x20shape\x20when\x20the\x20pool\x20legitimately\x20drained\x20earlier.'}),g['every'](i=>i['arbGated'])&&b['push']({'code':'RAIL_EXIT_ARB_GATED','level':'critical','node':f,'refs':h,'detail':'terminal\x20\x22'+f+'\x22\x20has\x20'+g['length']+'\x20allocator\x20rail(s)\x20('+h['join'](',\x20')+')\x20and\x20EVERY\x20one\x20of\x20them\x20'+'unavoidably\x20reads\x20an\x20Arb-object\x20query\x20(arb.*).\x20An\x20arb.*\x20leg\x20resolves\x20against\x20an\x20Arb\x20object\x20taken\x20from\x20the\x20'+'guard\x27s\x20constant\x20table\x20or\x20a\x20caller-supplied\x20submission\x20slot;\x20when\x20that\x20object\x20does\x20not\x20exist\x20the\x20read\x20'+'returns\x20W_OBJECT_NOT_FOUND,\x20which\x20PROPAGATES\x20and\x20ABORTS\x20THE\x20WHOLE\x20TRANSACTION\x20—\x20it\x20does\x20not\x20evaluate\x20to\x20'+'false.\x0a'+'Consequence:\x20the\x20majority\x20of\x20orders\x20never\x20open\x20a\x20dispute,\x20so\x20for\x20them\x20there\x20is\x20no\x20Arb\x20object\x20to\x20read\x20and\x20'+'every\x20attempt\x20to\x20drain\x20this\x20terminal\x20aborts.\x20The\x20escrow\x20has\x20no\x20exit\x20for\x20the\x20common\x20case,\x20and\x20rails\x20are\x20'+'immutable\x20after\x20publish\x20(IMMUT-002).\x20A\x20static\x20Arb\x20constant\x20is\x20worse,\x20not\x20better:\x20it\x20pins\x20ONE\x20case,\x20so\x20every\x20'+'other\x20order\x20reads\x20someone\x20else\x27s\x20dispute.\x0a'+'Fix\x20before\x20publish:\x20express\x20the\x20dispute\x20condition\x20on\x20the\x20ORDER,\x20which\x20always\x20exists\x20—\x20order.dispute\x20has\x20'+'(1565)\x20/\x20order.dispute.open\x20(1576)\x20/\x20order.arb.concluded\x20has\x20(1577)\x20/\x20order.dispute.unstamped\x20(1578)\x20/\x20'+'order.principal_refunded\x20(1579)\x20—\x20and\x20keep\x20the\x20arb.*\x20reads\x20(arb.indemnity.amount\x201415\x20and\x20the\x20F-54\x20floor)\x20'+'on\x20the\x20machine\x20FORWARD\x20that\x20the\x20ruling\x20actually\x20drives,\x20or\x20on\x20a\x20SECOND\x20rail\x20so\x20the\x20terminal\x20keeps\x20an\x20'+'arb-free\x20exit.\x20An\x20award\x20rail\x20reading\x20arb.*\x20alongside\x20a\x20node-gated\x20settlement\x20rail\x20is\x20the\x20correct\x20shape\x20and\x20'+'does\x20not\x20trip\x20this\x20gate.'});}return b;}
|
|
@@ -69,7 +69,7 @@ export interface RewardErrorCodeEntry {
|
|
|
69
69
|
}
|
|
70
70
|
export declare const REWARD_ERROR_CODES: RewardErrorCodeEntry[];
|
|
71
71
|
export declare const REWARD_SCENES: RewardScene[];
|
|
72
|
-
export declare const REWARD_LEDGER_VERSION = "1.
|
|
72
|
+
export declare const REWARD_LEDGER_VERSION = "1.1.0";
|
|
73
73
|
export declare function getScenesByPhase(phase: RewardPhase): RewardScene[];
|
|
74
74
|
export declare function findSceneById(id: string): RewardScene | undefined;
|
|
75
75
|
export declare function getScenesByIndustry(industry: string): RewardScene[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD}from'./onchain-constants.js';export{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD};export const REWARD_NEW={'index':0x96,'name':'REWARD_NEW','description':'Create\x20new\x20Reward<T>','governed_operations':['create\x20a\x20new\x20Reward\x20pool'],'sdk_exposed':!![]};export const REWARD_DESCRIPTION={'index':0x97,'name':'REWARD_DESCRIPTION','description':'Update\x20description','governed_operations':['update\x20the\x20Reward\x20description'],'sdk_exposed':!![]};export const REWARD_GUARD={'index':0x98,'name':'REWARD_GUARD','description':'Add\x20/\x20remove\x20expired\x20guards\x20(≤\x20MAX_GUARD_COUNT_REWARD=200)','governed_operations':['add\x20a\x20claim\x20guard\x20to\x20the\x20Reward','remove\x20expired\x20claim\x20guards'],'sdk_exposed':!![]};export const REWARD_COIN_ADD={'index':0x99,'name':'REWARD_COIN_ADD','description':'Deposit\x20Coin<T>\x20directly\x20into\x20Reward\x20balance\x20(joins\x20Balance<T>)','governed_operations':['deposit\x20Coin<T>\x20into\x20the\x20Reward\x20balance'],'sdk_exposed':!![]};export const REWARD_RECEIVE={'index':0x9a,'name':'REWARD_RECEIVE','description':'Receive\x20CoinWrapper<T>\x20into\x20the\x20balance\x20(unwrapped\x20with\x20balance\x20check)','governed_operations':['receive\x20a\x20CoinWrapper<T>\x20payment\x20into\x20the\x20balance'],'sdk_exposed':!![]};export const REWARD_GUARD_EXPIRATION_TIME_ADD={'index':0x9b,'name':'REWARD_GUARD_EXPIRATION_TIME_ADD','description':'Set\x20/\x20cancel\x20guard_not_added_expiration_time\x20(time-lock\x20on\x20new\x20guard\x20additions)','governed_operations':['set\x20or\x20cancel\x20the\x20time-lock\x20on\x20adding\x20new\x20guards'],'sdk_exposed':!![]};export const REWARD_OWNER_RECEIVE={'index':0x9c,'name':'REWARD_OWNER_RECEIVE','description':'Owner\x20receives\x20Receiving<K>\x20/\x20CoinWrapper<K>\x20at\x20terminal\x20state\x20(unwrap\x20→\x20owner)','governed_operations':['owner\x20receipt\x20of\x20payments\x20at\x20terminal\x20state\x20(unwrapped\x20to\x20the\x20owner)','owner\x20receipt\x20of\x20whole\x20objects\x20at\x20terminal\x20state'],'sdk_exposed':!![]};export const REWARD_UM={'index':0x9d,'name':'REWARD_UM','description':'Bind\x20/\x20unbind\x20Contact\x20(UM)\x20for\x20off-chain\x20coordination','governed_operations':['bind\x20a\x20Contact\x20as\x20the\x20UM\x20coordinator','unbind\x20the\x20UM\x20Contact'],'sdk_exposed':!![]};export const REWARD_WITHDRAW={'index':0x9e,'name':'REWARD_WITHDRAW','description':'Withdraw\x20balance\x20from\x20the\x20Reward\x20to\x20the\x20tx\x20sender\x20inside\x20a\x20Payment\x20object\x20receipt\x20(ETS-B,\x20the\x20only\x20non-claim\x20exit;\x20blocked\x20while\x20the\x20declared\x20no-guard\x20window\x20guard_not_added_expiration_time\x20is\x20in\x20the\x20future)','governed_operations':['withdraw\x20an\x20amount\x20from\x20the\x20Reward\x20balance,\x20delivered\x20to\x20the\x20executing\x20account\x20inside\x20a\x20Payment\x20object\x20(the\x20on-chain\x20receipt;\x20unwrap\x20mode\x20pays\x20the\x20coin\x20out\x20in\x20the\x20same\x20transaction)\x20(fails\x20with\x20E_GUARD_LOCKED_TIME\x20while\x20guard_not_added_expiration_time\x20is\x20in\x20the\x20future)'],'sdk_exposed':!![]};export const REWARD_PERMISSIONS=[REWARD_NEW,REWARD_DESCRIPTION,REWARD_GUARD,REWARD_COIN_ADD,REWARD_RECEIVE,REWARD_GUARD_EXPIRATION_TIME_ADD,REWARD_OWNER_RECEIVE,REWARD_UM,REWARD_WITHDRAW];export const REWARD_FIELDS=[{'name':'id','move_type':'UID','mutability':'immutable','set_at_creation':!![],'constraint':'Object\x20UID;\x20assigned\x20at\x20creation.\x20Never\x20changes.'},{'name':'description','move_type':'String','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x97,'constraint':'Must\x20satisfy\x20common::DESCRIPTION.\x20Updated\x20via\x20permission\x20151.'},{'name':'guards','move_type':'vector<RewardGuard>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x98,'constraint':'vector::length\x20<\x20MAX_GUARD_COUNT\x20(200);\x20E_GUARD_COUNT_EXCEEDED\x20on\x20overflow.','related_errors':['E_GUARD_COUNT_EXCEEDED']},{'name':'balance','move_type':'Balance<T>','mutability':'runtime','set_at_creation':!![],'constraint':'Zero\x20at\x20creation\x20(balance::zero());\x20grows\x20via\x20coin_add/receive;\x20shrinks\x20via\x20claim\x20(split)\x20and\x20via\x20withdraw\x20(ETS-B,\x20funds\x20leave\x20inside\x20a\x20Payment\x20object\x20receipt,\x20only\x20when\x20the\x20no-guard\x20window\x20has\x20elapsed).','related_errors':['E_INSUFFICIENT_BALANCE','E_GUARD_LOCKED_TIME']},{'name':'guard_not_added_expiration_time','move_type':'Option<u64>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x9b,'constraint':'Option<timestamp_ms>.\x20When\x20Some(t):\x20guard_add\x20AND\x20withdraw\x20require\x20clock\x20>\x20t\x20(E_GUARD_LOCKED_TIME).\x20When\x20None\x20or\x20t\x20<\x20now:\x20guards\x20can\x20be\x20added\x20and\x20balance\x20withdrawn.','related_errors':['E_GUARD_LOCKED_TIME','E_GUARD_LOCKED_TIME_NOT_INCREASING','E_GUARD_LOCKED_TIME_INVALID']},{'name':'record','move_type':'ParentTable<address,\x20RecipientRecord>','mutability':'runtime','set_at_creation':!![],'constraint':'Per-recipient\x20claim\x20history.\x20Each\x20RecipientRecord.amount\x20vector\x20has\x20length\x20<\x20MAX_RECORD_COUNT\x20(5200);\x20E_RECORD_COUNT_EXCEEDED\x20on\x20overflow.','related_errors':['E_RECORD_COUNT_EXCEEDED']},{'name':'um','move_type':'Option<address>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x9d,'constraint':'Option<Contact\x20address>.\x20Binding\x20creates\x20an\x20object-linker\x20core\x20binding;\x20unbinding\x20disaffiliates.'},{'name':'permission','move_type':'address','mutability':'admin_mutable','set_at_creation':!![],'constraint':'Permission\x20object\x20address.\x20Updated\x20owner-only\x20(asserts\x20old.owner\x20==\x20sender);\x20the\x20change\x20is\x20registered\x20as\x20an\x20object-linker\x20affiliation\x20change.'}];export const REWARD_GUARD_CONSTRUCTORS=[{'constructor':'dynamic_recipient_dynamic_amount','recipient_type':'GuardIdentifier','amount_type':'GuardU64Identifier','params':{'recipient_param':'u8','amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['recipient\x20identifier\x20must\x20resolve\x20to\x20an\x20address\x20in\x20the\x20Passport\x20table\x20—\x20E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Dynamic\x20recipient\x20+\x20dynamic\x20amount\x20—\x20both\x20extracted\x20from\x20Passport\x20at\x20claim\x20time\x20(e.g.\x20referral\x20rewards\x20where\x20referrer\x20and\x20amount\x20vary\x20per\x20claim).'},{'constructor':'dynamic_recipient_fixed_amount','recipient_type':'GuardIdentifier','amount_type':'Fixed','params':{'recipient_param':'u8','amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['recipient\x20identifier\x20must\x20resolve\x20to\x20an\x20address\x20in\x20the\x20Passport\x20table\x20—\x20E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Dynamic\x20recipient\x20+\x20fixed\x20amount\x20—\x20e.g.\x20first-order\x20reward\x20where\x20any\x20new\x20customer\x20claims\x20a\x20fixed\x201\x20WOW.'},{'constructor':'entity_recipient_dynamic_amount','recipient_type':'Entity','amount_type':'GuardU64Identifier','params':{'recipient_param':'address','amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Fixed\x20recipient\x20+\x20dynamic\x20amount\x20—\x20e.g.\x20tiered\x20loyalty\x20reward\x20where\x20amount\x20depends\x20on\x20Passport\x20submission\x20(tier\x20level).'},{'constructor':'entity_recipient_fixed_amount','recipient_type':'Entity','amount_type':'Fixed','params':{'recipient_param':'address','amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Fully\x20fixed\x20recipient\x20+\x20amount\x20—\x20simplest\x20configuration\x20(e.g.\x20specific\x20partner\x20bounty).'},{'constructor':'caller_recipient_dynamic_amount','recipient_type':'Signer','amount_type':'GuardU64Identifier','params':{'amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Caller\x20is\x20recipient\x20+\x20dynamic\x20amount\x20—\x20e.g.\x20self-service\x20claim\x20where\x20amount\x20depends\x20on\x20Passport\x20submission\x20(e.g.\x20cashback\x20rate).'},{'constructor':'caller_recipient_fixed_amount','recipient_type':'Signer','amount_type':'Fixed','params':{'amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Caller\x20is\x20recipient\x20+\x20fixed\x20amount\x20—\x20e.g.\x20flash\x20sale\x20where\x20any\x20eligible\x20caller\x20claims\x20a\x20fixed\x20reward.'}];export const REWARD_ERROR_CODES=[{'code':0x1,'name':'E_GUARD_LOCKED_TIME_NOT_INCREASING','description':'guard-lock\x20time\x20update:\x20new\x20time\x20<\x20current\x20clock\x20(must\x20be\x20≥\x20now)','trigger_operation':'guard-lock\x20time\x20update\x20(155)'},{'code':0x2,'name':'E_GUARD_EXPIRED','description':'guard_add\x20on\x20guard\x20with\x20expiration_time\x20<\x20now,\x20OR\x20claim\x20on\x20guard\x20with\x20expiration_time\x20<\x20now','trigger_operation':'guard_add\x20/\x20claim'},{'code':0x3,'name':'E_GUARD_COUNT_EXCEEDED','description':'guard_add\x20would\x20exceed\x20MAX_GUARD_COUNT=200\x20(only\x20on\x20NEW\x20guard,\x20not\x20on\x20update\x20of\x20existing)','trigger_operation':'guard_add'},{'code':0x4,'name':'E_RECIPIENT_IDENTIFIER_NOT_ADDRESS','description':'RewardGuard\x20constructor:\x20recipient\x20identifier\x20type\x20is\x20not\x20address\x20(GuardIdentifier\x20variant\x20only)','trigger_operation':'claim-guard\x20construction'},{'code':0x5,'name':'E_AMOUNT_NOT_U64','description':'RewardGuard\x20constructor:\x20amount\x20identifier\x20type\x20is\x20not\x20u64\x20(GuardU64Identifier\x20variant\x20only)','trigger_operation':'claim-guard\x20construction'},{'code':0x6,'name':'E_INSUFFICIENT_BALANCE','description':'claim:\x20balance\x20<\x20amount\x20(cannot\x20split\x20more\x20than\x20held)','trigger_operation':'claim'},{'code':0x7,'name':'E_GUARD_NOT_FOUND','description':'claim:\x20no\x20guard\x20in\x20self.guards\x20matches\x20the\x20supplied\x20guard\x20address','trigger_operation':'claim'},{'code':0x8,'name':'E_RECORD_COUNT_EXCEEDED','description':'claim:\x20recipient\x20already\x20has\x20MAX_RECORD_COUNT=5200\x20entries\x20(E_RECORD_COUNT_EXCEEDED)','trigger_operation':'claim'},{'code':0xa,'name':'E_GUARD_LOCKED_TIME','description':'guard_add\x20/\x20withdraw\x20while\x20guard_not_added_expiration_time\x20is\x20Some\x20and\x20clock\x20≤\x20expiration_time','trigger_operation':'guard_add\x20/\x20withdraw'},{'code':0xb,'name':'E_GUARD_LOCKED_TIME_INVALID','description':'guard-lock\x20time\x20update:\x20new\x20Some(t)\x20where\x20t\x20≤\x20now\x20(must\x20be\x20future)','trigger_operation':'guard-lock\x20time\x20update\x20(155)'},{'code':0xc,'name':'E_STORE_FROM_ID_NOT_COMPATIBLE','description':'RewardGuard\x20constructor:\x20store_from_id\x20identifier\x20type\x20is\x20not\x20number\x20or\x20address','trigger_operation':'claim-guard\x20construction'},{'code':0xd,'name':'E_CLAIM_ALREADY_MADE','description':'claim:\x20the\x20once-slot\x20for\x20this\x20(guard,\x20store_from\x20value)\x20was\x20already\x20claimed\x20by\x20any\x20signer\x20—\x20first\x20come,\x20first\x20served\x20(MOV-PROTOCOL-1212\x20F-01\x20fix\x20—\x20replay\x20aborts,\x20the\x20pool\x20keeps\x20its\x20balance;\x20P155-08\x20v139:\x20a\x20stamped\x20slot\x20pins\x20the\x20key\x27s\x20recipient\x20axis\x20to\x20the\x20@0x0\x20sentinel,\x20so\x20the\x20once\x20domain\x20is\x20(guard,\x20store_from),\x20not\x20per-recipient).\x20Empty\x20store_from\x20slot\x20=\x20once\x20per\x20(recipient,\x20guard),\x20unchanged','trigger_operation':'claim'},{'code':0xe,'name':'E_CLAIM_RECIPIENT_NOT_SIGNER','description':'claim:\x20the\x20resolved\x20recipient\x20(from\x20guard\x20submissions\x20or\x20the\x20Entity\x20binding)\x20is\x20not\x20the\x20transaction\x20sender\x20(MOV-PROTOCOL-1212\x20B5\x20fix\x20—\x20an\x20attacker\x20cannot\x20route\x20a\x20reward\x20to\x20a\x20third\x20address).\x20Entity\x20flows\x20pass\x20because\x20the\x20SDK\x20replaces\x20the\x20sender\x20with\x20the\x20entity\x20account','trigger_operation':'claim'}];export const REWARD_SCENES=[{'id':'reward_first_order','name':'First-order\x20reward','industry':['universal','ecommerce','service','freelance'],'scenario':'New\x20customers\x20receive\x20a\x20fixed\x20reward\x20after\x20their\x20first\x20order.\x20Guard\x20verifies\x20order\x20ownership\x20+\x20first-time\x20status;\x20'+'Recipient=Signer\x20(caller\x20is\x20the\x20new\x20customer);\x20Amount=Fixed\x20(e.g.\x201\x20WOW).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin\x20(e.g.\x200x2::wow::WOW\x20or\x20a\x20custom\x20token)','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20—\x20caller\x20claims\x20a\x20fixed\x20amount\x20(e.g.\x201\x20WOW)','Guard\x20verifies:\x20order_address.holder\x20==\x20signer\x20AND\x20order\x20is\x20the\x20first\x20order\x20(Repository\x20query)','expiration_time\x20bounds\x20the\x20campaign\x20window\x20(e.g.\x2030\x20days)','coin_add\x20deposits\x20the\x20campaign\x20budget\x20upfront\x20(e.g.\x20100\x20WOW\x20for\x20100\x20claims)'],'recommended_templates':['first_order']},{'id':'reward_referral','name':'Referral\x20viral\x20reward','industry':['universal','ecommerce','service','content'],'scenario':'Both\x20referrer\x20and\x20referee\x20receive\x20a\x20reward\x20when\x20the\x20referee\x20completes\x20a\x20first\x20order.\x20Two\x20guards:\x20one\x20for\x20referrer\x20(Entity),\x20one\x20for\x20referee\x20(Signer).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x2,'recipient_types_used':['Entity','Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Entity\x20recipient\x20+\x20Fixed\x20amount\x20for\x20the\x20referrer\x20(recipient\x20=\x20referrer\x20address)','Signer\x20recipient\x20+\x20Fixed\x20amount\x20for\x20the\x20referee\x20(caller\x20is\x20recipient)','Guard\x20verifies:\x20referrer\x20marked\x20in\x20Repository\x20AND\x20referee\x27s\x20order\x20completed','store_from_id\x20may\x20record\x20the\x20order\x20address\x20for\x20audit\x20trail'],'recommended_templates':['referral']},{'id':'reward_loyalty','name':'Loyalty\x20tiered\x20reward','industry':['universal','ecommerce','subscription','content'],'scenario':'Customers\x20unlock\x20higher\x20rewards\x20after\x20reaching\x20cumulative\x20spending\x20tiers.\x20Recipient=Signer;\x20Amount=GuardU64Identifier\x20(tier-dependent\x20amount\x20extracted\x20from\x20Passport).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['GuardU64Identifier'],'uses_expiration_time':![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Signer\x20recipient\x20+\x20identifier\x20amount\x20—\x20amount\x20is\x20dynamic,\x20extracted\x20from\x20Passport\x20submission\x20(tier\x20level\x20→\x20reward\x20amount)','Guard\x20verifies:\x20cumulative\x20spend\x20≥\x20tier\x20threshold\x20(Repository\x20query)','No\x20expiration_time\x20—\x20loyalty\x20is\x20perpetual\x20(until\x20deactivated\x20via\x20guard_remove)','Guard\x20submission\x20value\x20type\x20MUST\x20be\x20u64\x20(E_AMOUNT_NOT_U64\x20otherwise)'],'recommended_templates':['loyalty']},{'id':'reward_flash_sale','name':'Limited-time\x20flash\x20sale\x20reward','industry':['universal','ecommerce','retail'],'scenario':'Time-bounded\x20reward\x20for\x20the\x20first\x20N\x20callers.\x20Recipient=Signer;\x20Amount=Fixed.\x20Guard\x20verifies\x20time\x20window\x20+\x20claim\x20count.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20—\x20fixed\x20amount\x20per\x20claim\x20(e.g.\x202\x20WOW)','expiration_time\x20bounds\x20the\x20flash\x20sale\x20window\x20(e.g.\x2048\x20hours)','the\x20guard-addition\x20time-lock\x20(155)\x20may\x20lock\x20further\x20guard\x20additions\x20during\x20the\x20sale','Budget\x20=\x20max_claims\x20×\x20amount;\x20coin_add\x20deposits\x20this\x20upfront'],'recommended_templates':['flash_sale']},{'id':'reward_bulk_discount','name':'Bulk\x20discount\x20/\x20cashback\x20reward','industry':['universal','ecommerce','wholesale','service'],'scenario':'Customer\x20receives\x20cashback\x20proportional\x20to\x20order\x20size.\x20Recipient=Signer\x20or\x20Entity\x20(order\x20holder);\x20Amount=GuardU64Identifier\x20(cashback\x20rate\x20from\x20Passport).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20payment\x20coin\x20type\x20(must\x20match\x20order\x20payment\x20for\x20clean\x20cashback)','typical_guard_count':0x1,'recipient_types_used':['Signer','Entity'],'amount_types_used':['GuardU64Identifier'],'uses_expiration_time':![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_RECEIVE],'common_patterns':['Signer\x20recipient\x20+\x20identifier\x20amount\x20—\x20caller\x20claims\x20dynamic\x20amount\x20(cashback\x20=\x20order_amount\x20×\x20rate)','store_from_id\x20records\x20the\x20order\x20address\x20for\x20cross-reference\x20(audit\x20trail)','receive\x20(154)\x20may\x20be\x20used\x20to\x20accept\x20CoinWrapper<T>\x20refunds\x20that\x20replenish\x20the\x20balance','Guard\x20verifies:\x20order.completed\x20AND\x20order.service\x20==\x20this\x20Service'],'recommended_templates':['cashback']},{'id':'reward_milestone','name':'Service\x20milestone\x20reward','industry':['universal','ecommerce','content','subscription'],'scenario':'When\x20a\x20Service\x20reaches\x20a\x20milestone\x20(e.g.\x20100\x20orders),\x20early\x20supporters\x20receive\x20extra\x20rewards.\x20Recipient=Entity\x20(early\x20customer);\x20Amount=Fixed.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x32,'recipient_types_used':['Entity'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD],'common_patterns':['Entity\x20recipient\x20+\x20Fixed\x20amount\x20for\x20each\x20early\x20customer\x20(recipient\x20=\x20customer\x20address)','Multiple\x20guards\x20(up\x20to\x2050\x20for\x2050\x20early\x20supporters)\x20—\x20well\x20within\x20MAX_GUARD_COUNT=200','Guard\x20verifies:\x20Service\x20order_count\x20>=\x20milestone\x20AND\x20claimer\x20is\x20in\x20early-customer\x20list','the\x20guard-addition\x20time-lock\x20(155)\x20may\x20lock\x20the\x20guard\x20list\x20after\x20milestone\x20setup'],'recommended_templates':['milestone']}];export const REWARD_LEDGER_VERSION='1.0.0';export function getScenesByPhase(a){return REWARD_SCENES['filter'](b=>b['phases']['includes'](a));}export function findSceneById(a){return REWARD_SCENES['find'](b=>b['id']===a);}export function getScenesByIndustry(a){return REWARD_SCENES['filter'](b=>b['industry']['includes'](a)||b['industry']['includes']('universal'));}export function getBuiltinPermissionByIndex(a){return REWARD_PERMISSIONS['find'](b=>b['index']===a);}export function isRewardBuiltinPermission(a){return getBuiltinPermissionByIndex(a)!==undefined;}export function getAllBuiltinPermissions(){return[...REWARD_PERMISSIONS];}export function getRewardScenesCount(){return REWARD_SCENES['length'];}export function getGuardConstructorSpec(a){return REWARD_GUARD_CONSTRUCTORS['find'](b=>b['constructor']===a);}export function resolveGuardConstructor(a,b){const c={'GuardIdentifier|GuardU64Identifier':'dynamic_recipient_dynamic_amount','GuardIdentifier|Fixed':'dynamic_recipient_fixed_amount','Entity|GuardU64Identifier':'entity_recipient_dynamic_amount','Entity|Fixed':'entity_recipient_fixed_amount','Signer|GuardU64Identifier':'caller_recipient_dynamic_amount','Signer|Fixed':'caller_recipient_fixed_amount'};return c[a+'|'+b];}export function getRewardErrorByCode(a){return REWARD_ERROR_CODES['find'](b=>b['code']===a);}export function getRewardErrorByName(a){return REWARD_ERROR_CODES['find'](b=>b['name']===a);}export function validateGuardCount(a){if(a>=MAX_GUARD_COUNT_REWARD)return{'ok':![],'violation':'Guard\x20count\x20'+a+'\x20would\x20exceed\x20MAX_GUARD_COUNT_REWARD\x20'+MAX_GUARD_COUNT_REWARD};return{'ok':!![]};}export function validateRecordCount(a){if(a>=MAX_RECORD_COUNT_REWARD)return{'ok':![],'violation':'Record\x20count\x20'+a+'\x20would\x20exceed\x20MAX_RECORD_COUNT_REWARD\x20'+MAX_RECORD_COUNT_REWARD+'\x20—\x20recipient\x20can\x20no\x20longer\x20claim'};return{'ok':!![]};}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['flash\x20sale','reward_flash_sale'],['flash_sale','reward_flash_sale'],['limited-time','reward_flash_sale'],['limited\x20time','reward_flash_sale'],['referral','reward_referral'],['viral','reward_referral'],['refer\x20a\x20friend','reward_referral'],['invite','reward_referral'],['loyalty','reward_loyalty'],['tiered','reward_loyalty'],['tier','reward_loyalty'],['repeat','reward_loyalty'],['cashback','reward_bulk_discount'],['bulk\x20discount','reward_bulk_discount'],['bulk_discount','reward_bulk_discount'],['wholesale','reward_bulk_discount'],['milestone','reward_milestone'],['early\x20supporter','reward_milestone'],['early\x20customer','reward_milestone'],['first\x20order','reward_first_order'],['first_order','reward_first_order'],['new\x20customer','reward_first_order'],['first-time','reward_first_order']];for(const [d,e]of c){if(b['includes'](d)){const f=findSceneById(e);if(f)return f;}}return undefined;}export const REWARD_CROSS_OBJECT_REFS=[{'object':'Permission','phase':'universal','relationship':'Reward.permission\x20(address;\x20borrowed\x20for\x20all\x20150-157\x20assertions)'},{'object':'Permission','phase':'permission_update','relationship':'permission\x20update:\x20owner-only\x20(asserts\x20old.owner\x20==\x20sender);\x20registered\x20as\x20an\x20object-linker\x20affiliation\x20change'},{'object':'Guard','phase':'guard_addition','relationship':'RewardGuard.guard\x20=\x20guard.id_address\x20(each\x20guard\x20registered\x20via\x20object-linker\x20core\x20binding)'},{'object':'Guard','phase':'claim','relationship':'claim:\x20iterates\x20self.guards\x20looking\x20for\x20guard.id_address\x20match;\x20E_GUARD_NOT_FOUND\x20if\x20no\x20match'},{'object':'Guard','phase':'claim','relationship':'claim:\x20the\x20guard\x20verification\x20result\x20validates\x20the\x20Passport\x20submission\x20data'},{'object':'Passport','phase':'claim','relationship':'claim:\x20the\x20claimant\x27s\x20Passport\x20submission\x20supplies\x20the\x20recipient\x20(address)\x20and/or\x20amount\x20(u64)\x20per\x20RewardGuard\x20variant'},{'object':'Passport','phase':'claim','relationship':'claim:\x20if\x20store_from_id\x20is\x20Some,\x20extracts\x20store-from\x20address\x20from\x20Passport\x20submission'},{'object':'Payment','phase':'funds_replenish','relationship':'receive\x20(154):\x20unwraps\x20Coin<T>\x20from\x20CoinWrapper<T>\x20(with\x20check)\x20and\x20joins\x20the\x20balance'},{'object':'Payment','phase':'owner_receive','relationship':'owner\x20receipt\x20(156):\x20unwraps\x20CoinWrapper<K>\x20and\x20forwards\x20it\x20to\x20the\x20Permission\x20owner'},{'object':'Repository','phase':'claim','relationship':'Guard\x20may\x20query\x20Repository\x20(e.g.\x20order\x20history\x20for\x20first-order\x20/\x20loyalty\x20verification)'},{'object':'Service','phase':'claim','relationship':'Guard\x20may\x20verify\x20order.service\x20==\x20this\x20Service\x20(cashback\x20/\x20first-order\x20scenarios)'},{'object':'Demand','phase':'guard_addition','relationship':'Guard\x20may\x20be\x20shared\x20with\x20Demand\x20(recommendation\x20filtering);\x20same\x20Guard\x20object\x20address\x20space'},{'object':'Allocation','phase':'owner_receive','relationship':'Terminal\x20Allocation\x20alloc\x20may\x20route\x20funds\x20back\x20to\x20Reward\x20(replenishment\x20loop)'},{'object':'Contact','phase':'um_mgmt','relationship':'UM\x20binding\x20(157):\x20binds\x20Contact\x20(UM)\x20for\x20off-chain\x20coordination;\x20creates\x20object-linker\x20core\x20binding'},{'object':'Coin','phase':'universal','relationship':'Reward<phantom\x20T>:\x20T\x20is\x20the\x20coin\x20type;\x20balance:\x20Balance<T>;\x20coin_add\x20expects\x20Coin<T>'}];
|
|
1
|
+
import{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD}from'./onchain-constants.js';export{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD};export const REWARD_NEW={'index':0x96,'name':'REWARD_NEW','description':'Create\x20new\x20Reward<T>','governed_operations':['create\x20a\x20new\x20Reward\x20pool'],'sdk_exposed':!![]};export const REWARD_DESCRIPTION={'index':0x97,'name':'REWARD_DESCRIPTION','description':'Update\x20description','governed_operations':['update\x20the\x20Reward\x20description'],'sdk_exposed':!![]};export const REWARD_GUARD={'index':0x98,'name':'REWARD_GUARD','description':'Add\x20/\x20remove\x20expired\x20guards\x20(≤\x20MAX_GUARD_COUNT_REWARD=200)','governed_operations':['add\x20a\x20claim\x20guard\x20to\x20the\x20Reward','remove\x20expired\x20claim\x20guards'],'sdk_exposed':!![]};export const REWARD_COIN_ADD={'index':0x99,'name':'REWARD_COIN_ADD','description':'Deposit\x20Coin<T>\x20directly\x20into\x20Reward\x20balance\x20(joins\x20Balance<T>)','governed_operations':['deposit\x20Coin<T>\x20into\x20the\x20Reward\x20balance'],'sdk_exposed':!![]};export const REWARD_RECEIVE={'index':0x9a,'name':'REWARD_RECEIVE','description':'Receive\x20CoinWrapper<T>\x20into\x20the\x20balance\x20(unwrapped\x20with\x20balance\x20check)','governed_operations':['receive\x20a\x20CoinWrapper<T>\x20payment\x20into\x20the\x20balance'],'sdk_exposed':!![]};export const REWARD_GUARD_EXPIRATION_TIME_ADD={'index':0x9b,'name':'REWARD_GUARD_EXPIRATION_TIME_ADD','description':'Set\x20/\x20cancel\x20guard_not_added_expiration_time\x20(time-lock\x20on\x20new\x20guard\x20additions)','governed_operations':['set\x20or\x20cancel\x20the\x20time-lock\x20on\x20adding\x20new\x20guards'],'sdk_exposed':!![]};export const REWARD_OWNER_RECEIVE={'index':0x9c,'name':'REWARD_OWNER_RECEIVE','description':'Owner\x20receives\x20Receiving<K>\x20/\x20CoinWrapper<K>\x20at\x20terminal\x20state\x20(unwrap\x20→\x20owner)','governed_operations':['owner\x20receipt\x20of\x20payments\x20at\x20terminal\x20state\x20(unwrapped\x20to\x20the\x20owner)','owner\x20receipt\x20of\x20whole\x20objects\x20at\x20terminal\x20state'],'sdk_exposed':!![]};export const REWARD_UM={'index':0x9d,'name':'REWARD_UM','description':'Bind\x20/\x20unbind\x20Contact\x20(UM)\x20for\x20off-chain\x20coordination','governed_operations':['bind\x20a\x20Contact\x20as\x20the\x20UM\x20coordinator','unbind\x20the\x20UM\x20Contact'],'sdk_exposed':!![]};export const REWARD_WITHDRAW={'index':0x9e,'name':'REWARD_WITHDRAW','description':'Withdraw\x20balance\x20from\x20the\x20Reward\x20to\x20the\x20tx\x20sender\x20inside\x20a\x20Payment\x20object\x20receipt\x20(ETS-B,\x20the\x20only\x20non-claim\x20exit;\x20blocked\x20while\x20the\x20declared\x20no-guard\x20window\x20guard_not_added_expiration_time\x20is\x20in\x20the\x20future)','governed_operations':['withdraw\x20an\x20amount\x20from\x20the\x20Reward\x20balance,\x20delivered\x20to\x20the\x20executing\x20account\x20inside\x20a\x20Payment\x20object\x20(the\x20on-chain\x20receipt;\x20unwrap\x20mode\x20pays\x20the\x20coin\x20out\x20in\x20the\x20same\x20transaction)\x20(fails\x20with\x20E_GUARD_LOCKED_TIME\x20while\x20guard_not_added_expiration_time\x20is\x20in\x20the\x20future)'],'sdk_exposed':!![]};export const REWARD_PERMISSIONS=[REWARD_NEW,REWARD_DESCRIPTION,REWARD_GUARD,REWARD_COIN_ADD,REWARD_RECEIVE,REWARD_GUARD_EXPIRATION_TIME_ADD,REWARD_OWNER_RECEIVE,REWARD_UM,REWARD_WITHDRAW];export const REWARD_FIELDS=[{'name':'id','move_type':'UID','mutability':'immutable','set_at_creation':!![],'constraint':'Object\x20UID;\x20assigned\x20at\x20creation.\x20Never\x20changes.'},{'name':'description','move_type':'String','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x97,'constraint':'Must\x20satisfy\x20common::DESCRIPTION.\x20Updated\x20via\x20permission\x20151.'},{'name':'guards','move_type':'vector<RewardGuard>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x98,'constraint':'vector::length\x20<\x20MAX_GUARD_COUNT\x20(200);\x20E_GUARD_COUNT_EXCEEDED\x20on\x20overflow.','related_errors':['E_GUARD_COUNT_EXCEEDED']},{'name':'balance','move_type':'Balance<T>','mutability':'runtime','set_at_creation':!![],'constraint':'Zero\x20at\x20creation\x20(balance::zero());\x20grows\x20via\x20coin_add/receive;\x20shrinks\x20via\x20claim\x20(split)\x20and\x20via\x20withdraw\x20(ETS-B,\x20funds\x20leave\x20inside\x20a\x20Payment\x20object\x20receipt,\x20only\x20when\x20the\x20no-guard\x20window\x20has\x20elapsed).','related_errors':['E_INSUFFICIENT_BALANCE','E_GUARD_LOCKED_TIME']},{'name':'guard_not_added_expiration_time','move_type':'Option<u64>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x9b,'constraint':'Option<timestamp_ms>.\x20When\x20Some(t):\x20guard_add\x20AND\x20withdraw\x20require\x20clock\x20>\x20t\x20(E_GUARD_LOCKED_TIME).\x20When\x20None\x20or\x20t\x20<\x20now:\x20guards\x20can\x20be\x20added\x20and\x20balance\x20withdrawn.','related_errors':['E_GUARD_LOCKED_TIME','E_GUARD_LOCKED_TIME_NOT_INCREASING','E_GUARD_LOCKED_TIME_INVALID']},{'name':'record','move_type':'ParentTable<address,\x20RecipientRecord>','mutability':'runtime','set_at_creation':!![],'constraint':'Per-recipient\x20claim\x20history.\x20Each\x20RecipientRecord.amount\x20vector\x20has\x20length\x20<\x20MAX_RECORD_COUNT\x20(5200);\x20E_RECORD_COUNT_EXCEEDED\x20on\x20overflow.','related_errors':['E_RECORD_COUNT_EXCEEDED']},{'name':'um','move_type':'Option<address>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x9d,'constraint':'Option<Contact\x20address>.\x20Binding\x20creates\x20an\x20object-linker\x20core\x20binding;\x20unbinding\x20disaffiliates.'},{'name':'permission','move_type':'address','mutability':'admin_mutable','set_at_creation':!![],'constraint':'Permission\x20object\x20address.\x20Updated\x20owner-only\x20(asserts\x20old.owner\x20==\x20sender);\x20the\x20change\x20is\x20registered\x20as\x20an\x20object-linker\x20affiliation\x20change.'}];export const REWARD_GUARD_CONSTRUCTORS=[{'constructor':'dynamic_recipient_dynamic_amount','recipient_type':'GuardIdentifier','amount_type':'GuardU64Identifier','params':{'recipient_param':'u8','amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['recipient\x20identifier\x20must\x20resolve\x20to\x20an\x20address\x20in\x20the\x20Passport\x20table\x20—\x20E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Dynamic\x20recipient\x20+\x20dynamic\x20amount\x20—\x20both\x20extracted\x20from\x20Passport\x20at\x20claim\x20time\x20(e.g.\x20referral\x20rewards\x20where\x20referrer\x20and\x20amount\x20vary\x20per\x20claim).'},{'constructor':'dynamic_recipient_fixed_amount','recipient_type':'GuardIdentifier','amount_type':'Fixed','params':{'recipient_param':'u8','amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['recipient\x20identifier\x20must\x20resolve\x20to\x20an\x20address\x20in\x20the\x20Passport\x20table\x20—\x20E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Dynamic\x20recipient\x20+\x20fixed\x20amount\x20—\x20e.g.\x20first-order\x20reward\x20where\x20any\x20new\x20customer\x20claims\x20a\x20fixed\x201\x20WOW.'},{'constructor':'entity_recipient_dynamic_amount','recipient_type':'Entity','amount_type':'GuardU64Identifier','params':{'recipient_param':'address','amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Fixed\x20recipient\x20+\x20dynamic\x20amount\x20—\x20e.g.\x20tiered\x20loyalty\x20reward\x20where\x20amount\x20depends\x20on\x20Passport\x20submission\x20(tier\x20level).'},{'constructor':'entity_recipient_fixed_amount','recipient_type':'Entity','amount_type':'Fixed','params':{'recipient_param':'address','amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Fully\x20fixed\x20recipient\x20+\x20amount\x20—\x20simplest\x20configuration\x20(e.g.\x20specific\x20partner\x20bounty).'},{'constructor':'caller_recipient_dynamic_amount','recipient_type':'Signer','amount_type':'GuardU64Identifier','params':{'amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Caller\x20is\x20recipient\x20+\x20dynamic\x20amount\x20—\x20e.g.\x20self-service\x20claim\x20where\x20amount\x20depends\x20on\x20Passport\x20submission\x20(e.g.\x20cashback\x20rate).'},{'constructor':'caller_recipient_fixed_amount','recipient_type':'Signer','amount_type':'Fixed','params':{'amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Caller\x20is\x20recipient\x20+\x20fixed\x20amount\x20—\x20e.g.\x20flash\x20sale\x20where\x20any\x20eligible\x20caller\x20claims\x20a\x20fixed\x20reward.'}];export const REWARD_ERROR_CODES=[{'code':0x1,'name':'E_GUARD_LOCKED_TIME_NOT_INCREASING','description':'guard-lock\x20time\x20update:\x20new\x20time\x20<\x20current\x20clock\x20(must\x20be\x20≥\x20now)','trigger_operation':'guard-lock\x20time\x20update\x20(155)'},{'code':0x2,'name':'E_GUARD_EXPIRED','description':'guard_add\x20on\x20guard\x20with\x20expiration_time\x20<\x20now,\x20OR\x20claim\x20on\x20guard\x20with\x20expiration_time\x20<\x20now','trigger_operation':'guard_add\x20/\x20claim'},{'code':0x3,'name':'E_GUARD_COUNT_EXCEEDED','description':'guard_add\x20would\x20exceed\x20MAX_GUARD_COUNT=200\x20(only\x20on\x20NEW\x20guard,\x20not\x20on\x20update\x20of\x20existing)','trigger_operation':'guard_add'},{'code':0x4,'name':'E_RECIPIENT_IDENTIFIER_NOT_ADDRESS','description':'RewardGuard\x20constructor:\x20recipient\x20identifier\x20type\x20is\x20not\x20address\x20(GuardIdentifier\x20variant\x20only)','trigger_operation':'claim-guard\x20construction'},{'code':0x5,'name':'E_AMOUNT_NOT_U64','description':'RewardGuard\x20constructor:\x20amount\x20identifier\x20type\x20is\x20not\x20u64\x20(GuardU64Identifier\x20variant\x20only)','trigger_operation':'claim-guard\x20construction'},{'code':0x6,'name':'E_INSUFFICIENT_BALANCE','description':'claim:\x20balance\x20<\x20amount\x20(cannot\x20split\x20more\x20than\x20held)','trigger_operation':'claim'},{'code':0x7,'name':'E_GUARD_NOT_FOUND','description':'claim:\x20no\x20guard\x20in\x20self.guards\x20matches\x20the\x20supplied\x20guard\x20address','trigger_operation':'claim'},{'code':0x8,'name':'E_RECORD_COUNT_EXCEEDED','description':'claim:\x20recipient\x20already\x20has\x20MAX_RECORD_COUNT=5200\x20entries\x20(E_RECORD_COUNT_EXCEEDED)','trigger_operation':'claim'},{'code':0xa,'name':'E_GUARD_LOCKED_TIME','description':'guard_add\x20/\x20withdraw\x20while\x20guard_not_added_expiration_time\x20is\x20Some\x20and\x20clock\x20≤\x20expiration_time','trigger_operation':'guard_add\x20/\x20withdraw'},{'code':0xb,'name':'E_GUARD_LOCKED_TIME_INVALID','description':'guard-lock\x20time\x20update:\x20new\x20Some(t)\x20where\x20t\x20≤\x20now\x20(must\x20be\x20future)','trigger_operation':'guard-lock\x20time\x20update\x20(155)'},{'code':0xc,'name':'E_STORE_FROM_ID_NOT_COMPATIBLE','description':'RewardGuard\x20constructor:\x20store_from_id\x20identifier\x20type\x20is\x20not\x20number\x20or\x20address','trigger_operation':'claim-guard\x20construction'},{'code':0xd,'name':'E_CLAIM_ALREADY_MADE','description':'claim:\x20the\x20once-slot\x20for\x20this\x20(guard,\x20store_from\x20value)\x20was\x20already\x20claimed\x20by\x20any\x20signer\x20—\x20first\x20come,\x20first\x20served\x20(MOV-PROTOCOL-1212\x20F-01\x20fix\x20—\x20replay\x20aborts,\x20the\x20pool\x20keeps\x20its\x20balance;\x20P155-08\x20v139:\x20a\x20stamped\x20slot\x20pins\x20the\x20key\x27s\x20recipient\x20axis\x20to\x20the\x20@0x0\x20sentinel,\x20so\x20the\x20once\x20domain\x20is\x20(guard,\x20store_from),\x20not\x20per-recipient).\x20Empty\x20store_from\x20slot\x20=\x20once\x20per\x20(recipient,\x20guard),\x20unchanged','trigger_operation':'claim'},{'code':0xe,'name':'E_CLAIM_RECIPIENT_NOT_SIGNER','description':'claim:\x20the\x20resolved\x20recipient\x20(from\x20guard\x20submissions\x20or\x20the\x20Entity\x20binding)\x20is\x20not\x20the\x20transaction\x20sender\x20(MOV-PROTOCOL-1212\x20B5\x20fix\x20—\x20an\x20attacker\x20cannot\x20route\x20a\x20reward\x20to\x20a\x20third\x20address).\x20Entity\x20flows\x20pass\x20because\x20the\x20SDK\x20replaces\x20the\x20sender\x20with\x20the\x20entity\x20account','trigger_operation':'claim'}];export const REWARD_SCENES=[{'id':'reward_first_order','name':'First-order\x20reward','industry':['universal','ecommerce','service','freelance'],'scenario':'New\x20customers\x20receive\x20a\x20fixed\x20reward\x20after\x20their\x20first\x20order.\x20Guard\x20verifies\x20order\x20ownership\x20+\x20first-time\x20status;\x20'+'Recipient=Signer\x20(caller\x20is\x20the\x20new\x20customer);\x20Amount=Fixed\x20(e.g.\x201\x20WOW).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin\x20(e.g.\x200x2::wow::WOW\x20or\x20a\x20custom\x20token)','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20—\x20caller\x20claims\x20a\x20fixed\x20amount\x20(e.g.\x201\x20WOW)','Guard\x20verifies:\x20order_address.holder\x20==\x20signer\x20AND\x20order\x20is\x20the\x20first\x20order\x20(Repository\x20query)','expiration_time\x20bounds\x20the\x20campaign\x20window\x20(e.g.\x2030\x20days)','coin_add\x20deposits\x20the\x20campaign\x20budget\x20upfront\x20(e.g.\x20100\x20WOW\x20for\x20100\x20claims)'],'recommended_templates':['first_order']},{'id':'reward_referral','name':'Referral\x20viral\x20reward','industry':['universal','ecommerce','service','content'],'scenario':'Both\x20referrer\x20and\x20referee\x20receive\x20a\x20reward\x20when\x20the\x20referee\x20completes\x20a\x20first\x20order.\x20Two\x20guards:\x20one\x20for\x20referrer\x20(Entity),\x20one\x20for\x20referee\x20(Signer).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x2,'recipient_types_used':['Entity','Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Entity\x20recipient\x20+\x20Fixed\x20amount\x20for\x20the\x20referrer\x20(recipient\x20=\x20referrer\x20address)','Signer\x20recipient\x20+\x20Fixed\x20amount\x20for\x20the\x20referee\x20(caller\x20is\x20recipient)','Guard\x20verifies:\x20referrer\x20marked\x20in\x20Repository\x20AND\x20referee\x27s\x20order\x20completed','store_from_id\x20may\x20record\x20the\x20order\x20address\x20for\x20audit\x20trail'],'recommended_templates':['referral']},{'id':'reward_loyalty','name':'Loyalty\x20tiered\x20reward','industry':['universal','ecommerce','subscription','content'],'scenario':'Customers\x20unlock\x20higher\x20rewards\x20after\x20reaching\x20cumulative\x20spending\x20tiers.\x20Recipient=Signer;\x20Amount=GuardU64Identifier\x20(tier-dependent\x20amount\x20extracted\x20from\x20Passport).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['GuardU64Identifier'],'uses_expiration_time':![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Signer\x20recipient\x20+\x20identifier\x20amount\x20—\x20amount\x20is\x20dynamic,\x20extracted\x20from\x20Passport\x20submission\x20(tier\x20level\x20→\x20reward\x20amount)','Guard\x20verifies:\x20cumulative\x20spend\x20≥\x20tier\x20threshold\x20(Repository\x20query)','No\x20expiration_time\x20—\x20loyalty\x20is\x20perpetual\x20(until\x20deactivated\x20via\x20guard_remove)','Guard\x20submission\x20value\x20type\x20MUST\x20be\x20u64\x20(E_AMOUNT_NOT_U64\x20otherwise)'],'recommended_templates':['loyalty']},{'id':'reward_flash_sale','name':'Limited-time\x20flash\x20sale\x20reward','industry':['universal','ecommerce','retail'],'scenario':'Time-bounded\x20reward\x20for\x20the\x20first\x20N\x20callers.\x20Recipient=Signer;\x20Amount=Fixed.\x20Guard\x20verifies\x20time\x20window\x20+\x20claim\x20count.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20—\x20fixed\x20amount\x20per\x20claim\x20(e.g.\x202\x20WOW)','expiration_time\x20bounds\x20the\x20flash\x20sale\x20window\x20(e.g.\x2048\x20hours)','the\x20guard-addition\x20time-lock\x20(155)\x20may\x20lock\x20further\x20guard\x20additions\x20during\x20the\x20sale','Budget\x20=\x20max_claims\x20×\x20amount;\x20coin_add\x20deposits\x20this\x20upfront'],'recommended_templates':['flash_sale']},{'id':'reward_bulk_discount','name':'Bulk\x20discount\x20/\x20cashback\x20reward','industry':['universal','ecommerce','wholesale','service'],'scenario':'Customer\x20receives\x20cashback\x20proportional\x20to\x20order\x20size.\x20Recipient=Signer\x20or\x20Entity\x20(order\x20holder);\x20Amount=GuardU64Identifier\x20(cashback\x20rate\x20from\x20Passport).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20payment\x20coin\x20type\x20(must\x20match\x20order\x20payment\x20for\x20clean\x20cashback)','typical_guard_count':0x1,'recipient_types_used':['Signer','Entity'],'amount_types_used':['GuardU64Identifier'],'uses_expiration_time':![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_RECEIVE],'common_patterns':['Signer\x20recipient\x20+\x20identifier\x20amount\x20—\x20caller\x20claims\x20dynamic\x20amount\x20(cashback\x20=\x20order_amount\x20×\x20rate)','store_from_id\x20records\x20the\x20order\x20address\x20for\x20cross-reference\x20(audit\x20trail)','receive\x20(154)\x20may\x20be\x20used\x20to\x20accept\x20CoinWrapper<T>\x20refunds\x20that\x20replenish\x20the\x20balance','Guard\x20verifies:\x20order.completed\x20AND\x20order.service\x20==\x20this\x20Service'],'recommended_templates':['cashback']},{'id':'reward_milestone','name':'Service\x20milestone\x20reward','industry':['universal','ecommerce','content','subscription'],'scenario':'When\x20a\x20Service\x20reaches\x20a\x20milestone\x20(e.g.\x20100\x20orders),\x20early\x20supporters\x20receive\x20extra\x20rewards.\x20Recipient=Entity\x20(early\x20customer);\x20Amount=Fixed.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x32,'recipient_types_used':['Entity'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD],'common_patterns':['Entity\x20recipient\x20+\x20Fixed\x20amount\x20for\x20each\x20early\x20customer\x20(recipient\x20=\x20customer\x20address)','Multiple\x20guards\x20(up\x20to\x2050\x20for\x2050\x20early\x20supporters)\x20—\x20well\x20within\x20MAX_GUARD_COUNT=200','Guard\x20verifies:\x20Service\x20order_count\x20>=\x20milestone\x20AND\x20claimer\x20is\x20in\x20early-customer\x20list','the\x20guard-addition\x20time-lock\x20(155)\x20may\x20lock\x20the\x20guard\x20list\x20after\x20milestone\x20setup'],'recommended_templates':['milestone']},{'id':'reward_delay_compensation','name':'Delayed-delivery\x20compensation\x20(late\x20payout)','industry':['universal','ecommerce','retail','travel','service'],'scenario':'The\x20merchant\x20PRE-FUNDS\x20a\x20compensation\x20pool\x20for\x20LATE\x20delivery\x20(C-11\x20decision:\x20experience\x20compensation\x20is\x20carried\x20by\x20the\x20'+'Reward\x20object,\x20never\x20by\x20settlement-edge\x20guards\x20—\x20an\x20escrow-pinned\x20late-penalty\x20guard\x20deadlocks\x20the\x20claim\x20window).\x20A\x20buyer\x20'+'whose\x20order\x20finished\x20after\x20the\x20promised\x20time\x20claims\x20from\x20the\x20pool:\x20Recipient=Signer\x20(canonical\x20—\x20the\x20chain\x20asserts\x20the\x20'+'resolved\x20recipient\x20equals\x20the\x20tx\x20sender,\x20abort\x20E_CLAIM_RECIPIENT_NOT_SIGNER,\x20so\x20the\x20money\x20reaches\x20the\x20claimer);\x20Amount=Fixed\x20tiers\x20by\x20default,\x20with\x20an\x20'+'optional\x20GuardU64Identifier\x20variant\x20resolved\x20from\x20the\x20claimer\x27s\x20Passport\x20submission\x20at\x20claim\x20time.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20payment\x20coin\x20type\x20(compensation\x20repays\x20the\x20buyer\x20in\x20the\x20coin\x20they\x20paid\x20with)','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed','GuardU64Identifier'],'uses_expiration_time':!![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD,REWARD_WITHDRAW],'common_patterns':['Signer\x20recipient\x20is\x20the\x20CANONICAL\x20form\x20—\x20the\x20payout\x20lands\x20on\x20the\x20claimer\x27s\x20own\x20account\x20(claim\x20asserts\x20recipient\x20==\x20tx\x20sender,\x20abort\x20E_CLAIM_RECIPIENT_NOT_SIGNER;\x20a\x20GuardIdentifier\x20recipient\x20is\x20structurally\x20unpayable\x20on\x20this\x20rail)','Amount\x20defaults\x20to\x20the\x20Fixed\x20tier\x20ladder\x20aligned\x20to\x20a\x20real\x20product\x27s\x20late\x20tiers\x20(e.g.\x2015/30/60\x20min\x20late\x20→\x20distinct\x20fixed\x20amounts);\x20the\x20GuardU64Identifier\x20VARIANT\x20resolves\x20the\x20amount\x20from\x20the\x20claimer\x27s\x20Passport\x20submission\x20at\x20claim\x20time\x20—\x20the\x20amount\x20is\x20computed\x20by\x20the\x20submitting\x20party\x20and\x20is\x20NOT\x20clamped\x20on-chain,\x20so\x20the\x20tier\x20computation\x20rule\x20MUST\x20be\x20disclosed\x20in\x20the\x20listing\x20(disclosure\x20duty)','Claim\x20window\x20design:\x20the\x20guard\x20opens\x20AFTER\x20the\x20fulfillment\x20terminal\x20+\x20grace\x20and\x20closes\x20bounded\x20via\x20expiration_time;\x20the\x20guard\x27s\x20pass\x20condition\x20must\x20cover\x20EVERY\x20terminal\x20state\x20that\x20may\x20legitimately\x20hold\x20at\x20claim\x20time\x20(completed\x20OR\x20settled\x20—\x20a\x20completed-only\x20root\x20closes\x20forever\x20at\x20settlement,\x20rqd3-tn-261030\x20F-02)','Refund-window\x20offset\x20(tbs7\x20F-04\x20claim-and-return\x20precedent):\x20the\x20compensation\x20guard\x20accepts\x20completed/settled\x20terminals\x20ONLY\x20—\x20a\x20refunded\x20order\x20can\x20never\x20pass,\x20so\x20a\x20buyer\x20cannot\x20claim\x20compensation\x20AND\x20take\x20the\x20refund;\x20where\x20a\x20separate\x20refund\x20rail\x20exists,\x20keep\x20the\x20compensation\x20claim\x20window\x20opening\x20after\x20the\x20refund\x20window\x20lapses','Optional\x20evidence\x20pin:\x20guard_add\x20evidence\x20{repo,key,predicate}\x20ties\x20the\x20claim\x20to\x20a\x20claim-time\x20repository\x20attestation\x20row\x20of\x20THIS\x20claim\x27s\x20own\x20store_from\x20order\x20(requires\x20store_from_id\x20on\x20the\x20same\x20guard;\x20aborts\x2015/16\x20otherwise)','Funding\x20requirement:\x20coin_add\x20the\x20tier\x20budget\x20UPFRONT\x20(expected\x20claims\x20×\x20worst\x20tier);\x20a\x20claim\x20larger\x20than\x20the\x20balance\x20aborts\x20E_INSUFFICIENT_BALANCE\x20(6)\x20—\x20the\x20pool\x20is\x20NOT\x20per-order\x20escrow,\x20there\x20is\x20no\x20per-claim\x20isolation,\x20so\x20the\x20balance\x20must\x20cover\x20the\x20worst-case\x20claim\x20wave','Withdraw\x20discipline\x20(permission\x20158):\x20withdraw\x20is\x20the\x20only\x20non-claim\x20exit\x20and\x20is\x20blocked\x20while\x20guard_expiration_time\x20stands\x20—\x20setting\x20the\x20no-guard\x20window\x20IS\x20the\x20public\x20funding\x20commitment;\x20the\x20right\x20to\x20withdraw\x20the\x20unclaimed\x20remainder\x20after\x20it\x20lapses\x20must\x20be\x20disclosed\x20(reversibility)'],'recommended_templates':[]},{'id':'reward_experience_compensation','name':'Service\x20experience\x20compensation\x20(generic)','industry':['universal','service','freelance','education','rental','subscription'],'scenario':'Generic\x20goodwill\x20pool\x20for\x20service-quality\x20failures\x20(attitude,\x20rework,\x20minor\x20SLA\x20misses\x20—\x20anything\x20short\x20of\x20a\x20payable\x20'+'arbitration\x20indemnity).\x20The\x20merchant\x20pre-funds\x20the\x20pool\x20and\x20lets\x20affected\x20buyers\x20self-claim.\x20Same\x20canonical\x20shape\x20as\x20the\x20'+'delay\x20scene:\x20Recipient=Signer,\x20Amount=Fixed\x20tiers\x20(GuardU64Identifier\x20variant\x20optional\x20with\x20disclosure).\x20This\x20Reward\x20is\x20the\x20'+'MERCHANT\x27S\x20OWN\x20goodwill\x20rail\x20—\x20it\x20is\x20a\x20different\x20object\x20from\x20the\x20Service.compensation_fund\x20arbitration\x20indemnity\x20and\x20never\x20'+'replaces\x20it.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20payment\x20coin\x20type','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed','GuardU64Identifier'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD,REWARD_WITHDRAW],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20(canonical)\x20—\x20e.g.\x20a\x20fixed\x20goodwill\x20credit\x20per\x20incident;\x20the\x20Guard\x20predicate\x20binds\x20the\x20claim\x20to\x20THIS\x20service\x27s\x20order\x20context\x20(order.service\x20==\x20this\x20Service)','GuardU64Identifier\x20VARIANT:\x20amount\x20scales\x20with\x20a\x20submission\x20slot\x20(incident\x20severity\x20tier)\x20—\x20computed\x20by\x20the\x20submitting\x20party,\x20NOT\x20clamped\x20on-chain;\x20disclose\x20the\x20tier\x20rule','Scope\x20boundary:\x20this\x20is\x20GOODWILL,\x20not\x20dispute\x20remedy\x20—\x20binding\x20arbitration\x20and\x20its\x20compensation_fund\x20remain\x20the\x20enforceable\x20path;\x20the\x20compensation\x20Reward\x20never\x20pays\x20what\x20a\x20ruling\x20would,\x20and\x20claiming\x20it\x20does\x20not\x20waive\x20the\x20refund/arbitration\x20rails\x20(windows\x20should\x20be\x20staggered,\x20see\x20reward_delay_compensation)','Claim\x20window:\x20opens\x20after\x20the\x20failure\x20is\x20on-record\x20(the\x20guard\x27s\x20evidence/progress\x20condition)\x20and\x20closes\x20bounded\x20via\x20expiration_time','Funding\x20requirement:\x20coin_add\x20upfront\x20sized\x20to\x20the\x20incident\x20wave\x20(balance\x20shortfall\x20aborts\x20E_INSUFFICIENT_BALANCE\x20(6)\x20at\x20claim\x20time\x20—\x20non-escrow\x20pool,\x20no\x20per-claim\x20isolation)','Withdraw\x20discipline\x20(permission\x20158):\x20unclaimed\x20remainder\x20is\x20withdrawable\x20once\x20the\x20no-guard\x20window\x20(guard_expiration_time)\x20lapses\x20—\x20disclose\x20the\x20withdrawal\x20right\x20as\x20the\x20reversibility\x20boundary\x20of\x20the\x20promise'],'recommended_templates':[]}];export const REWARD_LEDGER_VERSION='1.1.0';export function getScenesByPhase(a){return REWARD_SCENES['filter'](b=>b['phases']['includes'](a));}export function findSceneById(a){return REWARD_SCENES['find'](b=>b['id']===a);}export function getScenesByIndustry(a){return REWARD_SCENES['filter'](b=>b['industry']['includes'](a)||b['industry']['includes']('universal'));}export function getBuiltinPermissionByIndex(a){return REWARD_PERMISSIONS['find'](b=>b['index']===a);}export function isRewardBuiltinPermission(a){return getBuiltinPermissionByIndex(a)!==undefined;}export function getAllBuiltinPermissions(){return[...REWARD_PERMISSIONS];}export function getRewardScenesCount(){return REWARD_SCENES['length'];}export function getGuardConstructorSpec(a){return REWARD_GUARD_CONSTRUCTORS['find'](b=>b['constructor']===a);}export function resolveGuardConstructor(a,b){const c={'GuardIdentifier|GuardU64Identifier':'dynamic_recipient_dynamic_amount','GuardIdentifier|Fixed':'dynamic_recipient_fixed_amount','Entity|GuardU64Identifier':'entity_recipient_dynamic_amount','Entity|Fixed':'entity_recipient_fixed_amount','Signer|GuardU64Identifier':'caller_recipient_dynamic_amount','Signer|Fixed':'caller_recipient_fixed_amount'};return c[a+'|'+b];}export function getRewardErrorByCode(a){return REWARD_ERROR_CODES['find'](b=>b['code']===a);}export function getRewardErrorByName(a){return REWARD_ERROR_CODES['find'](b=>b['name']===a);}export function validateGuardCount(a){if(a>=MAX_GUARD_COUNT_REWARD)return{'ok':![],'violation':'Guard\x20count\x20'+a+'\x20would\x20exceed\x20MAX_GUARD_COUNT_REWARD\x20'+MAX_GUARD_COUNT_REWARD};return{'ok':!![]};}export function validateRecordCount(a){if(a>=MAX_RECORD_COUNT_REWARD)return{'ok':![],'violation':'Record\x20count\x20'+a+'\x20would\x20exceed\x20MAX_RECORD_COUNT_REWARD\x20'+MAX_RECORD_COUNT_REWARD+'\x20—\x20recipient\x20can\x20no\x20longer\x20claim'};return{'ok':!![]};}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['flash\x20sale','reward_flash_sale'],['flash_sale','reward_flash_sale'],['limited-time','reward_flash_sale'],['limited\x20time','reward_flash_sale'],['referral','reward_referral'],['viral','reward_referral'],['refer\x20a\x20friend','reward_referral'],['invite','reward_referral'],['loyalty','reward_loyalty'],['tiered','reward_loyalty'],['tier','reward_loyalty'],['repeat','reward_loyalty'],['cashback','reward_bulk_discount'],['bulk\x20discount','reward_bulk_discount'],['bulk_discount','reward_bulk_discount'],['wholesale','reward_bulk_discount'],['milestone','reward_milestone'],['early\x20supporter','reward_milestone'],['early\x20customer','reward_milestone'],['first\x20order','reward_first_order'],['first_order','reward_first_order'],['new\x20customer','reward_first_order'],['first-time','reward_first_order'],['late\x20delivery','reward_delay_compensation'],['delay\x20compensation','reward_delay_compensation'],['late\x20compensation','reward_delay_compensation'],['lateness','reward_delay_compensation'],['experience\x20compensation','reward_experience_compensation'],['goodwill','reward_experience_compensation']];for(const [d,e]of c){if(b['includes'](d)){const f=findSceneById(e);if(f)return f;}}return undefined;}export const REWARD_CROSS_OBJECT_REFS=[{'object':'Permission','phase':'universal','relationship':'Reward.permission\x20(address;\x20borrowed\x20for\x20all\x20150-157\x20assertions)'},{'object':'Permission','phase':'permission_update','relationship':'permission\x20update:\x20owner-only\x20(asserts\x20old.owner\x20==\x20sender);\x20registered\x20as\x20an\x20object-linker\x20affiliation\x20change'},{'object':'Guard','phase':'guard_addition','relationship':'RewardGuard.guard\x20=\x20guard.id_address\x20(each\x20guard\x20registered\x20via\x20object-linker\x20core\x20binding)'},{'object':'Guard','phase':'claim','relationship':'claim:\x20iterates\x20self.guards\x20looking\x20for\x20guard.id_address\x20match;\x20E_GUARD_NOT_FOUND\x20if\x20no\x20match'},{'object':'Guard','phase':'claim','relationship':'claim:\x20the\x20guard\x20verification\x20result\x20validates\x20the\x20Passport\x20submission\x20data'},{'object':'Passport','phase':'claim','relationship':'claim:\x20the\x20claimant\x27s\x20Passport\x20submission\x20supplies\x20the\x20recipient\x20(address)\x20and/or\x20amount\x20(u64)\x20per\x20RewardGuard\x20variant'},{'object':'Passport','phase':'claim','relationship':'claim:\x20if\x20store_from_id\x20is\x20Some,\x20extracts\x20store-from\x20address\x20from\x20Passport\x20submission'},{'object':'Payment','phase':'funds_replenish','relationship':'receive\x20(154):\x20unwraps\x20Coin<T>\x20from\x20CoinWrapper<T>\x20(with\x20check)\x20and\x20joins\x20the\x20balance'},{'object':'Payment','phase':'owner_receive','relationship':'owner\x20receipt\x20(156):\x20unwraps\x20CoinWrapper<K>\x20and\x20forwards\x20it\x20to\x20the\x20Permission\x20owner'},{'object':'Repository','phase':'claim','relationship':'Guard\x20may\x20query\x20Repository\x20(e.g.\x20order\x20history\x20for\x20first-order\x20/\x20loyalty\x20verification)'},{'object':'Service','phase':'claim','relationship':'Guard\x20may\x20verify\x20order.service\x20==\x20this\x20Service\x20(cashback\x20/\x20first-order\x20scenarios)'},{'object':'Demand','phase':'guard_addition','relationship':'Guard\x20may\x20be\x20shared\x20with\x20Demand\x20(recommendation\x20filtering);\x20same\x20Guard\x20object\x20address\x20space'},{'object':'Allocation','phase':'owner_receive','relationship':'Terminal\x20Allocation\x20alloc\x20may\x20route\x20funds\x20back\x20to\x20Reward\x20(replenishment\x20loop)'},{'object':'Contact','phase':'um_mgmt','relationship':'UM\x20binding\x20(157):\x20binds\x20Contact\x20(UM)\x20for\x20off-chain\x20coordination;\x20creates\x20object-linker\x20core\x20binding'},{'object':'Coin','phase':'universal','relationship':'Reward<phantom\x20T>:\x20T\x20is\x20the\x20coin\x20type;\x20balance:\x20Balance<T>;\x20coin_add\x20expects\x20Coin<T>'}];
|
|
@@ -72,7 +72,7 @@ export interface RewardRiskCheckContext {
|
|
|
72
72
|
machine_has_wonder_node?: boolean;
|
|
73
73
|
}
|
|
74
74
|
export declare function rewardRiskFacts(ctx: RewardRiskCheckContext): Facts;
|
|
75
|
-
export declare const REWARD_RISK_VERSION = "1.
|
|
75
|
+
export declare const REWARD_RISK_VERSION = "1.2.0";
|
|
76
76
|
export declare function getAllRewardRiskRules(): RewardRiskRule[];
|
|
77
77
|
export interface RewardRiskAssessment {
|
|
78
78
|
summary: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getJudgmentDoc,factoryRulePack}from'../config/judgment.js';import{evaluateRuleBook}from'../config/rule-engine.js';import{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD}from'./onchain-constants.js';import{resolveGuardConstructor}from'./reward-ledger.js';const AUTO_FIXABLE=new Set(['R-R-1-03','R-R-2-03','R-R-4-04']),RELATED_MOVE_ERROR={'R-R-1-01':'E_GUARD_COUNT_EXCEEDED\x20(3)','R-R-1-02':'E_RECORD_COUNT_EXCEEDED\x20(8)','R-R-2-01':'E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','R-R-2-02':'E_AMOUNT_NOT_U64\x20(5)','R-R-2-03':'E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)','R-R-4-02':'E_INSUFFICIENT_BALANCE\x20(6)','R-R-4-03':'E_GUARD_LOCKED_TIME\x20(10)','R-R-4-04':'E_GUARD_LOCKED_TIME_INVALID\x20(11)','R-R-5-01':'E_GUARD_NOT_FOUND\x20(7)'},PRAISE_KEYWORDS=['praise','wonder','thumbs_up','positive\x20review','satisfaction\x20reward','praise\x20reward'],ONE_YEAR_MS=0x16d*0x18*0x3c*0x3c*0x3e8;export function rewardRiskFacts(a){const b=a['guard_add']??[],c=a['current_guard_count']??0x0,d=b['length']>0x0?c+b['length']:undefined;let e,f,h,j,k,l,m,n,o,p,q;const r=[],s={'GuardIdentifier':'GuardIdentifier','Entity':'Entity','Signer':'Signer'};for(let
|
|
1
|
+
import{getJudgmentDoc,factoryRulePack}from'../config/judgment.js';import{evaluateRuleBook}from'../config/rule-engine.js';import{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD}from'./onchain-constants.js';import{resolveGuardConstructor}from'./reward-ledger.js';const AUTO_FIXABLE=new Set(['R-R-1-03','R-R-2-03','R-R-4-04']),RELATED_MOVE_ERROR={'R-R-1-01':'E_GUARD_COUNT_EXCEEDED\x20(3)','R-R-1-02':'E_RECORD_COUNT_EXCEEDED\x20(8)','R-R-2-01':'E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','R-R-2-02':'E_AMOUNT_NOT_U64\x20(5)','R-R-2-03':'E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)','R-R-4-02':'E_INSUFFICIENT_BALANCE\x20(6)','R-R-4-03':'E_GUARD_LOCKED_TIME\x20(10)','R-R-4-04':'E_GUARD_LOCKED_TIME_INVALID\x20(11)','R-R-5-01':'E_GUARD_NOT_FOUND\x20(7)','R-R-8-01':'E_INSUFFICIENT_BALANCE\x20(6)'},PRAISE_KEYWORDS=['praise','wonder','thumbs_up','positive\x20review','satisfaction\x20reward','praise\x20reward'],COMPENSATION_KEYWORDS=['late\x20delivery','delay\x20compensation','late\x20compensation','lateness','compensation\x20pool','experience\x20compensation','goodwill','compensation\x20reward','体验补偿','迟到','延时赔付'],ONE_YEAR_MS=0x16d*0x18*0x3c*0x3c*0x3e8;export function rewardRiskFacts(a){const b=a['guard_add']??[],c=a['current_guard_count']??0x0,d=b['length']>0x0?c+b['length']:undefined;let e,f,h,j,k,l,m,n,o,p,q;const r=[],s={'GuardIdentifier':'GuardIdentifier','Entity':'Entity','Signer':'Signer'};for(let E=0x0;E<b['length'];E++){const F=b[E];if(!F||typeof F!=='object')continue;const G=F['recipient'],H=!!G&&typeof G==='object'&&!Array['isArray'](G);H&&'GuardIdentifier'in G&&r['push'](F['guard']);e===undefined&&H&&'GuardIdentifier'in G&&a['passport_identifier_is_address']&&a['passport_identifier_is_address'][G['GuardIdentifier']]===![]&&(e=E,f=G['GuardIdentifier']);const I=F['amount'],J=String(I?.['type'])['toUpperCase']();h===undefined&&(J==='GUARDU64IDENTIFIER'||J==='GUARD_U64_IDENTIFIER')&&typeof I?.['value']==='number'&&a['passport_submission_value_types']&&a['passport_submission_value_types'][I['value']]!=='u64'&&(h=E,j=I['value'],k=a['passport_submission_value_types'][I['value']]??'unknown');l===undefined&&F['store_from_id']!=null&&a['guard_store_from_id_compatible']&&a['guard_store_from_id_compatible'][F['guard']]===![]&&(l=E,m=F['guard'],n=F['store_from_id']);if(o===undefined&&H&&F['amount']!=null&&typeof F['amount']==='object'){const K=Object['keys'](G)[0x0],L=s[K],M=J==='FIXED'?'Fixed':'GuardU64Identifier';!resolveGuardConstructor(L,M)&&(o=E,p=String(L),q=String(M));}}let t=![];if(a['current_balance']!==undefined&&a['current_guard_count']!==undefined)try{t=BigInt(a['current_balance'])===0x0n;}catch{t=![];}const u=a['current_guard_not_added_expiration_time'],v=a['current_clock_ms'],w=a['target_guard_addresses']!=null?a['target_guard_addresses']['join'](','):'',x=(a['user_intent_phrases']??[])['join']('\x20')['toLowerCase'](),y=PRAISE_KEYWORDS['some'](N=>x['includes'](N['toLowerCase']())),z=COMPENSATION_KEYWORDS['some'](N=>x['includes'](N['toLowerCase']())),A=a['guard_expected_progress_state'],B=!!(a['coin_add']||a['receive']),C=b['some'](N=>{const O=N;if(!O||typeof O!=='object')return![];return String(O['amount']?.['type'])==='GuardU64Identifier';}),D=b['some'](N=>{const O=N;if(!O||typeof O!=='object')return![];const P=O['recipient'],Q=!!P&&typeof P==='object'&&'Signer'in P,R=String(O['amount']?.['type'])==='GuardU64Identifier';return Q&&R;});return{'claim':a['claim'],'guard_add_count':b['length'],'guard_current':c,'guard_total':d,'guard_count_would_exceed':b['length']>0x0&&c+b['length']>MAX_GUARD_COUNT_REWARD,'guard_batch_over_limit':b['length']>MAX_GUARD_COUNT_REWARD,'max_guard_count':MAX_GUARD_COUNT_REWARD,'record_count':a['current_record_count_for_recipient']??0x0,'record_count_at_limit':(a['current_record_count_for_recipient']??0x0)>=MAX_RECORD_COUNT_REWARD,'max_record_count':MAX_RECORD_COUNT_REWARD,...e===undefined?{}:{'first_non_address_identifier_index':e,'first_non_address_identifier_id':f},...h===undefined?{}:{'first_non_u64_amount_index':h,'first_non_u64_amount_id':j,'first_non_u64_amount_value_type':k},...l===undefined?{}:{'first_incompatible_store_from_id_index':l,'first_incompatible_store_from_id_guard':m,'first_incompatible_store_from_id_value':n},...o===undefined?{}:{'first_invalid_pairing_index':o,'first_invalid_pairing_recipient':p,'first_invalid_pairing_amount':q},'guard_identifier_recipients_display':r['join'](',\x20'),'owner_receive_set':a['owner_receive']!=null,...a['guard_expiration_time']===undefined?{}:{'new_lock_time':a['guard_expiration_time']},...v===undefined?{}:{'current_clock':v},'guard_lock_exceeds_year':a['guard_expiration_time']!=null&&v!==undefined&&a['guard_expiration_time']-v>ONE_YEAR_MS,'balance_is_zero':t,...u==null?{}:{'lock_until':u},'guard_add_blocked_by_lock':b['length']>0x0&&u!=null&&v!==undefined&&v<=u,'lock_time_in_past':a['guard_expiration_time']!=null&&v!==undefined&&a['guard_expiration_time']<=v,'known_guards_display':w,'claim_guard_not_in_targets':!!a['claim']&&a['target_guard_addresses']!=null&&!a['target_guard_addresses']['includes'](a['claim']),'reward_type':a['reward_type'],'coin_type':a['coin_add']?.['coin_type'],'coin_type_mismatch':!!a['coin_add']&&!!a['reward_type']&&a['coin_add']['coin_type']!==a['reward_type'],'payment_token_type':a['receive']?.['token_type'],'payment_token_mismatch':!!a['receive']&&!!a['reward_type']&&a['receive']['token_type']!==a['reward_type'],...a['user_intent_phrases']?.['length']?{'intent_display':x}:{},'expected_progress_state':A,'praise_intent_wrong_node':(a['user_intent_phrases']?.['length']??0x0)>0x0&&!!A&&y&&a['machine_has_wonder_node']!==![]&&A!=='wonder','wonder_node_without_praise_intent':(a['user_intent_phrases']?.['length']??0x0)>0x0&&A==='wonder'&&!y,'compensation_intent':z,'has_deposit':B,'has_identifier_amount':C,'recovery_gap_present':(B||b['length']>0x0)&&!D,'always_true':!![]};}function rewardRuleBook(){const a=getJudgmentDoc()['rules']['domains']['reward'];if(!a)throw new Error('factory\x20rule\x20pack\x20\x27reward\x27\x20missing\x20—\x20broken\x20installation');return a['rules'];}function findingToRewardRisk(a){const b=RELATED_MOVE_ERROR[a['rule_id']];return{'id':a['rule_id'],'level':a['level'],'category':a['dimension']??'semantic','title':a['title'],'description':a['description'],'affected_stakeholders':a['stakeholders']??[],'scenario':a['scenario']??'','mitigation':a['mitigation']??'','evidence':a['evidence'],...b===undefined?{}:{'related_move_error':b},'auto_fixable':AUTO_FIXABLE['has'](a['rule_id']),...a['exposure']!=null?{'exposure':a['exposure']}:{}};}export const REWARD_RISK_VERSION='1.2.0';export function getAllRewardRiskRules(){const a=factoryRulePack('reward');if(!a)return[];return a['rules']['map'](b=>({'id':b['rule_id'],'category':b['dimension']??'semantic','trigger':b['trigger']??'','check':c=>{const d=rewardRuleBook()['find'](f=>f['rule_id']===b['rule_id']);if(!d)return null;const {findings:e}=evaluateRuleBook([d],rewardRiskFacts(c));return e['length']>0x0?findingToRewardRisk(e[0x0]):null;}}));}export function assessRewardRisks(a){const {findings:b}=evaluateRuleBook(rewardRuleBook(),rewardRiskFacts(a)),c=b['map'](findingToRewardRisk),d=c['length']===0x0?'low':c['some'](g=>g['level']==='critical')?'critical':c['some'](g=>g['level']==='high')?'high':c['some'](g=>g['level']==='medium')?'medium':'low',e={};for(const g of c){e[g['category']]=(e[g['category']]??0x0)+0x1;}const f={};for(const h of c){for(const i of h['affected_stakeholders']){if(!f[i])f[i]=[];f[i]['push'](h['id']+':\x20'+h['mitigation']);}}return{'summary':'Assessed\x20'+c['length']+'\x20risk(s)\x20across\x20'+Object['keys'](e)['length']+'\x20categories','risks':c,'overall_risk':d,'risks_by_category':e,'stakeholder_advice':f,'needs_human_review':c['some'](j=>j['level']==='critical'||j['level']==='high')};}
|
|
@@ -68,8 +68,10 @@ export declare const SERVICE_LISTING_REFUND_GATES: {
|
|
|
68
68
|
};
|
|
69
69
|
export declare const SERVICE_ORDER_FLOW_STAGES: ServiceOrderFlowStage[];
|
|
70
70
|
export declare const SERVICE_CROSS_OBJECT_BINDINGS: ServiceCrossObjectBinding[];
|
|
71
|
+
export declare const SERVICE_REWARDS_BUYER_DD: string;
|
|
72
|
+
export declare const SUBSERVICE_ACCOUNT_ALIGNMENT: string;
|
|
71
73
|
export declare const SERVICE_SCENES: ServiceScene[];
|
|
72
|
-
export declare const SERVICE_LEDGER_VERSION = "1.
|
|
74
|
+
export declare const SERVICE_LEDGER_VERSION = "1.1.0";
|
|
73
75
|
export declare function getScenesByCategory(category: ServiceScene["category"]): ServiceScene[];
|
|
74
76
|
export declare function findSceneById(id: string): ServiceScene | undefined;
|
|
75
77
|
export declare function getServicePermissionByIndex(index: number): ServicePermissionEntry | undefined;
|