@wowok/agent-mcp 3.1.7 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/exposure.d.ts +2 -2
- package/dist/config/judgment.d.ts +5 -5
- package/dist/config/rule-engine.d.ts +5 -5
- package/dist/customer/user-preferences.d.ts +2 -2
- package/dist/evaluation/arbitration-game.js +1 -1
- package/dist/evaluation/capability.d.ts +1 -1
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/extensions/industry-pack.d.ts +3 -2
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/extensions/registry.js +1 -1
- package/dist/extensions/types.d.ts +1 -0
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/edge-schema.js +1 -1
- package/dist/graph/onchain/extract.js +1 -1
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/field-manifest.js +1 -1
- package/dist/graph/onchain/project-relationship.js +1 -1
- package/dist/graph/onchain/sdk-batch.d.ts +1 -0
- package/dist/graph/onchain/sdk-batch.js +1 -1
- package/dist/graph/onchain/sdk-dataplane.d.ts +1 -0
- package/dist/graph/onchain/sdk-dataplane.js +1 -1
- package/dist/graph/onchain/types.d.ts +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/keeper/KeeperScan.d.ts +2 -1
- package/dist/keeper/KeeperScan.js +1 -1
- package/dist/keeper/detectors.d.ts +9 -0
- package/dist/keeper/detectors.js +1 -1
- package/dist/keeper/keeper.spec.js +1 -1
- package/dist/keeper/types.d.ts +1 -1
- package/dist/keeper/types.js +1 -1
- package/dist/knowledge/allocation-ledger.d.ts +4 -1
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocation-puzzle.d.ts +2 -0
- package/dist/knowledge/allocation-puzzle.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +1 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocation-templates.d.ts +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/arb-risk.d.ts +3 -1
- package/dist/knowledge/arb-risk.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-risk.js +1 -1
- package/dist/knowledge/arbitration-templates.d.ts +1 -0
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +13 -2
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/allocation.json +50 -1
- package/dist/knowledge/baselines/rules/arb.json +20 -1
- package/dist/knowledge/baselines/rules/arbitration.json +27 -0
- package/dist/knowledge/baselines/rules/guard.json +75 -2
- package/dist/knowledge/baselines/rules/machine.json +38 -13
- package/dist/knowledge/baselines/rules/order.json +2 -2
- package/dist/knowledge/builtin-templates.d.ts +3 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/discount-threshold.d.ts +15 -0
- package/dist/knowledge/discount-threshold.js +1 -0
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-anchor-reach.d.ts +19 -0
- package/dist/knowledge/guard-anchor-reach.js +1 -0
- package/dist/knowledge/guard-bindings.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-ledger.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-render.d.ts +6 -0
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-submission-prompt.d.ts +6 -0
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +6 -6
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.d.ts +38 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.d.ts +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-risk.js +1 -1
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/onchain-constants.d.ts +2 -2
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/order-templates.js +1 -1
- package/dist/knowledge/permission-ledger.js +1 -1
- package/dist/knowledge/release-sentinel.d.ts +12 -0
- package/dist/knowledge/release-sentinel.js +1 -0
- package/dist/knowledge/repository-write-semantics.d.ts +27 -0
- package/dist/knowledge/repository-write-semantics.js +1 -0
- package/dist/knowledge/rule-node-analyzers.d.ts +6 -0
- package/dist/knowledge/rule-node-analyzers.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +5 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +20 -1
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/service-allocation-semantics.d.ts +36 -0
- package/dist/knowledge/service-allocation-semantics.js +1 -0
- package/dist/knowledge/strategy-manuals.d.ts +4 -6
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +48 -12
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +26 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/allocation-advice.d.ts +38 -0
- package/dist/participation/allocation-advice.js +1 -0
- package/dist/participation/arbitrator-interest.js +1 -1
- package/dist/participation/customer-interest.js +1 -1
- package/dist/participation/merchant-interest.js +1 -1
- package/dist/participation/radar-core.d.ts +2 -0
- package/dist/persona/types.d.ts +3 -2
- package/dist/persona/types.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/intent-analyzer.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +70 -63
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.d.ts +17 -1
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- 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/reverse-mapping-refund-p0-5.spec.js +1 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/semantic-graph.d.ts +1 -0
- package/dist/playbooks/service-build/semantic-graph.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.d.ts +2 -0
- package/dist/playbooks/service-build/service-quote.js +1 -0
- package/dist/relationship/derivation.d.ts +1 -1
- package/dist/review/index.js +1 -1
- package/dist/role/profiles.js +1 -1
- package/dist/role/types.d.ts +2 -0
- package/dist/role/types.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +30 -8
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +10 -7
- package/dist/schema/call/arbitration.d.ts +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +5 -5
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +5 -9
- package/dist/schema/call/bridge.js +1 -1
- package/dist/schema/call/contact.d.ts +1 -1
- package/dist/schema/call/demand.d.ts +1 -1
- package/dist/schema/call/guard.d.ts +15 -15
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +58 -2
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.d.ts +1 -1
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.d.ts +1 -1
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/permission.d.ts +1 -1
- package/dist/schema/call/personal.d.ts +1 -1
- package/dist/schema/call/progress.d.ts +1 -1
- package/dist/schema/call/proof.d.ts +2 -2
- package/dist/schema/call/repository.d.ts +1 -1
- package/dist/schema/call/reward.d.ts +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +87 -25
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/common/tokentype-short-probe.spec.js +1 -0
- package/dist/schema/evaluation/index.d.ts +14 -82
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +8 -41
- package/dist/schema/goal/planning.d.ts +22 -57
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +15 -0
- package/dist/schema/industry-pack/modes.d.ts +15 -0
- package/dist/schema/industry-pack/modes.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +5 -20
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/interaction/index.d.ts +1 -1
- package/dist/schema/keeper/index.d.ts +3 -0
- package/dist/schema/keeper/index.js +1 -1
- package/dist/schema/local/index.d.ts +577 -18
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +140 -20
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +97 -35
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +811 -916
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +161 -8
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +49 -30
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +2 -2
- package/dist/schema/workflow/index.d.ts +2 -2
- 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 +8 -4
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/benchmark_migration_operation.output.json +116 -2
- package/dist/schemas/benchmark_migration_operation.schema.json +2 -10
- package/dist/schemas/bridge_operation.output.json +2 -2
- package/dist/schemas/bridge_operation.schema.json +2 -10
- package/dist/schemas/evaluation_operation.output.json +2 -0
- package/dist/schemas/evaluation_operation.schema.json +9 -70
- package/dist/schemas/goal_operation.schema.json +6 -39
- package/dist/schemas/index.json +7 -1
- package/dist/schemas/industry_pack_operation.output.json +87 -4
- package/dist/schemas/intent_radar.output.json +6 -20
- package/dist/schemas/intent_radar.schema.json +1 -0
- package/dist/schemas/keeper_operation.output.json +2 -2
- package/dist/schemas/keeper_operation.schema.json +9 -4
- package/dist/schemas/local_cache_operation.output.json +1536 -0
- package/dist/schemas/local_cache_operation.schema.json +101 -0
- package/dist/schemas/local_history_operation.output.json +2 -2
- package/dist/schemas/local_info_operation.output.json +2 -2
- package/dist/schemas/local_mark_operation.output.json +53 -38
- package/dist/schemas/local_mark_operation.schema.json +1 -0
- package/dist/schemas/messenger_operation.output.json +2 -2
- package/dist/schemas/messenger_operation.schema.json +358 -35
- package/dist/schemas/monitor_events.output.json +2 -2
- package/dist/schemas/monitor_subscription.output.json +2 -2
- package/dist/schemas/onchain_events.output.json +2 -2
- package/dist/schemas/onchain_operations.output.json +6 -6
- package/dist/schemas/onchain_operations.schema.json +237 -64
- package/dist/schemas/onchain_operations_allocation.schema.json +12 -11
- package/dist/schemas/onchain_operations_arbitration.schema.json +16 -16
- package/dist/schemas/onchain_operations_machine.schema.json +27 -5
- package/dist/schemas/onchain_operations_order.schema.json +1 -1
- package/dist/schemas/onchain_operations_payment.schema.json +3 -3
- package/dist/schemas/onchain_operations_reward.schema.json +2 -2
- package/dist/schemas/onchain_operations_service.schema.json +174 -24
- package/dist/schemas/onchain_operations_treasury.schema.json +2 -2
- package/dist/schemas/onchain_table_data.output.json +68 -4
- package/dist/schemas/persona_operation.output.json +11 -88
- package/dist/schemas/persona_operation.schema.json +4 -32
- package/dist/schemas/query_toolkit.output.json +331 -26
- package/dist/schemas/query_toolkit.schema.json +66 -2
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/dispatch-expectations.spec.js +1 -1
- package/dist/tools/handlers/keeper.d.ts +1 -1
- package/dist/tools/handlers/local.d.ts +1 -0
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/messenger.d.ts +9 -2
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/name-resolution.d.ts +4 -0
- package/dist/tools/handlers/name-resolution.js +1 -0
- package/dist/tools/handlers/name-resolution.spec.js +1 -0
- package/dist/tools/handlers/onchain-name-registration.d.ts +37 -0
- package/dist/tools/handlers/onchain-name-registration.js +1 -0
- package/dist/tools/handlers/onchain-name-registration.spec.js +1 -0
- package/dist/tools/handlers/onchain.d.ts +1 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.d.ts +1 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/sanitize-description-roundtrip.spec.js +1 -0
- package/dist/tools/sanitize-output.d.ts +1 -0
- package/dist/tools/sanitize-output.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
- package/dist/knowledge/alloc-audit-policy.spec.js +0 -1
- package/dist/knowledge/event-semantics.spec.js +0 -1
- package/dist/knowledge/facts-sync.spec.js +0 -1
- package/dist/knowledge/guard-design-patterns.spec.js +0 -1
- package/dist/knowledge/guard-eval.spec.js +0 -1
- package/dist/knowledge/rule-node-analyzers.spec.d.ts +0 -1
- package/dist/knowledge/rule-node-analyzers.spec.js +0 -1
- package/dist/knowledge/safety-rules.extract-amount.spec.d.ts +0 -1
- package/dist/knowledge/safety-rules.extract-amount.spec.js +0 -1
- package/dist/knowledge/template-loader.spec.d.ts +0 -1
- package/dist/knowledge/template-loader.spec.js +0 -1
- package/dist/knowledge/template-scanner.spec.d.ts +0 -1
- package/dist/knowledge/template-scanner.spec.js +0 -1
- /package/dist/{knowledge/alloc-audit-policy.spec.d.ts → playbooks/service-build/reverse-mapping-refund-p0-5.spec.d.ts} +0 -0
- /package/dist/{knowledge/event-semantics.spec.d.ts → schema/common/tokentype-short-probe.spec.d.ts} +0 -0
- /package/dist/{knowledge/facts-sync.spec.d.ts → tools/handlers/name-resolution.spec.d.ts} +0 -0
- /package/dist/{knowledge/guard-design-patterns.spec.d.ts → tools/handlers/onchain-name-registration.spec.d.ts} +0 -0
- /package/dist/{knowledge/guard-eval.spec.d.ts → tools/sanitize-description-roundtrip.spec.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RETENTION_RANK,pathConfidence,findingWhere}from'./analyze.js';import{orderCompletionInGraph}from'./expand.js';import{profileOf}from'./viewport.js';const STATE_RANK={'present':0x0,'empty':0x1,'gap':0x2};function worstState(c,d){return STATE_RANK[c]>=STATE_RANK[d]?c:d;}export const COVERAGE_VOCABULARY={'present':'present\x20—\x20evidence\x20retrieved\x20and\x20non-empty;\x20real\x20material\x20the\x20rules\x20can\x20score.','empty':'empty\x20—\x20the\x20read\x20completed\x20and\x20verified\x20the\x20absence\x20of\x20data\x20(e.g.\x20no\x20review\x20votes);\x20an\x20answered\x20fact\x20the\x20rules\x20may\x20score,\x20never\x20a\x20fetch\x20failure.','gap':'gap\x20—\x20the\x20evidence\x20was\x20not\x20retrieved,\x20errored,\x20or\x20was\x20truncated;\x20it\x20is\x20unverifiable,\x20so\x20it\x20is\x20excluded\x20from\x20scoring\x20and\x20listed\x20in\x20unverified,\x20never\x20defaulted\x20to\x20a\x20low\x20score.','unverified':'unverified\x20—\x20rule\x20ids\x20excluded\x20from\x20the\x20score\x20because\x20their\x20evidence\x20is\x20gap-state;\x20missing\x20here\x20means\x20every\x20rule\x20was\x20scored\x20on\x20fetched\x20facts.','completeness':'completeness\x20—\x20percentage\x20of\x20required\x20evidence\x20slots\x20that\x20carry\x20material\x20(present);\x20verified-empty\x20slots\x20lower\x20it\x20but\x20stay\x20fully\x20scoreable.'};const REQUIRED_SLOTS=[{'slot':'service_snapshot','label':'Service\x20snapshot','gloss':'The\x20service\x27s\x20own\x20on-chain\x20record\x20(publish/pause\x20status,\x20price,\x20fund\x20and\x20bindings),\x20fetched\x20directly\x20from\x20chain.'},{'slot':'arbitration','label':'Arbitration\x20binding','gloss':'Dispute-resolution\x20services\x20bound\x20to\x20this\x20shop\x20—\x20whether\x20one\x20exists,\x20carries\x20a\x20voter\x20roster,\x20has\x20a\x20funded\x20fee,\x20and\x20is\x20not\x20paused.'},{'slot':'reviews','label':'Review\x20votes','gloss':'On-chain\x20like/dislike\x20votes\x20left\x20by\x20completed-order\x20counterparties;\x20an\x20empty\x20window\x20means\x20nobody\x20voted\x20yet,\x20not\x20a\x20bad\x20rating.'},{'slot':'fulfillment_orders','label':'Recent\x20orders','gloss':'Orders\x20in\x20the\x20shop\x27s\x20recent\x20order\x20window\x20with\x20completion\x20and\x20refund\x20outcomes,\x20used\x20to\x20measure\x20real\x20fulfillment.'},{'slot':'fulfillment_workflow','label':'Fulfillment\x20workflow','gloss':'The\x20bound\x20machine\x27s\x20nodes\x20and\x20forwards\x20that\x20every\x20paid\x20order\x20must\x20progress\x20through\x20to\x20reach\x20completion\x20or\x20refund.'},{'slot':'fund_safety','label':'Compensation\x20fund\x20vs\x20exposure','gloss':'The\x20merchant\x27s\x20compensation\x20fund\x20balance\x20measured\x20against\x20recent\x20order\x20volume\x20(the\x20safety\x20buffer\x20for\x20payouts).'},{'slot':'transparency','label':'Transparency\x20profile','gloss':'The\x20shop\x27s\x20public\x20on-chain\x20profile\x20—\x20description\x20and\x20publish/pause\x20flags\x20a\x20buyer\x20can\x20verify\x20before\x20paying.'}],SLOT_FACTS={'service_snapshot':[],'arbitration':['arbitration.binding'],'reviews':['reviews.votes'],'fulfillment_orders':['fulfillment.orders'],'fulfillment_workflow':['fulfillment.workflow'],'fund_safety':['fund.compensation','fund.exposure'],'transparency':['transparency.profile']},RISK_RULE_SOURCES={'risk_workflow':{'slots':['fulfillment_workflow'],'ruleIds':['R4']},'risk_fund':{'slots':['fund_safety','fulfillment_orders'],'ruleIds':['R2','R7','AC3','AC4']},'risk_trust':{'slots':['arbitration','transparency'],'ruleIds':['R1','R3','R6']},'risk_behavior':{'slots':['fulfillment_orders'],'ruleIds':['AC1','AC2']}};function nodeData(a,b){const c=a['graph']['nodes']['get'](b['toLowerCase']()),e=c?.['raw'],f=e?.['data']??e;return f&&typeof f==='object'?f:undefined;}function isFetched(a,b){const c=a['graph']['nodes']['get'](b['toLowerCase']());return!!c&&a['visibleNodes']['has'](c['id'])&&!!c['raw']&&c['state']!=='error'&&c['state']!=='stub';}function truncationOf(a,b,c){const d=a['graph']['truncations']['find'](e=>e['nodeId']===b&&e['schema']===c);return d?{'observed':d['observed'],'limit':d['limit']}:undefined;}function outEdges(a,b,c){return a['visibleEdges']['filter'](d=>d['from']===b['toLowerCase']()&&d['schema']===c);}function incEdges(a,b,c){return a['visibleEdges']['filter'](d=>d['to']===b['toLowerCase']()&&d['schema']===c);}function toBigInt(a){if(a==null)return 0x0n;try{return BigInt(typeof a==='number'?Math['trunc'](a):String(a));}catch{return 0x0n;}}function flag(a){return a===!![]||a===0x1||a==='1';}function snapProvenance(a){return{'path':a,'retention':'complete','confidence':'exact'};}function edgeProvenance(a,b,c){const {confidence:d,window:e}=pathConfidence(a,c),f=c['reduce']((g,h)=>RETENTION_RANK[h['retention']]>RETENTION_RANK[g]?h['retention']:g,'complete');return{'path':b,'retention':f,'confidence':d,...e?{'window':e}:{}};}export function projectEvaluationFacts(a,b,c){const f=b['toLowerCase'](),g=[],h=new Map(),i=new Map(),j=(U,V,W='exact')=>{h['set'](U,V),i['set'](U,W);},k=a['graph']['nodes']['get'](f),l=a['visibleNodes']['has'](f),m=!!(l&&k&&k['raw']&&k['state']!=='error'&&k['state']!=='stub'&&k['objectType']==='Service'),o=m?nodeData(a,f)??{}:{},q=k?.['coinType'];j('service_snapshot',m?'present':'gap');const r=Array['isArray'](o['arbitrations'])?o['arbitrations']['map'](String)['filter'](Boolean):[],u=outEdges(a,f,'service.arbitration'),w=[];let x=!![];for(const U of r){if(!isFetched(a,U)){x=![];continue;}const V=nodeData(a,U)??{},W=Array['isArray'](V['voting_guard'])?V['voting_guard']:[];w['push']({'id':U['toLowerCase'](),'paused':flag(V['bPaused']),'fee':toBigInt(V['fee'])['toString'](),'votingGuards':W['length'],'usageGuard':typeof V['usage_guard']==='string'&&V['usage_guard']!==''});}if(!m)j('arbitration','gap'),g['push']({'dimension':'arbitration','key':'arbitration.binding','state':'gap','provenance':snapProvenance([f]),'evidence':'Arbitration\x20configuration\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});else{if(r['length']===0x0)j('arbitration','empty'),g['push']({'dimension':'arbitration','key':'arbitration.binding','state':'empty','value':[],'provenance':snapProvenance([f,'Service.arbitrations']),'evidence':'Service\x20snapshot\x20shows\x20no\x20arbitration\x20service\x20configured\x20(verified\x20absence).'});else!x?(j('arbitration','gap'),g['push']({'dimension':'arbitration','key':'arbitration.binding','state':'gap','value':w,'provenance':u['length']>0x0?edgeProvenance(a,[f,'service.arbitration'],u):snapProvenance([f,'Service.arbitrations']),'evidence':w['length']+'/'+r['length']+'\x20arbitration\x20service(s)\x20resolved;\x20the\x20rest\x20failed\x20to\x20fetch.'})):(j('arbitration','present',u['length']>0x0?edgeProvenance(a,[f,'service.arbitration'],u)['confidence']:'exact'),g['push']({'dimension':'arbitration','key':'arbitration.binding','state':'present','value':w,'provenance':u['length']>0x0?edgeProvenance(a,[f,'service.arbitration'],u):snapProvenance([f,'Service.arbitrations']),'evidence':w['length']+'\x20arbitration\x20service(s)\x20resolved\x20from\x20the\x20snapshot\x20with\x20voting\x20rosters.'}));}const y=outEdges(a,f,'target.vote'),z=truncationOf(a,f,'target.vote'),A={'total':y['length'],'like':0x0,'dislike':0x0,'favor':0x0};for(const X of y){const Y=typeof X['payload']?.['voteBits']==='number'?X['payload']['voteBits']:0x0;if(Y&0x2)A['like']+=0x1;if(Y&0x4)A['dislike']+=0x1;if(Y&0x8)A['favor']+=0x1;}const B=y['length']>0x0?edgeProvenance(a,[f,'target.vote'],y):snapProvenance([f,'registrar.votes']);if(!m)j('reviews','gap'),g['push']({'dimension':'reviews','key':'reviews.votes','state':'gap','provenance':snapProvenance([f]),'evidence':'Reputation\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});else{if(z)j('reviews','gap',B['confidence']),g['push']({'dimension':'reviews','key':'reviews.votes','state':'gap','value':A,'provenance':{...B,'window':z},'evidence':'Vote\x20window\x20truncated\x20at\x20'+z['limit']+';\x20'+A['total']+'\x20vote(s)\x20visible\x20—\x20counts\x20are\x20a\x20floor.'});else A['total']===0x0?(j('reviews','empty'),g['push']({'dimension':'reviews','key':'reviews.votes','state':'empty','value':A,'provenance':B,'evidence':'No\x20registrar\x20votes\x20recorded\x20for\x20the\x20service\x20(window\x20read\x20empty,\x20no\x20truncation).'})):(j('reviews','present',B['confidence']),g['push']({'dimension':'reviews','key':'reviews.votes','state':'present','value':A,'provenance':B,'evidence':A['total']+'\x20registrar\x20vote(s):\x20'+A['like']+'\x20like,\x20'+A['dislike']+'\x20dislike,\x20'+A['favor']+'\x20favor.'}));}const C=outEdges(a,f,'service.order'),D=truncationOf(a,f,'service.order'),E={'observed':C['length'],'completed':0x0,'inProgress':0x0,'unknown':0x0,'windowedAmount':'0'};let F=0x0n;for(const Z of C){const a0=orderCompletionInGraph(a['graph'],Z['to'])['status'];if(a0==='completed')E['completed']+=0x1;else{if(a0==='in_progress')E['inProgress']+=0x1;else E['unknown']+=0x1;}F+=toBigInt(nodeData(a,Z['to'])?.['amount']);}E['windowedAmount']=F['toString']();const G=C['length']>0x0?edgeProvenance(a,[f,'service.order','Order'],C):snapProvenance([f,'service.order']);let H;if(!m)H='gap';else{if(D)H='gap';else H=C['length']===0x0?'empty':'present';}j('fulfillment_orders',H,G['confidence']);if(H==='gap'&&m)g['push']({'dimension':'fulfillment','key':'fulfillment.orders','state':'gap','value':E,'provenance':{...G,'window':D},'evidence':'Order\x20window\x20truncated\x20at\x20'+D?.['limit']+'\x20(observed\x20'+D?.['observed']+');\x20'+E['observed']+'\x20order(s)\x20visible\x20—\x20completion\x20stats\x20are\x20a\x20partial\x20floor.'});else{if(H==='empty')g['push']({'dimension':'fulfillment','key':'fulfillment.orders','state':'empty','value':E,'provenance':G,'evidence':'No\x20orders\x20in\x20the\x20service\x20window\x20(verified\x20absence).'});else H==='present'?g['push']({'dimension':'fulfillment','key':'fulfillment.orders','state':'present','value':E,'provenance':G,'evidence':E['observed']+'\x20recent\x20order(s):\x20'+E['completed']+'\x20completed,\x20'+E['inProgress']+'\x20in\x20progress,\x20'+E['unknown']+'\x20unresolved.'}):g['push']({'dimension':'fulfillment','key':'fulfillment.orders','state':'gap','provenance':snapProvenance([f]),'evidence':'Order\x20window\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});}const I=typeof o['machine']==='string'?o['machine']:'',J=I!==''&&isFetched(a,I),K=I===''?'':I['toLowerCase']()+'::node::',L=K===''?[]:a['graph']['edges']['filter'](a1=>a1['schema']==='wf.transition'&&a1['from']['startsWith'](K)),M=new Set();for(const a1 of L){M['add'](a1['from']);const a2=String(a1['payload']?.['node']??'');if(a2!=='')M['add'](''+K+a2);}let N,O;if(!m)N='gap',O='Workflow\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.';else{if(I==='')N='empty',O='No\x20workflow\x20template\x20configured\x20(verified\x20absence).';else{if(!J)N='gap',O='Machine\x20template\x20referenced\x20but\x20not\x20fetched\x20(fetch\x20gap).';else L['length']===0x0?(N='gap',O='Machine\x20fetched\x20but\x20no\x20wf.transition\x20edges\x20—\x20terminal\x20set\x20unverifiable;\x20completion\x20states\x20stay\x20unknown.'):(N='present',O='Machine\x20template\x20resolved\x20with\x20'+M['size']+'\x20workflow\x20node(s);\x20terminal\x20set\x20verifiable.');}}j('fulfillment_workflow',N,N==='present'?'exact':N==='empty'?'exact':'windowed'),g['push']({'dimension':'fulfillment','key':'fulfillment.workflow','state':N,...I!==''&&J?{'value':{'machine':I['toLowerCase'](),'nodes':M['size']}}:{},'provenance':N==='present'?edgeProvenance(a,[f,'service.machine','wf.transition'],L):snapProvenance([f,'Service.machine']),'evidence':O});const P=toBigInt(o['compensation_fund']);if(!m)j('fund_safety','gap'),g['push']({'dimension':'fund_safety','key':'fund.compensation','state':'gap','provenance':snapProvenance([f]),'evidence':'Fund\x20backing\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'}),g['push']({'dimension':'fund_safety','key':'fund.exposure','state':'gap','provenance':snapProvenance([f]),'evidence':'Payout\x20exposure\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});else{j('fund_safety','present'),g['push']({'dimension':'fund_safety','key':'fund.compensation','state':'present','value':{'fund':P['toString'](),...q?{'coinType':q}:{}},'provenance':snapProvenance([f,'Service.compensation_fund']),'evidence':'Compensation\x20fund\x20'+P['toString']()+'\x20base\x20units'+(q?'\x20in\x20'+q:'')+'.'});const a3=F*0x3n,a4=worstState('present',H),a5=c['find'](a6=>a6['id']==='R2:'+f);g['push']({'dimension':'fund_safety','key':'fund.exposure','state':a4,'value':{'fund':P['toString'](),'windowedCount':E['observed'],'windowedAmount':F['toString'](),'neededCeiling':a3['toString'](),'coverageMet':P>=a3},'provenance':C['length']>0x0?edgeProvenance(a,[f,'service.order','Order.amount','Service.compensation_fund'],C):snapProvenance([f,'Service.compensation_fund']),'findingIds':a5?[a5['id']]:undefined,'evidence':H==='empty'?'No\x20recent\x20orders;\x20no\x20payout\x20exposure\x20to\x20cover.':'Recent\x20orders\x20total\x20'+F['toString']()+'\x20base\x20units'+(q?'\x20in\x20'+q:'')+'\x20across\x20'+E['observed']+'\x20order(s);\x20the\x20compensation\x20fund\x20should\x20cover\x20at\x20least\x203x\x20that\x20('+a3['toString']()+'\x20base\x20units'+(q?'\x20in\x20'+q:'')+')\x20—\x20coverage\x20'+(P>=a3?'met':'not\x20met')+(D?'\x20(older\x20orders\x20outside\x20the\x20fetch\x20window,\x20floor\x20value\x20only)':'')+'.'});}if(!m)j('transparency','gap'),g['push']({'dimension':'transparency','key':'transparency.profile','state':'gap','provenance':snapProvenance([f]),'evidence':'Transparency\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});else{const a6=typeof o['setting_lock_duration']==='number'?o['setting_lock_duration']:Number(toBigInt(o['setting_lock_duration'])),a7=flag(o['bPublished']);j('transparency','present'),g['push']({'dimension':'transparency','key':'transparency.profile','state':'present','value':{'description':typeof o['description']==='string'?o['description']:'','location':typeof o['location']==='string'?o['location']:'','settingLockDuration':Number['isFinite'](a6)?a6:0x0,'published':a7,'paused':flag(o['bPaused'])},'provenance':snapProvenance([f,'Service.bPublished','Service.setting_lock_duration']),'findingIds':c['some'](a8=>a8['id']==='R6:'+f)?['R6:'+f]:undefined,'evidence':'Service\x20profile:\x20description\x20'+(typeof o['description']==='string'&&o['description']!==''?'provided':'not\x20provided')+',\x20location\x20'+(typeof o['location']==='string'&&o['location']!==''?'provided':'not\x20provided')+',\x20service\x20lock\x20'+a6+'\x20ms,\x20'+(a7?'published':'unpublished')+'.'});}for(const a8 of['risk_workflow','risk_fund','risk_trust','risk_behavior']){const a9=RISK_RULE_SOURCES[a8];let aa='present',ab,ac=-0x1;for(const ag of a9['slots']){const ah=h['get'](ag)??'gap';STATE_RANK[ah]>ac&&(ac=STATE_RANK[ah],aa=ah,ab=ag);}let ae;if(aa==='gap')ae='windowed';else{if(aa==='empty')ae='bounded';else ae=ab&&i['get'](ab)||'exact';}const af=c['filter'](ai=>a9['ruleIds']['some'](aj=>ai['id']['startsWith'](aj+':')));g['push']({'dimension':a8,'key':a8+'.findings','state':aa,'value':{'findings':af['map'](ai=>({'id':ai['id'],'severity':ai['severity'],'title':ai['title']})),'where':af['map'](ai=>findingWhere(ai))},'provenance':{'path':[f,...a9['slots']],'retention':'derived','confidence':ae},'findingIds':af['map'](ai=>ai['id']),'evidence':aa==='gap'?'Input\x20evidence\x20has\x20fetch\x20gaps;\x20the\x20risk\x20conclusion\x20is\x20unverifiable.':aa==='empty'?'Input\x20evidence\x20is\x20configured-empty;\x20the\x20risk\x20rules\x20are\x20not\x20applicable.':af['length']>0x0?af['length']+'\x20structural\x20risk\x20finding(s)\x20reused\x20from\x20the\x20analyzer\x20registry.':'No\x20risk\x20fired;\x20input\x20evidence\x20slots\x20are\x20fully\x20materialized.'});}const Q=[];for(const ai of a['visibleNodes']){const aj=profileOf(a,ai);if(!aj)continue;const ak=Array['isArray'](aj['profileRecords'])?aj['profileRecords']:undefined;Q['push']({'nodeId':ai,...typeof aj['registeredAt']==='number'?{'registeredAt':aj['registeredAt']}:{},'hasDescription':!!aj['hasDescription']||typeof aj['description']==='string','recordCount':typeof aj['recordCount']==='number'?aj['recordCount']:ak?.['length']??0x0,...typeof aj['description']==='string'?{'description':aj['description']}:{},...ak?{'profileRecords':ak}:{}});}const R=REQUIRED_SLOTS['length'],S=REQUIRED_SLOTS['filter'](({slot:al})=>h['get'](al)==='present')['length'],T=R===0x0?0x64:Math['round'](S/R*0x64);return{'target':f,'role':String(a['role']),'facts':g,'slots':REQUIRED_SLOTS['map'](({slot:al,label:am,gloss:an})=>({'slot':al,'label':am,'gloss':an,'required':!![],'state':h['get'](al)??'gap','facts':[...SLOT_FACTS[al]??[]]})),'completeness':T,'profiles':Q};}
|
|
1
|
+
import{RETENTION_RANK,pathConfidence,findingWhere}from'./analyze.js';import{orderCompletionInGraph}from'./expand.js';import{profileOf}from'./viewport.js';const STATE_RANK={'present':0x0,'empty':0x1,'gap':0x2};function worstState(c,d){return STATE_RANK[c]>=STATE_RANK[d]?c:d;}export const COVERAGE_VOCABULARY={'present':'present\x20—\x20evidence\x20retrieved\x20and\x20non-empty;\x20real\x20material\x20the\x20rules\x20can\x20score.','empty':'empty\x20—\x20the\x20read\x20completed\x20and\x20verified\x20the\x20absence\x20of\x20data\x20(e.g.\x20no\x20review\x20votes);\x20an\x20answered\x20fact\x20the\x20rules\x20may\x20score,\x20never\x20a\x20fetch\x20failure.','gap':'gap\x20—\x20the\x20evidence\x20was\x20not\x20retrieved,\x20errored,\x20or\x20was\x20truncated;\x20it\x20is\x20unverifiable,\x20so\x20it\x20is\x20excluded\x20from\x20scoring\x20and\x20listed\x20in\x20unverified,\x20never\x20defaulted\x20to\x20a\x20low\x20score.','unverified':'unverified\x20—\x20rule\x20ids\x20excluded\x20from\x20the\x20score\x20because\x20their\x20evidence\x20is\x20gap-state;\x20missing\x20here\x20means\x20every\x20rule\x20was\x20scored\x20on\x20fetched\x20facts.','completeness':'completeness\x20—\x20percentage\x20of\x20required\x20evidence\x20slots\x20that\x20carry\x20material\x20(present);\x20verified-empty\x20slots\x20lower\x20it\x20but\x20stay\x20fully\x20scoreable.'};const REQUIRED_SLOTS=[{'slot':'service_snapshot','label':'Service\x20snapshot','gloss':'The\x20service\x27s\x20own\x20on-chain\x20record\x20(publish/pause\x20status,\x20price,\x20fund\x20and\x20bindings),\x20fetched\x20directly\x20from\x20chain.'},{'slot':'arbitration','label':'Arbitration\x20binding','gloss':'Dispute-resolution\x20services\x20bound\x20to\x20this\x20shop\x20—\x20whether\x20one\x20exists,\x20carries\x20a\x20voter\x20roster,\x20has\x20a\x20funded\x20fee,\x20and\x20is\x20not\x20paused.'},{'slot':'reviews','label':'Review\x20votes','gloss':'On-chain\x20like/dislike\x20votes\x20left\x20by\x20completed-order\x20counterparties;\x20an\x20empty\x20window\x20means\x20nobody\x20voted\x20yet,\x20not\x20a\x20bad\x20rating.'},{'slot':'fulfillment_orders','label':'Recent\x20orders','gloss':'Orders\x20in\x20the\x20shop\x27s\x20recent\x20order\x20window\x20with\x20completion\x20and\x20refund\x20outcomes,\x20used\x20to\x20measure\x20real\x20fulfillment.'},{'slot':'fulfillment_workflow','label':'Fulfillment\x20workflow','gloss':'The\x20bound\x20machine\x27s\x20nodes\x20and\x20forwards\x20that\x20every\x20paid\x20order\x20must\x20progress\x20through\x20to\x20reach\x20completion\x20or\x20refund.'},{'slot':'fund_safety','label':'Compensation\x20fund\x20vs\x20exposure','gloss':'The\x20merchant\x27s\x20compensation\x20fund\x20balance\x20measured\x20against\x20recent\x20order\x20volume\x20(the\x20safety\x20buffer\x20for\x20payouts).'},{'slot':'transparency','label':'Transparency\x20profile','gloss':'The\x20shop\x27s\x20public\x20on-chain\x20profile\x20—\x20description\x20and\x20publish/pause\x20flags\x20a\x20buyer\x20can\x20verify\x20before\x20paying.'}],SLOT_FACTS={'service_snapshot':[],'arbitration':['arbitration.binding'],'reviews':['reviews.votes'],'fulfillment_orders':['fulfillment.orders'],'fulfillment_workflow':['fulfillment.workflow'],'fund_safety':['fund.compensation','fund.exposure'],'transparency':['transparency.profile']},RISK_RULE_SOURCES={'risk_workflow':{'slots':['fulfillment_workflow'],'ruleIds':['R4']},'risk_fund':{'slots':['fund_safety','fulfillment_orders'],'ruleIds':['R2','R7','AC3','AC4']},'risk_trust':{'slots':['arbitration','transparency'],'ruleIds':['R1','R3','R6']},'risk_behavior':{'slots':['fulfillment_orders'],'ruleIds':['AC1','AC2']}};function nodeData(a,b){const c=a['graph']['nodes']['get'](b['toLowerCase']()),e=c?.['raw'],f=e?.['data']??e;return f&&typeof f==='object'?f:undefined;}function isFetched(a,b){const c=a['graph']['nodes']['get'](b['toLowerCase']());return!!c&&a['visibleNodes']['has'](c['id'])&&!!c['raw']&&c['state']!=='error'&&c['state']!=='stub';}function truncationOf(a,b,c){const d=a['graph']['truncations']['find'](e=>e['nodeId']===b&&e['schema']===c);return d?{'observed':d['observed'],'limit':d['limit']}:undefined;}function outEdges(a,b,c){return a['visibleEdges']['filter'](d=>d['from']===b['toLowerCase']()&&d['schema']===c);}function incEdges(a,b,c){return a['visibleEdges']['filter'](d=>d['to']===b['toLowerCase']()&&d['schema']===c);}function toBigInt(a){if(a==null)return 0x0n;try{return BigInt(typeof a==='number'?Math['trunc'](a):String(a));}catch{return 0x0n;}}function flag(a){return a===!![]||a===0x1||a==='1';}function snapProvenance(a){return{'path':a,'retention':'complete','confidence':'exact'};}function edgeProvenance(a,b,c){const {confidence:d,window:e}=pathConfidence(a,c),f=c['reduce']((g,h)=>RETENTION_RANK[h['retention']]>RETENTION_RANK[g]?h['retention']:g,'complete');return{'path':b,'retention':f,'confidence':d,...e?{'window':e}:{}};}export function projectEvaluationFacts(a,b,c){const f=b['toLowerCase'](),g=[],h=new Map(),i=new Map(),j=(U,V,W='exact')=>{h['set'](U,V),i['set'](U,W);},k=a['graph']['nodes']['get'](f),l=a['visibleNodes']['has'](f),m=!!(l&&k&&k['raw']&&k['state']!=='error'&&k['state']!=='stub'&&k['objectType']==='Service'),o=m?nodeData(a,f)??{}:{},q=k?.['coinType'];j('service_snapshot',m?'present':'gap');const r=Array['isArray'](o['arbitrations'])?o['arbitrations']['map'](String)['filter'](Boolean):[],u=outEdges(a,f,'service.arbitration'),w=[];let x=!![];for(const U of r){if(!isFetched(a,U)){x=![];continue;}const V=nodeData(a,U)??{},W=Array['isArray'](V['voting_guard'])?V['voting_guard']:[];w['push']({'id':U['toLowerCase'](),'paused':flag(V['bPaused']),'fee':toBigInt(V['fee'])['toString'](),'votingGuards':W['length'],'usageGuard':typeof V['usage_guard']==='string'&&V['usage_guard']!==''});}if(!m)j('arbitration','gap'),g['push']({'dimension':'arbitration','key':'arbitration.binding','state':'gap','provenance':snapProvenance([f]),'evidence':'Arbitration\x20configuration\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});else{if(r['length']===0x0)j('arbitration','empty'),g['push']({'dimension':'arbitration','key':'arbitration.binding','state':'empty','value':[],'provenance':snapProvenance([f,'Service.arbitrations']),'evidence':'Service\x20snapshot\x20shows\x20no\x20arbitration\x20service\x20configured\x20(verified\x20absence).'});else!x?(j('arbitration','gap'),g['push']({'dimension':'arbitration','key':'arbitration.binding','state':'gap','value':w,'provenance':u['length']>0x0?edgeProvenance(a,[f,'service.arbitration'],u):snapProvenance([f,'Service.arbitrations']),'evidence':w['length']+'/'+r['length']+'\x20arbitration\x20service(s)\x20resolved;\x20the\x20rest\x20failed\x20to\x20fetch.'})):(j('arbitration','present',u['length']>0x0?edgeProvenance(a,[f,'service.arbitration'],u)['confidence']:'exact'),g['push']({'dimension':'arbitration','key':'arbitration.binding','state':'present','value':w,'provenance':u['length']>0x0?edgeProvenance(a,[f,'service.arbitration'],u):snapProvenance([f,'Service.arbitrations']),'evidence':w['length']+'\x20arbitration\x20service(s)\x20resolved\x20from\x20the\x20snapshot\x20with\x20voting\x20rosters.'}));}const y=outEdges(a,f,'target.vote'),z=truncationOf(a,f,'target.vote'),A={'total':y['length'],'like':0x0,'dislike':0x0,'favor':0x0};for(const X of y){const Y=typeof X['payload']?.['voteBits']==='number'?X['payload']['voteBits']:0x0;if(Y&0x2)A['like']+=0x1;if(Y&0x4)A['dislike']+=0x1;if(Y&0x8)A['favor']+=0x1;}const B=y['length']>0x0?edgeProvenance(a,[f,'target.vote'],y):snapProvenance([f,'registrar.votes']);if(!m)j('reviews','gap'),g['push']({'dimension':'reviews','key':'reviews.votes','state':'gap','provenance':snapProvenance([f]),'evidence':'Reputation\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});else{if(z)j('reviews','gap',B['confidence']),g['push']({'dimension':'reviews','key':'reviews.votes','state':'gap','value':A,'provenance':{...B,'window':z},'evidence':'Vote\x20window\x20truncated\x20at\x20'+z['limit']+';\x20'+A['total']+'\x20vote(s)\x20visible\x20—\x20counts\x20are\x20a\x20floor.'});else A['total']===0x0?(j('reviews','empty'),g['push']({'dimension':'reviews','key':'reviews.votes','state':'empty','value':A,'provenance':B,'evidence':'No\x20registrar\x20votes\x20recorded\x20for\x20the\x20service\x20(window\x20read\x20empty,\x20no\x20truncation).'})):(j('reviews','present',B['confidence']),g['push']({'dimension':'reviews','key':'reviews.votes','state':'present','value':A,'provenance':B,'evidence':A['total']+'\x20registrar\x20vote(s):\x20'+A['like']+'\x20like,\x20'+A['dislike']+'\x20dislike,\x20'+A['favor']+'\x20favor.'}));}const C=outEdges(a,f,'service.order'),D=truncationOf(a,f,'service.order'),E={'observed':C['length'],'completed':0x0,'inProgress':0x0,'unknown':0x0,'windowedAmount':'0'};let F=0x0n;for(const Z of C){const a0=orderCompletionInGraph(a['graph'],Z['to'])['status'];if(a0==='completed')E['completed']+=0x1;else{if(a0==='in_progress')E['inProgress']+=0x1;else E['unknown']+=0x1;}F+=toBigInt(nodeData(a,Z['to'])?.['amount']);}E['windowedAmount']=F['toString']();const G=C['length']>0x0?edgeProvenance(a,[f,'service.order','Order'],C):snapProvenance([f,'service.order']);let H;if(!m)H='gap';else{if(D)H='gap';else H=C['length']===0x0?'empty':'present';}j('fulfillment_orders',H,G['confidence']);if(H==='gap'&&m)g['push']({'dimension':'fulfillment','key':'fulfillment.orders','state':'gap','value':E,'provenance':{...G,'window':D},'evidence':'Order\x20window\x20truncated\x20at\x20'+D?.['limit']+'\x20(observed\x20'+D?.['observed']+');\x20'+E['observed']+'\x20order(s)\x20visible\x20—\x20completion\x20stats\x20are\x20a\x20partial\x20floor.'});else{if(H==='empty')g['push']({'dimension':'fulfillment','key':'fulfillment.orders','state':'empty','value':E,'provenance':G,'evidence':'No\x20orders\x20in\x20the\x20service\x20window\x20(verified\x20absence).'});else H==='present'?g['push']({'dimension':'fulfillment','key':'fulfillment.orders','state':'present','value':E,'provenance':G,'evidence':E['observed']+'\x20recent\x20order(s):\x20'+E['completed']+'\x20completed,\x20'+E['inProgress']+'\x20in\x20progress,\x20'+E['unknown']+'\x20unresolved.'}):g['push']({'dimension':'fulfillment','key':'fulfillment.orders','state':'gap','provenance':snapProvenance([f]),'evidence':'Order\x20window\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});}const I=typeof o['machine']==='string'?o['machine']:'',J=I!==''&&isFetched(a,I),K=I===''?'':I['toLowerCase']()+'::node::',L=K===''?[]:a['graph']['edges']['filter'](a1=>a1['schema']==='wf.transition'&&a1['from']['startsWith'](K)),M=new Set();for(const a1 of L){M['add'](a1['from']);const a2=String(a1['payload']?.['node']??'');if(a2!=='')M['add'](''+K+a2);}let N,O;if(!m)N='gap',O='Workflow\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.';else{if(I==='')N='empty',O='No\x20workflow\x20template\x20configured\x20(verified\x20absence).';else{if(!J)N='gap',O='Machine\x20template\x20referenced\x20but\x20not\x20fetched\x20(fetch\x20gap).';else L['length']===0x0?(N='gap',O='Machine\x20fetched\x20but\x20no\x20wf.transition\x20edges\x20—\x20terminal\x20set\x20unverifiable;\x20completion\x20states\x20stay\x20unknown.'):(N='present',O='Machine\x20template\x20resolved\x20with\x20'+M['size']+'\x20workflow\x20node(s);\x20terminal\x20set\x20verifiable.');}}j('fulfillment_workflow',N,N==='present'?'exact':N==='empty'?'exact':'windowed'),g['push']({'dimension':'fulfillment','key':'fulfillment.workflow','state':N,...I!==''&&J?{'value':{'machine':I['toLowerCase'](),'nodes':M['size']}}:{},'provenance':N==='present'?edgeProvenance(a,[f,'service.machine','wf.transition'],L):snapProvenance([f,'Service.machine']),'evidence':O});const P=toBigInt(o['compensation_fund']);if(!m)j('fund_safety','gap'),g['push']({'dimension':'fund_safety','key':'fund.compensation','state':'gap','provenance':snapProvenance([f]),'evidence':'Fund\x20backing\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'}),g['push']({'dimension':'fund_safety','key':'fund.exposure','state':'gap','provenance':snapProvenance([f]),'evidence':'Payout\x20exposure\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});else{j('fund_safety','present'),g['push']({'dimension':'fund_safety','key':'fund.compensation','state':'present','value':{'fund':P['toString'](),...q?{'coinType':q}:{}},'provenance':snapProvenance([f,'Service.compensation_fund']),'evidence':'Compensation\x20fund\x20'+P['toString']()+'\x20base\x20units'+(q?'\x20in\x20'+q:'')+'.'});const a3=F*0x3n,a4=worstState('present',H),a5=c['find'](a6=>a6['id']==='R2:'+f);g['push']({'dimension':'fund_safety','key':'fund.exposure','state':a4,'value':{'fund':P['toString'](),'windowedCount':E['observed'],'windowedAmount':F['toString'](),'neededCeiling':a3['toString'](),'coverageMet':P>=a3},'provenance':C['length']>0x0?edgeProvenance(a,[f,'service.order','Order.amount','Service.compensation_fund'],C):snapProvenance([f,'Service.compensation_fund']),'findingIds':a5?[a5['id']]:undefined,'evidence':H==='empty'?'No\x20recent\x20orders;\x20no\x20payout\x20exposure\x20to\x20cover.':'Recent\x20orders\x20total\x20'+F['toString']()+'\x20base\x20units'+(q?'\x20in\x20'+q:'')+'\x20across\x20'+E['observed']+'\x20order(s);\x20the\x20compensation\x20fund\x20should\x20cover\x20at\x20least\x203x\x20that\x20('+a3['toString']()+'\x20base\x20units'+(q?'\x20in\x20'+q:'')+')\x20—\x20coverage\x20'+(P>=a3?'met':'not\x20met')+(D?'\x20(older\x20orders\x20outside\x20the\x20fetch\x20window,\x20floor\x20value\x20only)':'')+'.'});}if(!m)j('transparency','gap'),g['push']({'dimension':'transparency','key':'transparency.profile','state':'gap','provenance':snapProvenance([f]),'evidence':'Transparency\x20unverifiable:\x20the\x20service\x20snapshot\x20is\x20missing.'});else{const a6=typeof o['setting_lock_duration']==='number'?o['setting_lock_duration']:Number(toBigInt(o['setting_lock_duration'])),a7=flag(o['bPublished']);j('transparency','present'),g['push']({'dimension':'transparency','key':'transparency.profile','state':'present','value':{'description':typeof o['description']==='string'?o['description']:'','location':typeof o['location']==='string'?o['location']:'','settingLockDuration':Number['isFinite'](a6)?a6:0x0,'published':a7,'paused':flag(o['bPaused'])},'provenance':snapProvenance([f,'Service.bPublished','Service.setting_lock_duration']),'findingIds':c['some'](a8=>a8['id']==='R6:'+f)?['R6:'+f]:undefined,'evidence':'Service\x20profile:\x20description\x20'+(typeof o['description']==='string'&&o['description']!==''?'provided':'not\x20provided')+',\x20location\x20'+(typeof o['location']==='string'&&o['location']!==''?'provided':'not\x20provided')+',\x20service\x20lock\x20'+a6+'\x20ms,\x20'+(a7?'published':'unpublished')+'.'});}for(const a8 of['risk_workflow','risk_fund','risk_trust','risk_behavior']){const a9=RISK_RULE_SOURCES[a8];let aa='present',ab,ac=-0x1;for(const aj of a9['slots']){const ak=h['get'](aj)??'gap';STATE_RANK[ak]>ac&&(ac=STATE_RANK[ak],aa=ak,ab=aj);}let ae;if(aa==='gap')ae='windowed';else{if(aa==='empty')ae='bounded';else ae=ab&&i['get'](ab)||'exact';}const af=f['toLowerCase'](),ag=new Set([af,...[...a['graph']['nodes']['keys']()]['map'](al=>al['toLowerCase']())]),ah=(al,am)=>{if(!al['startsWith'](am+':'))return![];const an=al['slice'](am['length']+0x1)['toLowerCase'](),ao=an['split']('#')[0x0]['split'](':')[0x0]['split']('|')[0x0];return ao['length']===0x0||ag['has'](ao);},ai=c['filter'](al=>a9['ruleIds']['some'](am=>al['id']['startsWith'](am+String['fromCharCode'](0x3a))));g['push']({'dimension':a8,'key':a8+'.findings','state':aa,'value':{'findings':ai['map'](al=>({'id':al['id'],'severity':al['severity'],'title':al['title']})),'where':ai['map'](al=>findingWhere(al))},'provenance':{'path':[f,...a9['slots']],'retention':'derived','confidence':ae},'findingIds':ai['map'](al=>al['id']),'evidence':aa==='gap'?'Input\x20evidence\x20has\x20fetch\x20gaps;\x20the\x20risk\x20conclusion\x20is\x20unverifiable.':aa==='empty'?'Input\x20evidence\x20is\x20configured-empty;\x20the\x20risk\x20rules\x20are\x20not\x20applicable.':ai['length']>0x0?ai['length']+'\x20structural\x20risk\x20finding(s)\x20on\x20this\x20object,\x20from\x20the\x20analyzer\x20registry.':'No\x20risk\x20fired\x20on\x20this\x20object;\x20input\x20evidence\x20slots\x20are\x20fully\x20materialized.'});}const Q=[];for(const al of a['visibleNodes']){const am=profileOf(a,al);if(!am)continue;const an=Array['isArray'](am['profileRecords'])?am['profileRecords']:undefined;Q['push']({'nodeId':al,...typeof am['registeredAt']==='number'?{'registeredAt':am['registeredAt']}:{},'hasDescription':!!am['hasDescription']||typeof am['description']==='string','recordCount':typeof am['recordCount']==='number'?am['recordCount']:an?.['length']??0x0,...typeof am['description']==='string'?{'description':am['description']}:{},...an?{'profileRecords':an}:{}});}const R=REQUIRED_SLOTS['length'],S=REQUIRED_SLOTS['filter'](({slot:ao})=>h['get'](ao)==='present')['length'],T=R===0x0?0x64:Math['round'](S/R*0x64);return{'target':f,'role':String(a['role']),'facts':g,'slots':REQUIRED_SLOTS['map'](({slot:ao,label:ap,gloss:aq})=>({'slot':ao,'label':ap,'gloss':aq,'required':!![],'state':h['get'](ao)??'gap','facts':[...SLOT_FACTS[ao]??[]]})),'completeness':T,'profiles':Q};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PackageAddress}from'@wowok/wowok';const SYS=a=>({'field':'id','disposition':{'kind':'nonAddress','note':'Object\x20identity\x20(UID);\x20system-managed,\x20never\x20a\x20business\x20reference'},'evidence':a}),SERVICE={'object':'Service','moveStruct':'service.move\x20L174-193\x20Service<T>','fields':[SYS('service.move\x20L174-193'),{'field':'description','disposition':{'kind':'attribute','note':'Shop\x20self-description;\x20node\x20property'},'evidence':'service.move\x20L174-193'},{'field':'location','disposition':{'kind':'attribute','note':'Service\x20area\x20/\x20market-opportunity\x20routing\x20key'},'evidence':'service.move\x20L174-193'},{'field':'sales','disposition':{'kind':'attribute','note':'Catalog\x20items\x20for\x20sale\x20(what\x20the\x20shop\x20sells)'},'evidence':'service.move\x20L174-193'},{'field':'repositories','disposition':{'kind':'edge','schema':'service.repository'},'evidence':'service.move\x20L174-193\x20(<=100)'},{'field':'buy_guard','disposition':{'kind':'edge','schema':'service.buy_guard'},'evidence':'service.move\x20L174-193'},{'field':'machine','disposition':{'kind':'edge','schema':'service.machine'},'evidence':'service.move\x20L174-193'},{'field':'bPublished','disposition':{'kind':'attribute','note':'Publish\x20flag;\x20freezes\x20machine/guard\x20settings;\x20analyzer\x20input'},'evidence':'service.move\x20L174-193'},{'field':'bPaused','disposition':{'kind':'attribute','note':'Pause\x20flag;\x20purchasability;\x20analyzer\x20input'},'evidence':'service.move\x20L174-193'},{'field':'customer_required','disposition':{'kind':'attribute','note':'Custom\x20info\x20fields\x20the\x20shop\x20requires\x20from\x20buyers'},'evidence':'service.move\x20L174-193'},{'field':'arbitrations','disposition':{'kind':'edge','schema':'service.arbitration'},'evidence':'service.move\x20L174-193\x20(<=20)'},{'field':'compensation_fund','disposition':{'kind':'attribute','note':'Escrowed\x20compensation\x20balance\x20(arbitration\x20solvency\x20signal)'},'evidence':'service.move\x20L174-193'},{'field':'paused_time','disposition':{'kind':'attribute','note':'When\x20the\x20shop\x20was\x20paused\x20(timestamp-ms)'},'evidence':'service.move\x20L174-193'},{'field':'setting_lock_duration','disposition':{'kind':'attribute','note':'Lock\x20duration\x20gating\x20post-pause\x20setting\x20changes'},'evidence':'service.move\x20L174-193'},{'field':'order_allocators','disposition':{'kind':'edge','schema':'service.order_allocator_guard','note':'Allocators\x20container;\x20guard\x20members\x20are\x20the\x20edge,\x20sharing\x20amounts\x20ride\x20the\x20payload'},'evidence':'service.move\x20L174-193;\x20allocation.move\x20L194-200'},{'field':'rewards','disposition':{'kind':'edge','schema':'service.reward'},'evidence':'service.move\x20L174-193\x20(<=20)'},{'field':'um','disposition':{'kind':'edge','schema':'service.um'},'evidence':'service.move\x20L174-193'},{'field':'permission','disposition':{'kind':'edge','schema':'service.permission'},'evidence':'service.move\x20L174-193'}]},ORDER={'object':'Order','moveStruct':'order.move\x20L59-74\x20Order','fields':[SYS('order.move\x20L59-74'),{'field':'items','disposition':{'kind':'attribute','note':'Purchased\x20line\x20items\x20(what\x20was\x20bought)'},'evidence':'order.move\x20L59-74'},{'field':'discount','disposition':{'kind':'edge','schema':'order.discount'},'evidence':'order.move\x20L59-74'},{'field':'progress','disposition':{'kind':'edge','schema':'order.progress'},'evidence':'order.move\x20L59-74,L130'},{'field':'machine','disposition':{'kind':'edge','schema':'order.machine'},'evidence':'order.move\x20L59-74,L130'},{'field':'amount','disposition':{'kind':'attribute','note':'Total\x20paid\x20(order\x20value\x20signal)'},'evidence':'order.move\x20L59-74'},{'field':'owner','disposition':{'kind':'edge','schema':'order.builder','note':'SDK\x20normalizes\x20owner\x20to\x20builder'},'evidence':'order.move\x20L59-74\x20(owner)'},{'field':'service','disposition':{'kind':'edge','schema':'order.service'},'evidence':'order.move\x20L59-74'},{'field':'dispute','disposition':{'kind':'edge','schema':'order.dispute'},'evidence':'order.move\x20L59-74'},{'field':'agent','disposition':{'kind':'edge','schema':'order.agent'},'evidence':'order.move\x20L59-74,L179\x20(<=10)'},{'field':'allocation','disposition':{'kind':'edge','schema':'order.allocation'},'evidence':'order.move\x20L59-74,L130'},{'field':'claimed_by','disposition':{'kind':'edge','schema':'order.claimed_by'},'evidence':'order.move\x20L59-74,L86-96'},{'field':'required_info','disposition':{'kind':'edge','schema':'order.required_info'},'evidence':'order.move\x20L73,L77-80','oq':'IM\x20book\x20or\x20WTS\x20proof\x20(b11/b12)'},{'field':'time','disposition':{'kind':'attribute','note':'Creation\x20time\x20(timestamp-ms)'},'evidence':'order.move\x20L59-74'}]},DISCOUNT={'object':'Discount','moveStruct':'service.move\x20L109-119\x20Discount','fields':[SYS('service.move\x20L109-119'),{'field':'name','disposition':{'kind':'attribute','note':'Discount\x20campaign\x20name'},'evidence':'service.move\x20L109-119'},{'field':'discount_type','disposition':{'kind':'attribute','note':'RATIO\x20(off%)\x20or\x20MINUS\x20(-N)\x20pricing\x20mode'},'evidence':'service.move\x20L109-119'},{'field':'benchmark','disposition':{'kind':'attribute','note':'Minimum-spend\x20condition\x20for\x20the\x20discount'},'evidence':'service.move\x20L109-119'},{'field':'off','disposition':{'kind':'attribute','note':'Discount\x20magnitude\x20(rate\x20or\x20fixed\x20amount)'},'evidence':'service.move\x20L109-119'},{'field':'time_start','disposition':{'kind':'attribute','note':'Validity\x20window\x20start\x20(timestamp-ms)'},'evidence':'service.move\x20L109-119'},{'field':'time_end','disposition':{'kind':'attribute','note':'Validity\x20window\x20end\x20/\x20expiry'},'evidence':'service.move\x20L109-119'},{'field':'service','disposition':{'kind':'edge','schema':'discount.service'},'evidence':'service.move\x20L117','oq':'OQ-3\x20(Discount\x20joins\x20COVERED\x20types)'},{'field':'transferable','disposition':{'kind':'attribute','note':'Whether\x20the\x20discount\x20may\x20be\x20handed\x20to\x20a\x20receiver'},'evidence':'service.move\x20L109-119'}]},PROGRESS={'object':'Progress','moveStruct':'progress.move\x20L75-85\x20Progress','fields':[SYS('progress.move\x20L75-85'),{'field':'machine','disposition':{'kind':'edge','schema':'progress.machine'},'evidence':'progress.move\x20L75-85'},{'field':'context_repositories','disposition':{'kind':'edge','schema':'progress.context_repository'},'evidence':'progress.move\x20L78,L199-208'},{'field':'current','disposition':{'kind':'attribute','note':'Current\x20node\x20name\x20(completion\x20determination\x20input)'},'evidence':'progress.move\x20L75-85'},{'field':'task','disposition':{'kind':'edge','schema':'progress.task'},'evidence':'progress.move\x20L80'},{'field':'namedOperator','disposition':{'kind':'edge','schema':'progress.named_operator','note':'Container\x20struct;\x20operators[]\x20members\x20are\x20the\x20edge'},'evidence':'progress.move\x20L81\x20(<=80)'},{'field':'session','disposition':{'kind':'attribute','note':'Per-node\x20session\x20records\x20(runtime\x20state)'},'evidence':'progress.move\x20L82'},{'field':'history','disposition':{'kind':'attribute','note':'Node-history\x20ParentTableVec\x20(runtime\x20audit\x20trail,\x20not\x20enumerated\x20as\x20edges)'},'evidence':'progress.move\x20L83'},{'field':'current_time','disposition':{'kind':'attribute','note':'Last\x20activity\x20clock\x20(staleness\x20signal)'},'evidence':'progress.move\x20L84'}]},MACHINE={'object':'Machine','moveStruct':'machine.move\x20L298-307\x20Machine','fields':[SYS('machine.move\x20L298-307'),{'field':'description','disposition':{'kind':'attribute','note':'Workflow\x20description'},'evidence':'machine.move\x20L298-307'},{'field':'nodes','disposition':{'kind':'edge','schema':'machine.node','coSchemas':['wf.transition','wf.forward_guard'],'note':'ParentLinkedTable\x20walk\x20yields\x20node\x20rows;\x20transitions\x20and\x20forward\x20guards\x20derive\x20from\x20the\x20same\x20rows'},'evidence':'machine.move\x20L301'},{'field':'consensus_repositories','disposition':{'kind':'edge','schema':'machine.consensus_repository'},'evidence':'machine.move\x20L302'},{'field':'bPaused','disposition':{'kind':'attribute','note':'Workflow\x20pause\x20flag'},'evidence':'machine.move\x20L298-307'},{'field':'bPublished','disposition':{'kind':'attribute','note':'Publish\x20flag;\x20freezes\x20the\x20node\x20table'},'evidence':'machine.move\x20L298-307'},{'field':'um','disposition':{'kind':'edge','schema':'machine.um'},'evidence':'machine.move\x20L305'},{'field':'permission','disposition':{'kind':'edge','schema':'machine.permission'},'evidence':'machine.move\x20L306'}]},ALLOCATION={'object':'Allocation','moveStruct':'allocation.move\x20L196-202\x20Allocation<T>','fields':[SYS('allocation.move\x20L196-202'),{'field':'balance','disposition':{'kind':'attribute','note':'Remaining\x20pool\x20balance\x20(solvency\x20signal)'},'evidence':'allocation.move\x20L196-202'},{'field':'allocators','disposition':{'kind':'edge','schema':'allocation.guard','note':'Allocator\x20segments;\x20guard\x20members\x20are\x20the\x20edge,\x20sharing\x20amounts\x20ride\x20the\x20payload'},'evidence':'allocation.move\x20L199,L194-200'},{'field':'payment_info','disposition':{'kind':'edge','schema':'allocation.for_object','coSchemas':['allocation.for_guard'],'note':'PaymentInfo\x20captured\x20at\x20pool\x20create;\x20remark/index\x20are\x20attributes'},'evidence':'allocation.move\x20L200;\x20payment.move\x20L66-71'},{'field':'payment','disposition':{'kind':'edge','schema':'allocation.payment'},'evidence':'allocation.move\x20L201,L307-316'}]},ARBITRATION={'object':'Arbitration','moveStruct':'arbitration.move\x20L47-58\x20Arbitration<T>','fields':[SYS('arbitration.move\x20L47-58'),{'field':'description','disposition':{'kind':'attribute','note':'Arbitration\x20service\x20self-description'},'evidence':'arbitration.move\x20L47-58'},{'field':'location','disposition':{'kind':'attribute','note':'Jurisdiction\x20/\x20service\x20area'},'evidence':'arbitration.move\x20L47-58'},{'field':'voting_guard','disposition':{'kind':'edge','schema':'arbitration.voting_guard','note':'Empty\x20vector\x20=\x20open\x20voting;\x20members\x20carry\x20vote\x20weight'},'evidence':'arbitration.move\x20L51'},{'field':'usage_guard','disposition':{'kind':'edge','schema':'arbitration.usage_guard'},'evidence':'arbitration.move\x20L52'},{'field':'fee','disposition':{'kind':'attribute','note':'Case\x20filing\x20fee'},'evidence':'arbitration.move\x20L53'},{'field':'balance','disposition':{'kind':'attribute','note':'Service\x20balance\x20(solvency\x20signal)'},'evidence':'arbitration.move\x20L54'},{'field':'bPaused','disposition':{'kind':'attribute','note':'Service\x20pause\x20flag'},'evidence':'arbitration.move\x20L55'},{'field':'um','disposition':{'kind':'edge','schema':'arbitration.um'},'evidence':'arbitration.move\x20L56'},{'field':'permission','disposition':{'kind':'edge','schema':'arbitration.permission'},'evidence':'arbitration.move\x20L57'}]},ARB={'object':'Arb','moveStruct':'arb.move\x20L95-110\x20Arb<T>','fields':[SYS('arb.move\x20L95-110'),{'field':'description','disposition':{'kind':'attribute','note':'Case\x20description'},'evidence':'arb.move\x20L95-110'},{'field':'order','disposition':{'kind':'edge','schema':'arb.order'},'evidence':'arb.move\x20L98'},{'field':'arbitration','disposition':{'kind':'edge','schema':'arb.arbitration_service'},'evidence':'arb.move\x20L99'},{'field':'voted','disposition':{'kind':'edge','schema':'arb.voter','note':'Voter\x20members\x20are\x20the\x20edge;\x20weights/agrees\x20ride\x20the\x20payload'},'evidence':'arb.move\x20L100\x20(<=520)'},{'field':'proposition','disposition':{'kind':'attribute','note':'Propositions\x20and\x20votes\x20(state-machine\x20input)'},'evidence':'arb.move\x20L101'},{'field':'fee','disposition':{'kind':'attribute','note':'Escrowed\x20case\x20fee'},'evidence':'arb.move\x20L102'},{'field':'feedback','disposition':{'kind':'attribute','note':'Ruling\x20feedback\x20text'},'evidence':'arb.move\x20L103'},{'field':'indemnity','disposition':{'kind':'attribute','note':'Ruled\x20indemnity\x20(compensation\x20outcome)'},'evidence':'arb.move\x20L104'},{'field':'voting_deadline','disposition':{'kind':'attribute','note':'Voting\x20deadline\x20(timestamp-ms)'},'evidence':'arb.move\x20L105'},{'field':'objection','disposition':{'kind':'attribute','note':'Objection\x20record'},'evidence':'arb.move\x20L106'},{'field':'status','disposition':{'kind':'attribute','note':'Case\x20state-machine\x20stage\x20(analyzer\x20input)'},'evidence':'arb.move\x20L107'},{'field':'compensation_time','disposition':{'kind':'attribute','note':'When\x20compensation\x20executed\x20(timestamp-ms)'},'evidence':'arb.move\x20L108'},{'field':'time','disposition':{'kind':'attribute','note':'Case\x20creation\x20time\x20(timestamp-ms)'},'evidence':'arb.move\x20L109'}]},DEMAND={'object':'Demand','moveStruct':'demand.move\x20L67-76\x20Demand','fields':[SYS('demand.move\x20L67-76'),{'field':'description','disposition':{'kind':'attribute','note':'What\x20the\x20demanding\x20side\x20asks\x20for'},'evidence':'demand.move\x20L67-76'},{'field':'location','disposition':{'kind':'attribute','note':'Demand\x20area'},'evidence':'demand.move\x20L67-76'},{'field':'rewards','disposition':{'kind':'edge','schema':'demand.reward'},'evidence':'demand.move\x20L71'},{'field':'guards','disposition':{'kind':'edge','schema':'demand.guard','note':'Empty\x20=\x20bare\x20present\x20(no\x20acceptance\x20gate)'},'evidence':'demand.move\x20L72'},{'field':'presenters','disposition':{'kind':'edge','schema':'demand.presenter','coSchemas':['demand.presenter_service'],'note':'One\x20ParentTable\x20read\x20backs\x20both\x20the\x20presenter\x20edge\x20and\x20the\x20same-row\x20sub-service\x20co-edge'},'evidence':'demand.move\x20L73,L46-54'},{'field':'um','disposition':{'kind':'edge','schema':'demand.um'},'evidence':'demand.move\x20L74'},{'field':'permission','disposition':{'kind':'edge','schema':'demand.permission'},'evidence':'demand.move\x20L75'}]},REWARD={'object':'Reward','moveStruct':'reward.move\x20L129-138\x20Reward<T>','fields':[SYS('reward.move\x20L129-138'),{'field':'description','disposition':{'kind':'attribute','note':'Pool\x20purpose\x20description'},'evidence':'reward.move\x20L129-138'},{'field':'guards','disposition':{'kind':'edge','schema':'reward.guard','note':'Members\x20carry\x20recipient/amount/expiration\x20semantics\x20in\x20the\x20payload'},'evidence':'reward.move\x20L132'},{'field':'balance','disposition':{'kind':'attribute','note':'Remaining\x20pool\x20balance\x20(solvency\x20signal)'},'evidence':'reward.move\x20L133'},{'field':'guard_not_added_expiration_time','disposition':{'kind':'attribute','note':'Claim-window\x20expiry\x20when\x20guards\x20were\x20never\x20added'},'evidence':'reward.move\x20L134'},{'field':'record','disposition':{'kind':'edge','schema':'reward.claim'},'evidence':'reward.move\x20L135,L117-138'},{'field':'um','disposition':{'kind':'edge','schema':'reward.um'},'evidence':'reward.move\x20L136'},{'field':'permission','disposition':{'kind':'edge','schema':'reward.permission'},'evidence':'reward.move\x20L137'}]},REPOSITORY={'object':'Repository','moveStruct':'repository.move\x20L461-469\x20Repository','fields':[SYS('repository.move\x20L461-469'),{'field':'description','disposition':{'kind':'attribute','note':'Repository\x20description'},'evidence':'repository.move\x20L461-469'},{'field':'policies','disposition':{'kind':'edge','schema':'repository.policy_guard','coSchemas':['repository.quote_guard'],'note':'PolicyRule\x20vector;\x20write_guard[].guard\x20members\x20and\x20quote_guard\x20are\x20two\x20deep\x20edges;\x20policy\x20name\x20is\x20an\x20attribute'},'evidence':'repository.move\x20L464,L106-113'},{'field':'data','disposition':{'kind':'edge','schema':'repository.data_about','note':'DataKey.id\x20carries\x20the\x20about-object;\x20row\x20key\x20name\x20rides\x20the\x20payload'},'evidence':'repository.move\x20L465,L456-459'},{'field':'rewards','disposition':{'kind':'edge','schema':'repository.reward'},'evidence':'repository.move\x20L466'},{'field':'um','disposition':{'kind':'edge','schema':'repository.um'},'evidence':'repository.move\x20L467'},{'field':'permission','disposition':{'kind':'edge','schema':'repository.permission'},'evidence':'repository.move\x20L468'}]},CONTACT={'object':'Contact','moveStruct':'contact.move\x20L25-31\x20Contact','fields':[SYS('contact.move\x20L25-31'),{'field':'description','disposition':{'kind':'attribute','note':'Roster\x20description'},'evidence':'contact.move\x20L25-31'},{'field':'location','disposition':{'kind':'attribute','note':'Roster\x20area'},'evidence':'contact.move\x20L25-31'},{'field':'ims','disposition':{'kind':'edge','schema':'contact.im','note':'Im.at\x20members\x20are\x20the\x20edge;\x20status/join_time/description\x20ride\x20the\x20payload'},'evidence':'contact.move\x20L29,L18-23,L85-105','oq':'OQ-1\x20(at\x20verified\x20EOA)'},{'field':'permission','disposition':{'kind':'edge','schema':'contact.permission'},'evidence':'contact.move\x20L30'}]},PERMISSION={'object':'Permission','moveStruct':'permission.move\x20L33-41\x20Permission','fields':[SYS('permission.move\x20L33-41'),{'field':'owner','disposition':{'kind':'edge','schema':'permission.owner'},'evidence':'permission.move\x20L35,L537-543'},{'field':'admin','disposition':{'kind':'edge','schema':'permission.admin'},'evidence':'permission.move\x20L36'},{'field':'description','disposition':{'kind':'attribute','note':'Group\x20description'},'evidence':'permission.move\x20L37'},{'field':'remark','disposition':{'kind':'attribute','note':'Permission\x20remark\x20records'},'evidence':'permission.move\x20L38'},{'field':'table','disposition':{'kind':'edge','schema':'permission.entity','note':'ParentLinkedTable\x20of\x20EOA/Guard\x20members\x20with\x20perm-index\x20bits'},'evidence':'permission.move\x20L39'},{'field':'um','disposition':{'kind':'edge','schema':'permission.um'},'evidence':'permission.move\x20L40'}]},GUARD={'object':'Guard','moveStruct':'guard.move\x20L84-94\x20Guard','fields':[SYS('guard.move\x20L84-94'),{'field':'description','disposition':{'kind':'attribute','note':'Gate\x20description'},'evidence':'guard.move\x20L84-94'},{'field':'table','disposition':{'kind':'attribute','note':'Submission\x20slot\x20definitions\x20(identifier\x20->\x20type\x20mapping;\x20Gate\x20analysis\x20property)'},'evidence':'guard.move\x20L87'},{'field':'validated','disposition':{'kind':'attribute','note':'Validated\x20slot\x20types\x20(Gate\x20analysis\x20property)'},'evidence':'guard.move\x20L88'},{'field':'input','disposition':{'kind':'attribute','note':'Static\x20input\x20bytes\x20for\x20the\x20gate\x20predicate'},'evidence':'guard.move\x20L89'},{'field':'relies','disposition':{'kind':'edge','schema':'guard.relies'},'evidence':'guard.move\x20L90\x20(<=4,\x20one\x20level)'},{'field':'relies_logic_and','disposition':{'kind':'attribute','note':'AND/OR\x20combination\x20of\x20relied\x20gates'},'evidence':'guard.move\x20L91'},{'field':'immutable','disposition':{'kind':'attribute','note':'Whether\x20the\x20gate\x20definition\x20is\x20frozen'},'evidence':'guard.move\x20L92'},{'field':'rep','disposition':{'kind':'attribute','note':'Last\x20query-validation\x20outcome\x20flag'},'evidence':'guard.move\x20L93'}]},PASSPORT={'object':'Passport','moveStruct':'passport.move\x20L41-50\x20Passport','fields':[SYS('passport.move\x20L41-50'),{'field':'guard','disposition':{'kind':'edge','schema':'passport.guard','coSchemas':['passport.ticket_relies'],'note':'GuardInfo\x20tickets;\x20ticket.guard\x20is\x20the\x20primary\x20edge,\x20ticket.relies\x20the\x20same-ticket\x20co-edge;\x20result/impack\x20flags\x20are\x20attributes'},'evidence':'passport.move\x20L43,L32-39'},{'field':'result','disposition':{'kind':'attribute','note':'Overall\x20verification\x20outcome'},'evidence':'passport.move\x20L44'},{'field':'tx_hash','disposition':{'kind':'attribute','note':'Verification\x20transaction\x20digest'},'evidence':'passport.move\x20L45'},{'field':'impack','disposition':{'kind':'edge','schema':'passport.impack'},'evidence':'passport.move\x20L46,L227-242'},{'field':'time','disposition':{'kind':'attribute','note':'Verification\x20time\x20(timestamp-ms)'},'evidence':'passport.move\x20L47'},{'field':'signer','disposition':{'kind':'edge','schema':'passport.signer'},'evidence':'passport.move\x20L48,L94-98'},{'field':'has_verified','disposition':{'kind':'attribute','note':'Whether\x20the\x20credential\x20was\x20consumed'},'evidence':'passport.move\x20L49'}]},PROOF={'object':'Proof','moveStruct':'proof.move\x20L13-24\x20Proof','fields':[SYS('proof.move\x20L13-24'),{'field':'description','disposition':{'kind':'attribute','note':'Evidence\x20description'},'evidence':'proof.move\x20L13-24'},{'field':'proof','disposition':{'kind':'attribute','note':'Evidence\x20payload\x20string'},'evidence':'proof.move\x20L13-24'},{'field':'item_count','disposition':{'kind':'attribute','note':'Item\x20count\x20covered\x20by\x20the\x20evidence'},'evidence':'proof.move\x20L13-24'},{'field':'server_pubkey','disposition':{'kind':'attribute','note':'Witness\x20server\x20public\x20key'},'evidence':'proof.move\x20L13-24'},{'field':'server_signature','disposition':{'kind':'attribute','note':'Witness\x20server\x20signature'},'evidence':'proof.move\x20L13-24'},{'field':'about','disposition':{'kind':'edge','schema':'proof.about'},'evidence':'proof.move\x20L20'},{'field':'signer','disposition':{'kind':'edge','schema':'proof.signer'},'evidence':'proof.move\x20L21'},{'field':'proof_type','disposition':{'kind':'attribute','note':'Evidence\x20kind\x20discriminator'},'evidence':'proof.move\x20L22'},{'field':'time','disposition':{'kind':'attribute','note':'Signing\x20time\x20(timestamp-ms)'},'evidence':'proof.move\x20L23'}]},TREASURY={'object':'Treasury','moveStruct':'treasury.move\x20L72-83\x20Treasury<T>','fields':[SYS('treasury.move\x20L72-83'),{'field':'description','disposition':{'kind':'attribute','note':'Treasury\x20description'},'evidence':'treasury.move\x20L72-83'},{'field':'balance','disposition':{'kind':'attribute','note':'Current\x20balance\x20(solvency\x20signal)'},'evidence':'treasury.move\x20L75'},{'field':'history','disposition':{'kind':'edge','schema':'treasury.record'},'evidence':'treasury.move\x20L76,L39-46'},{'field':'external_deposit_guard','disposition':{'kind':'edge','schema':'treasury.deposit_guard'},'evidence':'treasury.move\x20L77,L61-65,L138-194'},{'field':'external_withdraw_guard','disposition':{'kind':'edge','schema':'treasury.withdraw_guard'},'evidence':'treasury.move\x20L78,L67-71,L197-250'},{'field':'inflow','disposition':{'kind':'attribute','note':'Lifetime\x20inflow\x20(throughput\x20signal)'},'evidence':'treasury.move\x20L79'},{'field':'outflow','disposition':{'kind':'attribute','note':'Lifetime\x20outflow\x20(throughput\x20signal)'},'evidence':'treasury.move\x20L80'},{'field':'um','disposition':{'kind':'edge','schema':'treasury.um'},'evidence':'treasury.move\x20L81'},{'field':'permission','disposition':{'kind':'edge','schema':'treasury.permission'},'evidence':'treasury.move\x20L82'}]},PAYMENT={'object':'Payment','moveStruct':'payment.move\x20L93-101\x20Payment<T>','fields':[SYS('payment.move\x20L93-101'),{'field':'amount','disposition':{'kind':'attribute','note':'Total\x20payment\x20amount'},'evidence':'payment.move\x20L93-101'},{'field':'time','disposition':{'kind':'attribute','note':'Payment\x20time\x20(timestamp-ms)'},'evidence':'payment.move\x20L93-101'},{'field':'info','disposition':{'kind':'edge','schema':'payment.for_object','coSchemas':['payment.for_guard'],'note':'PaymentInfo\x20struct;\x20for_object/for_guard\x20are\x20the\x20two\x20routing\x20edges;\x20remark/index\x20are\x20attributes'},'evidence':'payment.move\x20L97,L66-71'},{'field':'from_object','disposition':{'kind':'edge','schema':'payment.from_object'},'evidence':'payment.move\x20L98,L149-161'},{'field':'signer','disposition':{'kind':'edge','schema':'payment.signer'},'evidence':'payment.move\x20L99,L111'},{'field':'record','disposition':{'kind':'edge','schema':'payment.recipient','note':'Revenue\x20entries;\x20recipient\x20members\x20are\x20the\x20edge,\x20amounts\x20ride\x20the\x20payload'},'evidence':'payment.move\x20L100,L93-101\x20(<=200)'}]},COIN_WRAPPER={'object':'CoinWrapper','moveStruct':'payment.move\x20L40-44\x20CoinWrapper<T>','fields':[SYS('payment.move\x20L40-44'),{'field':'balance','disposition':{'kind':'transient','note':'Escrowed\x20coin\x20inside\x20the\x20in-flight\x20wrapper;\x20consumed\x20by\x20unwrap'},'evidence':'payment.move\x20L42'},{'field':'payment','disposition':{'kind':'transient','note':'Back-reference\x20to\x20the\x20Payment\x20under\x20construction;\x20process\x20object,\x20deliberately\x20not\x20a\x20graph\x20edge'},'evidence':'payment.move\x20L43,L46-53'}]},RESOURCE={'object':'Resource','moveStruct':'resource.move\x20L18-21\x20Resource','fields':[SYS('resource.move\x20L18-21'),{'field':'table','disposition':{'kind':'nonAddress','note':'AddressTag\x20rows\x20(user\x20tags/nick);\x20projected\x20as\x20node\x20attributes\x20for\x20display,\x20deliberately\x20no\x20structural\x20edge'},'evidence':'resource.move\x20L20'}]},ENTITY_ORDERS={'object':'EntityOrders','moveStruct':'entity_order.move\x20L31-34\x20EntityOrders','fields':[SYS('entity_order.move\x20L31-34'),{'field':'table','disposition':{'kind':'edge','schema':'eoa.order','note':'Per-entity\x20FIFO\x205200\x20order-membership\x20rows\x20(role\x20bits\x20in\x20payload)'},'evidence':'entity_order.move\x20L33,L12'}]},ENTITY_PERMISSION={'object':'EntityPermission','moveStruct':'entity_permission.move\x20L32-35\x20EntityPermission','fields':[SYS('entity_permission.move\x20L32-35'),{'field':'table','disposition':{'kind':'edge','schema':'eoa.permission'},'evidence':'entity_permission.move\x20L34,L32\x20(role\x20bits)'}]},ENTITY_CONTACT={'object':'EntityContact','moveStruct':'entity_contact.move\x20L24-27\x20EntityContact','fields':[SYS('entity_contact.move\x20L24-27'),{'field':'table','disposition':{'kind':'edge','schema':'eoa.contact'},'evidence':'entity_contact.move\x20L26'}]},ENTITY={'object':'Entity','moveStruct':'registrar.move\x20L176-179\x20Entity\x20(0xaab)','fields':[SYS('registrar.move\x20L176-179'),{'field':'table','disposition':{'kind':'edge','schema':'entity.profile','coSchemas':['entity.referrer','entity.resource'],'note':'One\x20AddressInfo\x20row\x20per\x20account\x20backs\x20three\x20co-edges;\x20description/records\x20are\x20attributes'},'evidence':'registrar.move\x20L178,L146-152,L236-242'}]},REGISTRAR={'object':'Registrar','moveStruct':'registrar.move\x20L171-174\x20Registrar\x20(0xaaa)','fields':[SYS('registrar.move\x20L171-174'),{'field':'table','disposition':{'kind':'edge','schema':'target.vote','note':'Per-target\x20ring\x205200\x20of\x20like/dislike/favor\x20votes'},'evidence':'registrar.move\x20L173,L154-171'}]},OBJECT_LINKER_CORE={'object':'ObjectLinkerCore','moveStruct':'object_linker.move\x20L37-40\x20ObjectLinkerCore','fields':[SYS('object_linker.move\x20L37-40'),{'field':'table','disposition':{'kind':'edge','schema':'permission.core_binding','note':'Exact\x20(non-evicting)\x20linker\x20registry'},'evidence':'object_linker.move\x20L39,L88'}]},OBJECT_LINKER_TX={'object':'ObjectLinkerTx','moveStruct':'object_linker.move\x20L43-46\x20ObjectLinkerTx','fields':[SYS('object_linker.move\x20L43-46'),{'field':'table','disposition':{'kind':'edge','schema':'permission.tx_binding','coSchemas':['service.order'],'note':'FIFO\x205200\x20runtime\x20buffer;\x20service.order\x20is\x20the\x20Order-filtered\x20view\x20of\x20the\x20same\x20rows'},'evidence':'object_linker.move\x20L45,L136-140'}]},EVENT_STREAMS={'object':'EventStreams','moveStruct':'append-only\x20event\x20streams\x20(channel\x20D;\x20no\x20struct\x20fields)','fields':[{'field':PackageAddress+'::order::NewOrderEvent','disposition':{'kind':'edge','schema':'service.order_history','coSchemas':['eoa.order_history']},'evidence':'order.move\x20L51-58,L142','oq':'OQ-2/OQ-4'},{'field':PackageAddress+'::arb::ArbEvent','disposition':{'kind':'edge','schema':'arb.history'},'evidence':'arb.move\x20L33-43,L122,L227','oq':'OQ-4'}]};export const FIELD_MANIFEST=[SERVICE,ORDER,DISCOUNT,PROGRESS,MACHINE,ALLOCATION,ARBITRATION,ARB,DEMAND,REWARD,REPOSITORY,CONTACT,PERMISSION,GUARD,PASSPORT,PROOF,TREASURY,PAYMENT,COIN_WRAPPER,RESOURCE,ENTITY_ORDERS,ENTITY_PERMISSION,ENTITY_CONTACT,ENTITY,REGISTRAR,OBJECT_LINKER_CORE,OBJECT_LINKER_TX,EVENT_STREAMS];export const MANIFEST_BY_OBJECT=new Map(FIELD_MANIFEST['map'](a=>[a['object'],a]));export const BUSINESS_OBJECTS=['Service','Order','Discount','Progress','Machine','Allocation','Arbitration','Arb','Demand','Reward','Repository','Contact','Permission','Guard','Passport','Proof','Treasury','Payment'];
|
|
1
|
+
import{PackageAddress}from'@wowok/wowok';const SYS=a=>({'field':'id','disposition':{'kind':'nonAddress','note':'Object\x20identity\x20(UID);\x20system-managed,\x20never\x20a\x20business\x20reference'},'evidence':a}),SERVICE={'object':'Service','moveStruct':'service.move\x20L174-193\x20Service<T>','fields':[SYS('service.move\x20L174-193'),{'field':'description','disposition':{'kind':'attribute','note':'Shop\x20self-description;\x20node\x20property'},'evidence':'service.move\x20L174-193'},{'field':'location','disposition':{'kind':'attribute','note':'Service\x20area\x20/\x20market-opportunity\x20routing\x20key'},'evidence':'service.move\x20L174-193'},{'field':'sales','disposition':{'kind':'attribute','note':'Catalog\x20items\x20for\x20sale\x20(what\x20the\x20shop\x20sells)'},'evidence':'service.move\x20L174-193'},{'field':'repositories','disposition':{'kind':'edge','schema':'service.repository'},'evidence':'service.move\x20L174-193\x20(<=100)'},{'field':'buy_guard','disposition':{'kind':'edge','schema':'service.buy_guard'},'evidence':'service.move\x20L174-193'},{'field':'machine','disposition':{'kind':'edge','schema':'service.machine'},'evidence':'service.move\x20L174-193'},{'field':'bPublished','disposition':{'kind':'attribute','note':'Publish\x20flag;\x20freezes\x20machine/guard\x20settings;\x20analyzer\x20input'},'evidence':'service.move\x20L174-193'},{'field':'bPaused','disposition':{'kind':'attribute','note':'Pause\x20flag;\x20purchasability;\x20analyzer\x20input'},'evidence':'service.move\x20L174-193'},{'field':'customer_required','disposition':{'kind':'attribute','note':'Custom\x20info\x20fields\x20the\x20shop\x20requires\x20from\x20buyers'},'evidence':'service.move\x20L174-193'},{'field':'arbitrations','disposition':{'kind':'edge','schema':'service.arbitration'},'evidence':'service.move\x20L174-193\x20(<=20)'},{'field':'compensation_fund','disposition':{'kind':'attribute','note':'Escrowed\x20compensation\x20balance\x20(arbitration\x20solvency\x20signal)'},'evidence':'service.move\x20L174-193'},{'field':'paused_time','disposition':{'kind':'attribute','note':'When\x20the\x20shop\x20was\x20paused\x20(timestamp-ms)'},'evidence':'service.move\x20L174-193'},{'field':'setting_lock_duration','disposition':{'kind':'attribute','note':'Lock\x20duration\x20gating\x20post-pause\x20setting\x20changes'},'evidence':'service.move\x20L174-193'},{'field':'order_allocators','disposition':{'kind':'edge','schema':'service.order_allocator_guard','note':'Allocators\x20container;\x20guard\x20members\x20are\x20the\x20edge,\x20sharing\x20amounts\x20ride\x20the\x20payload'},'evidence':'service.move\x20L174-193;\x20allocation.move\x20L194-200'},{'field':'rewards','disposition':{'kind':'edge','schema':'service.reward'},'evidence':'service.move\x20L174-193\x20(<=20)'},{'field':'um','disposition':{'kind':'edge','schema':'service.um'},'evidence':'service.move\x20L174-193'},{'field':'permission','disposition':{'kind':'edge','schema':'service.permission'},'evidence':'service.move\x20L174-193'}]},ORDER={'object':'Order','moveStruct':'order.move\x20L59-74\x20Order','fields':[SYS('order.move\x20L59-74'),{'field':'items','disposition':{'kind':'attribute','note':'Purchased\x20line\x20items\x20(what\x20was\x20bought)'},'evidence':'order.move\x20L59-74'},{'field':'discount','disposition':{'kind':'edge','schema':'order.discount'},'evidence':'order.move\x20L59-74'},{'field':'progress','disposition':{'kind':'edge','schema':'order.progress'},'evidence':'order.move\x20L59-74,L130'},{'field':'machine','disposition':{'kind':'edge','schema':'order.machine'},'evidence':'order.move\x20L59-74,L130'},{'field':'amount','disposition':{'kind':'attribute','note':'Total\x20paid\x20(order\x20value\x20signal)'},'evidence':'order.move\x20L59-74'},{'field':'owner','disposition':{'kind':'edge','schema':'order.builder','note':'SDK\x20normalizes\x20owner\x20to\x20builder'},'evidence':'order.move\x20L59-74\x20(owner)'},{'field':'service','disposition':{'kind':'edge','schema':'order.service'},'evidence':'order.move\x20L59-74'},{'field':'dispute','disposition':{'kind':'edge','schema':'order.dispute'},'evidence':'order.move\x20L59-74'},{'field':'agent','disposition':{'kind':'edge','schema':'order.agent'},'evidence':'order.move\x20L59-74,L179\x20(<=10)'},{'field':'allocation','disposition':{'kind':'edge','schema':'order.allocation'},'evidence':'order.move\x20L59-74,L130'},{'field':'claimed_by','disposition':{'kind':'edge','schema':'order.claimed_by'},'evidence':'order.move\x20L59-74,L86-96'},{'field':'required_info','disposition':{'kind':'edge','schema':'order.required_info'},'evidence':'order.move\x20L73,L77-80','oq':'merchant\x20IM\x20address\x20(Service\x27s\x20Contact)\x20or\x20WTS\x20proof\x20(b11/b12)'},{'field':'time','disposition':{'kind':'attribute','note':'Creation\x20time\x20(timestamp-ms)'},'evidence':'order.move\x20L59-74'}]},DISCOUNT={'object':'Discount','moveStruct':'service.move\x20L109-119\x20Discount','fields':[SYS('service.move\x20L109-119'),{'field':'name','disposition':{'kind':'attribute','note':'Discount\x20campaign\x20name'},'evidence':'service.move\x20L109-119'},{'field':'discount_type','disposition':{'kind':'attribute','note':'RATIO\x20(off%)\x20or\x20MINUS\x20(-N)\x20pricing\x20mode'},'evidence':'service.move\x20L109-119'},{'field':'benchmark','disposition':{'kind':'attribute','note':'Minimum-spend\x20condition\x20for\x20the\x20discount'},'evidence':'service.move\x20L109-119'},{'field':'off','disposition':{'kind':'attribute','note':'Discount\x20magnitude\x20(rate\x20or\x20fixed\x20amount)'},'evidence':'service.move\x20L109-119'},{'field':'time_start','disposition':{'kind':'attribute','note':'Validity\x20window\x20start\x20(timestamp-ms)'},'evidence':'service.move\x20L109-119'},{'field':'time_end','disposition':{'kind':'attribute','note':'Validity\x20window\x20end\x20/\x20expiry'},'evidence':'service.move\x20L109-119'},{'field':'service','disposition':{'kind':'edge','schema':'discount.service'},'evidence':'service.move\x20L117','oq':'OQ-3\x20(Discount\x20joins\x20COVERED\x20types)'},{'field':'transferable','disposition':{'kind':'attribute','note':'Whether\x20the\x20discount\x20may\x20be\x20handed\x20to\x20a\x20receiver'},'evidence':'service.move\x20L109-119'}]},PROGRESS={'object':'Progress','moveStruct':'progress.move\x20L75-85\x20Progress','fields':[SYS('progress.move\x20L75-85'),{'field':'machine','disposition':{'kind':'edge','schema':'progress.machine'},'evidence':'progress.move\x20L75-85'},{'field':'context_repositories','disposition':{'kind':'edge','schema':'progress.context_repository'},'evidence':'progress.move\x20L78,L199-208'},{'field':'current','disposition':{'kind':'attribute','note':'Current\x20node\x20name\x20(completion\x20determination\x20input)'},'evidence':'progress.move\x20L75-85'},{'field':'task','disposition':{'kind':'edge','schema':'progress.task'},'evidence':'progress.move\x20L80'},{'field':'namedOperator','disposition':{'kind':'edge','schema':'progress.named_operator','note':'Container\x20struct;\x20operators[]\x20members\x20are\x20the\x20edge'},'evidence':'progress.move\x20L81\x20(<=80)'},{'field':'session','disposition':{'kind':'attribute','note':'Per-node\x20session\x20records\x20(runtime\x20state)'},'evidence':'progress.move\x20L82'},{'field':'history','disposition':{'kind':'attribute','note':'Node-history\x20ParentTableVec\x20(runtime\x20audit\x20trail,\x20not\x20enumerated\x20as\x20edges)'},'evidence':'progress.move\x20L83'},{'field':'current_time','disposition':{'kind':'attribute','note':'Last\x20activity\x20clock\x20(staleness\x20signal)'},'evidence':'progress.move\x20L84'}]},MACHINE={'object':'Machine','moveStruct':'machine.move\x20L298-307\x20Machine','fields':[SYS('machine.move\x20L298-307'),{'field':'description','disposition':{'kind':'attribute','note':'Workflow\x20description'},'evidence':'machine.move\x20L298-307'},{'field':'nodes','disposition':{'kind':'edge','schema':'machine.node','coSchemas':['wf.transition','wf.forward_guard'],'note':'ParentLinkedTable\x20walk\x20yields\x20node\x20rows;\x20transitions\x20and\x20forward\x20guards\x20derive\x20from\x20the\x20same\x20rows'},'evidence':'machine.move\x20L301'},{'field':'consensus_repositories','disposition':{'kind':'edge','schema':'machine.consensus_repository'},'evidence':'machine.move\x20L302'},{'field':'bPaused','disposition':{'kind':'attribute','note':'Workflow\x20pause\x20flag'},'evidence':'machine.move\x20L298-307'},{'field':'bPublished','disposition':{'kind':'attribute','note':'Publish\x20flag;\x20freezes\x20the\x20node\x20table'},'evidence':'machine.move\x20L298-307'},{'field':'um','disposition':{'kind':'edge','schema':'machine.um'},'evidence':'machine.move\x20L305'},{'field':'permission','disposition':{'kind':'edge','schema':'machine.permission'},'evidence':'machine.move\x20L306'}]},ALLOCATION={'object':'Allocation','moveStruct':'allocation.move\x20L196-202\x20Allocation<T>','fields':[SYS('allocation.move\x20L196-202'),{'field':'balance','disposition':{'kind':'attribute','note':'Remaining\x20pool\x20balance\x20(solvency\x20signal)'},'evidence':'allocation.move\x20L196-202'},{'field':'allocators','disposition':{'kind':'edge','schema':'allocation.guard','note':'Allocator\x20segments;\x20guard\x20members\x20are\x20the\x20edge,\x20sharing\x20amounts\x20ride\x20the\x20payload'},'evidence':'allocation.move\x20L199,L194-200'},{'field':'payment_info','disposition':{'kind':'edge','schema':'allocation.for_object','coSchemas':['allocation.for_guard'],'note':'PaymentInfo\x20captured\x20at\x20pool\x20create;\x20remark/index\x20are\x20attributes'},'evidence':'allocation.move\x20L200;\x20payment.move\x20L66-71'},{'field':'payment','disposition':{'kind':'edge','schema':'allocation.payment'},'evidence':'allocation.move\x20L201,L307-316'}]},ARBITRATION={'object':'Arbitration','moveStruct':'arbitration.move\x20L47-58\x20Arbitration<T>','fields':[SYS('arbitration.move\x20L47-58'),{'field':'description','disposition':{'kind':'attribute','note':'Arbitration\x20service\x20self-description'},'evidence':'arbitration.move\x20L47-58'},{'field':'location','disposition':{'kind':'attribute','note':'Jurisdiction\x20/\x20service\x20area'},'evidence':'arbitration.move\x20L47-58'},{'field':'voting_guard','disposition':{'kind':'edge','schema':'arbitration.voting_guard','note':'Empty\x20vector\x20=\x20open\x20voting;\x20members\x20carry\x20vote\x20weight'},'evidence':'arbitration.move\x20L51'},{'field':'usage_guard','disposition':{'kind':'edge','schema':'arbitration.usage_guard'},'evidence':'arbitration.move\x20L52'},{'field':'fee','disposition':{'kind':'attribute','note':'Case\x20filing\x20fee'},'evidence':'arbitration.move\x20L53'},{'field':'balance','disposition':{'kind':'attribute','note':'Service\x20balance\x20(solvency\x20signal)'},'evidence':'arbitration.move\x20L54'},{'field':'bPaused','disposition':{'kind':'attribute','note':'Service\x20pause\x20flag'},'evidence':'arbitration.move\x20L55'},{'field':'um','disposition':{'kind':'edge','schema':'arbitration.um'},'evidence':'arbitration.move\x20L56'},{'field':'permission','disposition':{'kind':'edge','schema':'arbitration.permission'},'evidence':'arbitration.move\x20L57'}]},ARB={'object':'Arb','moveStruct':'arb.move\x20L95-110\x20Arb<T>','fields':[SYS('arb.move\x20L95-110'),{'field':'description','disposition':{'kind':'attribute','note':'Case\x20description'},'evidence':'arb.move\x20L95-110'},{'field':'order','disposition':{'kind':'edge','schema':'arb.order'},'evidence':'arb.move\x20L98'},{'field':'arbitration','disposition':{'kind':'edge','schema':'arb.arbitration_service'},'evidence':'arb.move\x20L99'},{'field':'voted','disposition':{'kind':'edge','schema':'arb.voter','note':'Voter\x20members\x20are\x20the\x20edge;\x20weights/agrees\x20ride\x20the\x20payload'},'evidence':'arb.move\x20L100\x20(<=520)'},{'field':'proposition','disposition':{'kind':'attribute','note':'Propositions\x20and\x20votes\x20(state-machine\x20input)'},'evidence':'arb.move\x20L101'},{'field':'fee','disposition':{'kind':'attribute','note':'Escrowed\x20case\x20fee'},'evidence':'arb.move\x20L102'},{'field':'feedback','disposition':{'kind':'attribute','note':'Ruling\x20feedback\x20text'},'evidence':'arb.move\x20L103'},{'field':'indemnity','disposition':{'kind':'attribute','note':'Ruled\x20indemnity\x20(compensation\x20outcome)'},'evidence':'arb.move\x20L104'},{'field':'voting_deadline','disposition':{'kind':'attribute','note':'Voting\x20deadline\x20(timestamp-ms)'},'evidence':'arb.move\x20L105'},{'field':'objection','disposition':{'kind':'attribute','note':'Objection\x20record'},'evidence':'arb.move\x20L106'},{'field':'status','disposition':{'kind':'attribute','note':'Case\x20state-machine\x20stage\x20(analyzer\x20input)'},'evidence':'arb.move\x20L107'},{'field':'compensation_time','disposition':{'kind':'attribute','note':'When\x20compensation\x20executed\x20(timestamp-ms)'},'evidence':'arb.move\x20L108'},{'field':'time','disposition':{'kind':'attribute','note':'Case\x20creation\x20time\x20(timestamp-ms)'},'evidence':'arb.move\x20L109'}]},DEMAND={'object':'Demand','moveStruct':'demand.move\x20L67-76\x20Demand','fields':[SYS('demand.move\x20L67-76'),{'field':'description','disposition':{'kind':'attribute','note':'What\x20the\x20demanding\x20side\x20asks\x20for'},'evidence':'demand.move\x20L67-76'},{'field':'location','disposition':{'kind':'attribute','note':'Demand\x20area'},'evidence':'demand.move\x20L67-76'},{'field':'rewards','disposition':{'kind':'edge','schema':'demand.reward'},'evidence':'demand.move\x20L71'},{'field':'guards','disposition':{'kind':'edge','schema':'demand.guard','note':'Empty\x20=\x20bare\x20present\x20(no\x20acceptance\x20gate)'},'evidence':'demand.move\x20L72'},{'field':'presenters','disposition':{'kind':'edge','schema':'demand.presenter','coSchemas':['demand.presenter_service'],'note':'One\x20ParentTable\x20read\x20backs\x20both\x20the\x20presenter\x20edge\x20and\x20the\x20same-row\x20sub-service\x20co-edge'},'evidence':'demand.move\x20L73,L46-54'},{'field':'um','disposition':{'kind':'edge','schema':'demand.um'},'evidence':'demand.move\x20L74'},{'field':'permission','disposition':{'kind':'edge','schema':'demand.permission'},'evidence':'demand.move\x20L75'}]},REWARD={'object':'Reward','moveStruct':'reward.move\x20L129-138\x20Reward<T>','fields':[SYS('reward.move\x20L129-138'),{'field':'description','disposition':{'kind':'attribute','note':'Pool\x20purpose\x20description'},'evidence':'reward.move\x20L129-138'},{'field':'guards','disposition':{'kind':'edge','schema':'reward.guard','note':'Members\x20carry\x20recipient/amount/expiration\x20semantics\x20in\x20the\x20payload'},'evidence':'reward.move\x20L132'},{'field':'balance','disposition':{'kind':'attribute','note':'Remaining\x20pool\x20balance\x20(solvency\x20signal)'},'evidence':'reward.move\x20L133'},{'field':'guard_not_added_expiration_time','disposition':{'kind':'attribute','note':'Claim-window\x20expiry\x20when\x20guards\x20were\x20never\x20added'},'evidence':'reward.move\x20L134'},{'field':'record','disposition':{'kind':'edge','schema':'reward.claim'},'evidence':'reward.move\x20L135,L117-138'},{'field':'um','disposition':{'kind':'edge','schema':'reward.um'},'evidence':'reward.move\x20L136'},{'field':'permission','disposition':{'kind':'edge','schema':'reward.permission'},'evidence':'reward.move\x20L137'}]},REPOSITORY={'object':'Repository','moveStruct':'repository.move\x20L461-469\x20Repository','fields':[SYS('repository.move\x20L461-469'),{'field':'description','disposition':{'kind':'attribute','note':'Repository\x20description'},'evidence':'repository.move\x20L461-469'},{'field':'policies','disposition':{'kind':'edge','schema':'repository.policy_guard','coSchemas':['repository.quote_guard'],'note':'PolicyRule\x20vector;\x20write_guard[].guard\x20members\x20and\x20quote_guard\x20are\x20two\x20deep\x20edges;\x20policy\x20name\x20is\x20an\x20attribute'},'evidence':'repository.move\x20L464,L106-113'},{'field':'data','disposition':{'kind':'edge','schema':'repository.data_about','note':'DataKey.id\x20carries\x20the\x20about-object;\x20row\x20key\x20name\x20rides\x20the\x20payload'},'evidence':'repository.move\x20L465,L456-459'},{'field':'rewards','disposition':{'kind':'edge','schema':'repository.reward'},'evidence':'repository.move\x20L466'},{'field':'um','disposition':{'kind':'edge','schema':'repository.um'},'evidence':'repository.move\x20L467'},{'field':'permission','disposition':{'kind':'edge','schema':'repository.permission'},'evidence':'repository.move\x20L468'}]},CONTACT={'object':'Contact','moveStruct':'contact.move\x20L25-31\x20Contact','fields':[SYS('contact.move\x20L25-31'),{'field':'description','disposition':{'kind':'attribute','note':'Roster\x20description'},'evidence':'contact.move\x20L25-31'},{'field':'location','disposition':{'kind':'attribute','note':'Roster\x20area'},'evidence':'contact.move\x20L25-31'},{'field':'ims','disposition':{'kind':'edge','schema':'contact.im','note':'Im.at\x20members\x20are\x20the\x20edge;\x20status/join_time/description\x20ride\x20the\x20payload'},'evidence':'contact.move\x20L29,L18-23,L85-105','oq':'OQ-1\x20(at\x20verified\x20EOA)'},{'field':'permission','disposition':{'kind':'edge','schema':'contact.permission'},'evidence':'contact.move\x20L30'}]},PERMISSION={'object':'Permission','moveStruct':'permission.move\x20L33-41\x20Permission','fields':[SYS('permission.move\x20L33-41'),{'field':'owner','disposition':{'kind':'edge','schema':'permission.owner'},'evidence':'permission.move\x20L35,L537-543'},{'field':'admin','disposition':{'kind':'edge','schema':'permission.admin'},'evidence':'permission.move\x20L36'},{'field':'description','disposition':{'kind':'attribute','note':'Group\x20description'},'evidence':'permission.move\x20L37'},{'field':'remark','disposition':{'kind':'attribute','note':'Permission\x20remark\x20records'},'evidence':'permission.move\x20L38'},{'field':'table','disposition':{'kind':'edge','schema':'permission.entity','note':'ParentLinkedTable\x20of\x20EOA/Guard\x20members\x20with\x20perm-index\x20bits'},'evidence':'permission.move\x20L39'},{'field':'um','disposition':{'kind':'edge','schema':'permission.um'},'evidence':'permission.move\x20L40'}]},GUARD={'object':'Guard','moveStruct':'guard.move\x20L84-94\x20Guard','fields':[SYS('guard.move\x20L84-94'),{'field':'description','disposition':{'kind':'attribute','note':'Gate\x20description'},'evidence':'guard.move\x20L84-94'},{'field':'table','disposition':{'kind':'attribute','note':'Submission\x20slot\x20definitions\x20(identifier\x20->\x20type\x20mapping;\x20Gate\x20analysis\x20property)'},'evidence':'guard.move\x20L87'},{'field':'validated','disposition':{'kind':'attribute','note':'Validated\x20slot\x20types\x20(Gate\x20analysis\x20property)'},'evidence':'guard.move\x20L88'},{'field':'input','disposition':{'kind':'attribute','note':'Static\x20input\x20bytes\x20for\x20the\x20gate\x20predicate'},'evidence':'guard.move\x20L89'},{'field':'relies','disposition':{'kind':'edge','schema':'guard.relies'},'evidence':'guard.move\x20L90\x20(<=4,\x20one\x20level)'},{'field':'relies_logic_and','disposition':{'kind':'attribute','note':'AND/OR\x20combination\x20of\x20relied\x20gates'},'evidence':'guard.move\x20L91'},{'field':'immutable','disposition':{'kind':'attribute','note':'Whether\x20the\x20gate\x20definition\x20is\x20frozen'},'evidence':'guard.move\x20L92'},{'field':'rep','disposition':{'kind':'attribute','note':'Last\x20query-validation\x20outcome\x20flag'},'evidence':'guard.move\x20L93'}]},PASSPORT={'object':'Passport','moveStruct':'passport.move\x20L41-50\x20Passport','fields':[SYS('passport.move\x20L41-50'),{'field':'guard','disposition':{'kind':'edge','schema':'passport.guard','coSchemas':['passport.ticket_relies'],'note':'GuardInfo\x20tickets;\x20ticket.guard\x20is\x20the\x20primary\x20edge,\x20ticket.relies\x20the\x20same-ticket\x20co-edge;\x20result/impack\x20flags\x20are\x20attributes'},'evidence':'passport.move\x20L43,L32-39'},{'field':'result','disposition':{'kind':'attribute','note':'Overall\x20verification\x20outcome'},'evidence':'passport.move\x20L44'},{'field':'tx_hash','disposition':{'kind':'attribute','note':'Verification\x20transaction\x20digest'},'evidence':'passport.move\x20L45'},{'field':'impack','disposition':{'kind':'edge','schema':'passport.impack'},'evidence':'passport.move\x20L46,L227-242'},{'field':'time','disposition':{'kind':'attribute','note':'Verification\x20time\x20(timestamp-ms)'},'evidence':'passport.move\x20L47'},{'field':'signer','disposition':{'kind':'edge','schema':'passport.signer'},'evidence':'passport.move\x20L48,L94-98'},{'field':'has_verified','disposition':{'kind':'attribute','note':'Whether\x20the\x20credential\x20was\x20consumed'},'evidence':'passport.move\x20L49'}]},PROOF={'object':'Proof','moveStruct':'proof.move\x20L13-24\x20Proof','fields':[SYS('proof.move\x20L13-24'),{'field':'description','disposition':{'kind':'attribute','note':'Evidence\x20description'},'evidence':'proof.move\x20L13-24'},{'field':'proof','disposition':{'kind':'attribute','note':'Evidence\x20payload\x20string'},'evidence':'proof.move\x20L13-24'},{'field':'item_count','disposition':{'kind':'attribute','note':'Item\x20count\x20covered\x20by\x20the\x20evidence'},'evidence':'proof.move\x20L13-24'},{'field':'server_pubkey','disposition':{'kind':'attribute','note':'Witness\x20server\x20public\x20key'},'evidence':'proof.move\x20L13-24'},{'field':'server_signature','disposition':{'kind':'attribute','note':'Witness\x20server\x20signature'},'evidence':'proof.move\x20L13-24'},{'field':'about','disposition':{'kind':'edge','schema':'proof.about'},'evidence':'proof.move\x20L20'},{'field':'signer','disposition':{'kind':'edge','schema':'proof.signer'},'evidence':'proof.move\x20L21'},{'field':'proof_type','disposition':{'kind':'attribute','note':'Evidence\x20kind\x20discriminator'},'evidence':'proof.move\x20L22'},{'field':'time','disposition':{'kind':'attribute','note':'Signing\x20time\x20(timestamp-ms)'},'evidence':'proof.move\x20L23'}]},TREASURY={'object':'Treasury','moveStruct':'treasury.move\x20L72-83\x20Treasury<T>','fields':[SYS('treasury.move\x20L72-83'),{'field':'description','disposition':{'kind':'attribute','note':'Treasury\x20description'},'evidence':'treasury.move\x20L72-83'},{'field':'balance','disposition':{'kind':'attribute','note':'Current\x20balance\x20(solvency\x20signal)'},'evidence':'treasury.move\x20L75'},{'field':'history','disposition':{'kind':'edge','schema':'treasury.record'},'evidence':'treasury.move\x20L76,L39-46'},{'field':'external_deposit_guard','disposition':{'kind':'edge','schema':'treasury.deposit_guard'},'evidence':'treasury.move\x20L77,L61-65,L138-194'},{'field':'external_withdraw_guard','disposition':{'kind':'edge','schema':'treasury.withdraw_guard'},'evidence':'treasury.move\x20L78,L67-71,L197-250'},{'field':'inflow','disposition':{'kind':'attribute','note':'Lifetime\x20inflow\x20(throughput\x20signal)'},'evidence':'treasury.move\x20L79'},{'field':'outflow','disposition':{'kind':'attribute','note':'Lifetime\x20outflow\x20(throughput\x20signal)'},'evidence':'treasury.move\x20L80'},{'field':'um','disposition':{'kind':'edge','schema':'treasury.um'},'evidence':'treasury.move\x20L81'},{'field':'permission','disposition':{'kind':'edge','schema':'treasury.permission'},'evidence':'treasury.move\x20L82'}]},PAYMENT={'object':'Payment','moveStruct':'payment.move\x20L93-101\x20Payment<T>','fields':[SYS('payment.move\x20L93-101'),{'field':'amount','disposition':{'kind':'attribute','note':'Total\x20payment\x20amount'},'evidence':'payment.move\x20L93-101'},{'field':'time','disposition':{'kind':'attribute','note':'Payment\x20time\x20(timestamp-ms)'},'evidence':'payment.move\x20L93-101'},{'field':'info','disposition':{'kind':'edge','schema':'payment.for_object','coSchemas':['payment.for_guard'],'note':'PaymentInfo\x20struct;\x20for_object/for_guard\x20are\x20the\x20two\x20routing\x20edges;\x20remark/index\x20are\x20attributes'},'evidence':'payment.move\x20L97,L66-71'},{'field':'from_object','disposition':{'kind':'edge','schema':'payment.from_object'},'evidence':'payment.move\x20L98,L149-161'},{'field':'signer','disposition':{'kind':'edge','schema':'payment.signer'},'evidence':'payment.move\x20L99,L111'},{'field':'record','disposition':{'kind':'edge','schema':'payment.recipient','note':'Revenue\x20entries;\x20recipient\x20members\x20are\x20the\x20edge,\x20amounts\x20ride\x20the\x20payload'},'evidence':'payment.move\x20L100,L93-101\x20(<=200)'}]},COIN_WRAPPER={'object':'CoinWrapper','moveStruct':'payment.move\x20L40-44\x20CoinWrapper<T>','fields':[SYS('payment.move\x20L40-44'),{'field':'balance','disposition':{'kind':'transient','note':'Escrowed\x20coin\x20inside\x20the\x20in-flight\x20wrapper;\x20consumed\x20by\x20unwrap'},'evidence':'payment.move\x20L42'},{'field':'payment','disposition':{'kind':'transient','note':'Back-reference\x20to\x20the\x20Payment\x20under\x20construction;\x20process\x20object,\x20deliberately\x20not\x20a\x20graph\x20edge'},'evidence':'payment.move\x20L43,L46-53'}]},RESOURCE={'object':'Resource','moveStruct':'resource.move\x20L18-21\x20Resource','fields':[SYS('resource.move\x20L18-21'),{'field':'table','disposition':{'kind':'nonAddress','note':'AddressTag\x20rows\x20(user\x20tags/nick);\x20projected\x20as\x20node\x20attributes\x20for\x20display,\x20deliberately\x20no\x20structural\x20edge'},'evidence':'resource.move\x20L20'}]},ENTITY_ORDERS={'object':'EntityOrders','moveStruct':'entity_order.move\x20L31-34\x20EntityOrders','fields':[SYS('entity_order.move\x20L31-34'),{'field':'table','disposition':{'kind':'edge','schema':'eoa.order','note':'Per-entity\x20FIFO\x205200\x20order-membership\x20rows\x20(role\x20bits\x20in\x20payload)'},'evidence':'entity_order.move\x20L33,L12'}]},ENTITY_PERMISSION={'object':'EntityPermission','moveStruct':'entity_permission.move\x20L32-35\x20EntityPermission','fields':[SYS('entity_permission.move\x20L32-35'),{'field':'table','disposition':{'kind':'edge','schema':'eoa.permission'},'evidence':'entity_permission.move\x20L34,L32\x20(role\x20bits)'}]},ENTITY_CONTACT={'object':'EntityContact','moveStruct':'entity_contact.move\x20L24-27\x20EntityContact','fields':[SYS('entity_contact.move\x20L24-27'),{'field':'table','disposition':{'kind':'edge','schema':'eoa.contact'},'evidence':'entity_contact.move\x20L26'}]},ENTITY={'object':'Entity','moveStruct':'registrar.move\x20L176-179\x20Entity\x20(0xaab)','fields':[SYS('registrar.move\x20L176-179'),{'field':'table','disposition':{'kind':'edge','schema':'entity.profile','coSchemas':['entity.referrer','entity.resource'],'note':'One\x20AddressInfo\x20row\x20per\x20account\x20backs\x20three\x20co-edges;\x20description/records\x20are\x20attributes'},'evidence':'registrar.move\x20L178,L146-152,L236-242'}]},REGISTRAR={'object':'Registrar','moveStruct':'registrar.move\x20L171-174\x20Registrar\x20(0xaaa)','fields':[SYS('registrar.move\x20L171-174'),{'field':'table','disposition':{'kind':'edge','schema':'target.vote','note':'Per-target\x20ring\x205200\x20of\x20like/dislike/favor\x20votes'},'evidence':'registrar.move\x20L173,L154-171'}]},OBJECT_LINKER_CORE={'object':'ObjectLinkerCore','moveStruct':'object_linker.move\x20L37-40\x20ObjectLinkerCore','fields':[SYS('object_linker.move\x20L37-40'),{'field':'table','disposition':{'kind':'edge','schema':'permission.core_binding','note':'Exact\x20(non-evicting)\x20linker\x20registry'},'evidence':'object_linker.move\x20L39,L88'}]},OBJECT_LINKER_TX={'object':'ObjectLinkerTx','moveStruct':'object_linker.move\x20L43-46\x20ObjectLinkerTx','fields':[SYS('object_linker.move\x20L43-46'),{'field':'table','disposition':{'kind':'edge','schema':'permission.tx_binding','coSchemas':['service.order'],'note':'FIFO\x205200\x20runtime\x20buffer;\x20service.order\x20is\x20the\x20Order-filtered\x20view\x20of\x20the\x20same\x20rows'},'evidence':'object_linker.move\x20L45,L136-140'}]},EVENT_STREAMS={'object':'EventStreams','moveStruct':'append-only\x20event\x20streams\x20(channel\x20D;\x20no\x20struct\x20fields)','fields':[{'field':PackageAddress+'::order::NewOrderEvent','disposition':{'kind':'edge','schema':'service.order_history','coSchemas':['eoa.order_history']},'evidence':'order.move\x20L51-58,L142','oq':'OQ-2/OQ-4'},{'field':PackageAddress+'::arb::ArbEvent','disposition':{'kind':'edge','schema':'arb.history'},'evidence':'arb.move\x20L33-43,L122,L227','oq':'OQ-4'}]};export const FIELD_MANIFEST=[SERVICE,ORDER,DISCOUNT,PROGRESS,MACHINE,ALLOCATION,ARBITRATION,ARB,DEMAND,REWARD,REPOSITORY,CONTACT,PERMISSION,GUARD,PASSPORT,PROOF,TREASURY,PAYMENT,COIN_WRAPPER,RESOURCE,ENTITY_ORDERS,ENTITY_PERMISSION,ENTITY_CONTACT,ENTITY,REGISTRAR,OBJECT_LINKER_CORE,OBJECT_LINKER_TX,EVENT_STREAMS];export const MANIFEST_BY_OBJECT=new Map(FIELD_MANIFEST['map'](a=>[a['object'],a]));export const BUSINESS_OBJECTS=['Service','Order','Discount','Progress','Machine','Allocation','Arbitration','Arb','Demand','Reward','Repository','Contact','Permission','Guard','Passport','Proof','Treasury','Payment'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{rootOf}from'./extract.js';const MAX_MANAGED_TOTAL=0x3c,MAX_ORDERS=0x28,MAX_DEMANDS=0x14,MAX_ALLOCATIONS=0x28,MAX_CONTACTS=0x14,MAX_MACHINES=0xa,MAX_ARB_SERVICES=0xf;function fld(a,b){if(!a?.['raw'])return undefined;const c=rootOf(a['raw']);return c[b];}function addrList(a,b){const c=fld(a,b);return(Array['isArray'](c)?c:[])['filter'](d=>typeof d==='string');}function outEdges(a,b,c){return(a['out']['get'](b['toLowerCase']())??[])['filter'](d=>d['schema']===c);}function rawOf(a,b){return b?a['nodes']['get'](b['toLowerCase']()):undefined;}function managedTargets(a,b){const c=new Set();for(const d of[...outEdges(a,b,'permission.core_binding'),...outEdges(a,b,'permission.tx_binding')]){c['add'](d['to']);}return[...c]['map'](f=>a['nodes']['get'](f))['filter'](f=>!!f&&f['kind']==='object');}function mapMode(a){if(a===0x1||a==='Rate')return'Rate';if(a===0x2||a==='Surplus')return'Surplus';return'Amount';}export function projectRelationshipFacts(b,c){const f=c['toLowerCase'](),g=outEdges(b,f,'eoa.permission'),h=[],i=new Map();for(const C of g){const D=b['nodes']['get'](C['to']);if(!D)continue;const E=outEdges(b,D['id'],'permission.entity')['map'](H=>({'address':H['to'],'perm_indices':H['payload']?.['permIndices']??[]})),F=managedTargets(b,D['id']),G=F['filter'](H=>!!H['objectType'])['map'](H=>({'object_type':H['objectType'],'address':H['id']}));for(const H of G){if(i['size']>=MAX_MANAGED_TOTAL)break;i['set'](H['address']['toLowerCase'](),H);}h['push']({'address':D['id'],'owner':fld(D,'owner')??'','admins':addrList(D,'admin'),'entities':E,'anchor_role_bits':C['payload']?.['roleBits'],'managed_objects':G});}const j=I=>[...i['values']()]['filter'](J=>J['object_type']===I)['map'](J=>J['address']),k=j('Service'),l=j('Machine')['slice'](0x0,MAX_MACHINES),n=j('Demand')['slice'](0x0,MAX_DEMANDS),p=j('Contact')['slice'](0x0,MAX_CONTACTS),q=j('Arbitration'),r=new Map();for(const I of outEdges(b,f,'eoa.order'))r['set'](I['to'],'buyer');for(const J of k){for(const K of outEdges(b,J,'service.order'))r['set'](K['to'],'merchant');}const t=[],u={};for(const L of[...r['keys']()]['slice'](0x0,MAX_ORDERS)){const M=rawOf(b,L);if(!M||M['objectType']!=='Order')continue;const N=fld(M,'service')??'';t['push']({'address':M['id'],'owner':fld(M,'owner')??fld(M,'builder')??'','agents':addrList(M,'agent'),'service':N,'amount':fld(M,'amount'),'allocation':fld(M,'allocation'),'dispute_arbitrations':addrList(M,'dispute'),'claimed_by':fld(M,'claimed_by')??null});if(N){const O=rawOf(b,N),P=outEdges(b,N,'service.permission')[0x0]?.['to'],Q=rawOf(b,P),R=fld(Q,'owner');if(R)u[O?.['id']??N['toLowerCase']()]=R;}}const v=n['map'](S=>{const T=rawOf(b,S),U=outEdges(b,S,'demand.permission')[0x0]?.['to'],V=fld(rawOf(b,U),'owner')??'',W=outEdges(b,S,'demand.presenter')['map'](Y=>({'address':Y['to'],'service':typeof Y['payload']?.['service']==='string'?Y['payload']['service']:undefined,'acceptance_score':typeof Y['payload']?.['score']==='number'?Y['payload']['score']:undefined})),X=(fld(T,'guards')??[])['map'](Y=>typeof Y==='string'?Y:Y?.['guard'])['filter'](Y=>typeof Y==='string');return{'address':T['id'],'owner':V,'presenters':W,'rewards':addrList(T,'rewards'),'guards':X};}),w=[...new Set(t['map'](S=>S['allocation'])['filter'](S=>!!S))]['slice'](0x0,MAX_ALLOCATIONS),x=w['map'](S=>{const T=rawOf(b,S),U=fld(T,'allocators')??rootOf(T['raw']),V=Array['isArray'](U)?U:Array['isArray'](U?.['allocators'])?U['allocators']:[],W=V['flatMap'](X=>(Array['isArray'](X?.['sharing'])?X['sharing']:[])['map'](Y=>({'who':Y?.['who']??Y,'mode':mapMode(Y?.['mode']),'sharing':Y?.['sharing']!=null?String(Y['sharing']):undefined,'guard':typeof X?.['guard']==='string'?X['guard']:undefined})));return{'address':T['id'],'owner':fld(T,'owner'),'sharing':W};}),y=p['map'](S=>{const T=rawOf(b,S),U=outEdges(b,S,'contact.permission')[0x0]?.['to'],V=fld(rawOf(b,U),'owner')??'',W=(fld(T,'ims')??[])['map'](X=>typeof X==='string'?X:X?.['at'])['filter'](X=>typeof X==='string');return{'address':T['id'],'ims':W,'owner':V};}),z=l['map'](S=>{const T=rawOf(b,S),U=outEdges(b,S,'machine.permission')[0x0]?.['to'],V=S['toLowerCase']()+'::node::',W=b['edges']['filter'](X=>X['schema']==='wf.transition'&&X['from']['startsWith'](V))['map'](X=>({'node':X['payload']?.['prevNode']??'','next_node':X['payload']?.['node']??'','forward_name':X['payload']?.['forward']??'','named_operator':X['payload']?.['namedOperator']??null,'permission_index':X['payload']?.['permissionIndex']??null,'guard':X['payload']?.['guard']??null}));return{'address':T['id'],'permission_address':U,'forwards':W};}),A=new Map();for(const S of t){const T=r['get'](S['address']['toLowerCase']())??'buyer';for(const U of S['dispute_arbitrations']??[])A['set'](U['toLowerCase'](),T);}const B=[];for(const [V,W]of A){const X=rawOf(b,V);if(!X)continue;const Y=(fld(X,'voted')??[])['map'](Z=>({'address':typeof Z?.['voter']==='string'?Z['voter']:'','weight':typeof Z?.['weight']==='number'?Z['weight']:undefined}))['filter'](Z=>Z['address']['length']>0x0);B['push']({'address':X['id'],'object_kind':'case','voters':Y,'order':fld(X,'order'),'arbitration':fld(X,'arbitration'),'anchor_side':W,'bound_services':[]});}for(const Z of q['slice'](0x0,MAX_ARB_SERVICES)){if(A['has'](Z['toLowerCase']()))continue;B['push']({'address':Z,'object_kind':'service','voters':[],'bound_services':[]});}return{'anchor':f,'permissions':h,'machines':z,'orders':t,'demands':v,'allocations':x,'contacts':y,'arbitrations':B,'service_owners':u};}
|
|
1
|
+
import{rootOf}from'./extract.js';const MAX_MANAGED_TOTAL=0x3c,MAX_ORDERS=0x28,MAX_DEMANDS=0x14,MAX_ALLOCATIONS=0x28,MAX_CONTACTS=0x14,MAX_MACHINES=0xa,MAX_ARB_SERVICES=0xf;function fld(a,b){if(!a?.['raw'])return undefined;const c=rootOf(a['raw']);return c[b];}function addrList(a,b){const c=fld(a,b);return(Array['isArray'](c)?c:[])['filter'](d=>typeof d==='string');}function outEdges(a,b,c){return(a['out']['get'](b['toLowerCase']())??[])['filter'](d=>d['schema']===c);}function rawOf(a,b){return b?a['nodes']['get'](b['toLowerCase']()):undefined;}function managedTargets(a,b){const c=new Set();for(const d of[...outEdges(a,b,'permission.core_binding'),...outEdges(a,b,'permission.tx_binding')]){c['add'](d['to']);}return[...c]['map'](f=>a['nodes']['get'](f))['filter'](f=>!!f&&f['kind']==='object');}function mapMode(a){if(a===0x1||a==='Rate')return'Rate';if(a===0x2||a==='Surplus')return'Surplus';if(a===0x3||a==='RateGross')return'RateGross';return'Amount';}export function projectRelationshipFacts(b,c){const f=c['toLowerCase'](),g=outEdges(b,f,'eoa.permission'),h=[],i=new Map();for(const C of g){const D=b['nodes']['get'](C['to']);if(!D)continue;const E=outEdges(b,D['id'],'permission.entity')['map'](H=>({'address':H['to'],'perm_indices':H['payload']?.['permIndices']??[]})),F=managedTargets(b,D['id']),G=F['filter'](H=>!!H['objectType'])['map'](H=>({'object_type':H['objectType'],'address':H['id']}));for(const H of G){if(i['size']>=MAX_MANAGED_TOTAL)break;i['set'](H['address']['toLowerCase'](),H);}h['push']({'address':D['id'],'owner':fld(D,'owner')??'','admins':addrList(D,'admin'),'entities':E,'anchor_role_bits':C['payload']?.['roleBits'],'managed_objects':G});}const j=I=>[...i['values']()]['filter'](J=>J['object_type']===I)['map'](J=>J['address']),k=j('Service'),l=j('Machine')['slice'](0x0,MAX_MACHINES),n=j('Demand')['slice'](0x0,MAX_DEMANDS),p=j('Contact')['slice'](0x0,MAX_CONTACTS),q=j('Arbitration'),r=new Map();for(const I of outEdges(b,f,'eoa.order'))r['set'](I['to'],'buyer');for(const J of k){for(const K of outEdges(b,J,'service.order'))r['set'](K['to'],'merchant');}const t=[],u={};for(const L of[...r['keys']()]['slice'](0x0,MAX_ORDERS)){const M=rawOf(b,L);if(!M||M['objectType']!=='Order')continue;const N=fld(M,'service')??'';t['push']({'address':M['id'],'owner':fld(M,'owner')??fld(M,'builder')??'','agents':addrList(M,'agent'),'service':N,'amount':fld(M,'amount'),'allocation':fld(M,'allocation'),'dispute_arbitrations':addrList(M,'dispute'),'claimed_by':fld(M,'claimed_by')??null});if(N){const O=rawOf(b,N),P=outEdges(b,N,'service.permission')[0x0]?.['to'],Q=rawOf(b,P),R=fld(Q,'owner');if(R)u[O?.['id']??N['toLowerCase']()]=R;}}const v=n['map'](S=>{const T=rawOf(b,S),U=outEdges(b,S,'demand.permission')[0x0]?.['to'],V=fld(rawOf(b,U),'owner')??'',W=outEdges(b,S,'demand.presenter')['map'](Y=>({'address':Y['to'],'service':typeof Y['payload']?.['service']==='string'?Y['payload']['service']:undefined,'acceptance_score':typeof Y['payload']?.['score']==='number'?Y['payload']['score']:undefined})),X=(fld(T,'guards')??[])['map'](Y=>typeof Y==='string'?Y:Y?.['guard'])['filter'](Y=>typeof Y==='string');return{'address':T['id'],'owner':V,'presenters':W,'rewards':addrList(T,'rewards'),'guards':X};}),w=[...new Set(t['map'](S=>S['allocation'])['filter'](S=>!!S))]['slice'](0x0,MAX_ALLOCATIONS),x=w['map'](S=>{const T=rawOf(b,S),U=fld(T,'allocators')??rootOf(T['raw']),V=Array['isArray'](U)?U:Array['isArray'](U?.['allocators'])?U['allocators']:[],W=V['flatMap'](X=>(Array['isArray'](X?.['sharing'])?X['sharing']:[])['map'](Y=>({'who':Y?.['who']??Y,'mode':mapMode(Y?.['mode']),'sharing':Y?.['sharing']!=null?String(Y['sharing']):undefined,'guard':typeof X?.['guard']==='string'?X['guard']:undefined})));return{'address':T['id'],'owner':fld(T,'owner'),'sharing':W};}),y=p['map'](S=>{const T=rawOf(b,S),U=outEdges(b,S,'contact.permission')[0x0]?.['to'],V=fld(rawOf(b,U),'owner')??'',W=(fld(T,'ims')??[])['map'](X=>typeof X==='string'?X:X?.['at'])['filter'](X=>typeof X==='string');return{'address':T['id'],'ims':W,'owner':V};}),z=l['map'](S=>{const T=rawOf(b,S),U=outEdges(b,S,'machine.permission')[0x0]?.['to'],V=S['toLowerCase']()+'::node::',W=b['edges']['filter'](X=>X['schema']==='wf.transition'&&X['from']['startsWith'](V))['map'](X=>({'node':X['payload']?.['prevNode']??'','next_node':X['payload']?.['node']??'','forward_name':X['payload']?.['forward']??'','named_operator':X['payload']?.['namedOperator']??null,'permission_index':X['payload']?.['permissionIndex']??null,'guard':X['payload']?.['guard']??null}));return{'address':T['id'],'permission_address':U,'forwards':W};}),A=new Map();for(const S of t){const T=r['get'](S['address']['toLowerCase']())??'buyer';for(const U of S['dispute_arbitrations']??[])A['set'](U['toLowerCase'](),T);}const B=[];for(const [V,W]of A){const X=rawOf(b,V);if(!X)continue;const Y=(fld(X,'voted')??[])['map'](Z=>({'address':typeof Z?.['voter']==='string'?Z['voter']:'','weight':typeof Z?.['weight']==='number'?Z['weight']:undefined}))['filter'](Z=>Z['address']['length']>0x0);B['push']({'address':X['id'],'object_kind':'case','voters':Y,'order':fld(X,'order'),'arbitration':fld(X,'arbitration'),'anchor_side':W,'bound_services':[]});}for(const Z of q['slice'](0x0,MAX_ARB_SERVICES)){if(A['has'](Z['toLowerCase']()))continue;B['push']({'address':Z,'object_kind':'service','voters':[],'bound_services':[]});}return{'anchor':f,'permissions':h,'machines':z,'orders':t,'demands':v,'allocations':x,'contacts':y,'arbitrations':B,'service_owners':u};}
|
|
@@ -15,6 +15,7 @@ export interface ParsedMachineNode {
|
|
|
15
15
|
pairs: ParsedPair[];
|
|
16
16
|
}
|
|
17
17
|
export declare const QUERY_OBJECTS_BATCH = 50;
|
|
18
|
+
export declare function lastUnresolvedInputs(network?: string, noCache?: boolean): string[];
|
|
18
19
|
export declare function batchQueryObjectsByIds(ids: string[], network?: string, noCache?: boolean): Promise<any[]>;
|
|
19
20
|
export interface TableFieldEntry {
|
|
20
21
|
key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ObjectType,objectTypeFromAddress}from'@wowok/wowok';import{MAX_OBJECTS_PER_QUERY}from'./dataplane.js';import{SdkDataPlane}from'./sdk-dataplane.js';export const QUERY_OBJECTS_BATCH=MAX_OBJECTS_PER_QUERY;const planes=new Map();function batchPlane(a,b){const c=(a??'')+'|'+(b?0x1:0x0);let d=planes['get'](c);return!d&&(d=new SdkDataPlane(a??undefined,{'noCache':b}),planes['set'](c,d)),d;}function parentToken(a){return String(a)['toLowerCase']();}export async function batchQueryObjectsByIds(a,b,c){const d=await batchPlane(b,c)['getObjects'](a);return[...d['values']()];}export async function fetchTableEntries(a,b){const {items:c,truncated:d}=await batchPlane(b?.['network'],b?.['noCache'])['getTable'](a,{'maxItems':b?.['maxItems'],'pageLimit':b?.['limit'],'fetchValues':![]});return{'entries':c['map'](f=>({'key':f['key'],'objectId':f['objectId']})),'truncated':d};}export async function fetchAllFieldObjectIds(a,b,c){const {entries:d}=await fetchTableEntries(a,{'network':b,'noCache':c});return d['map'](f=>f['objectId']);}export async function batchQueryTableItems(a,b){const c=await batchPlane(b?.['network'],b?.['noCache'])['getTable'](a,{'maxItems':b?.['maxItems'],'pageLimit':b?.['limit']});return{'items':c['items'],'truncated':c['truncated']};}export async function fetchMachineNodes(a,b,c){const d=await batchQueryObjectsByIds([a],b,c),e=d[0x0],f=e?.['object']??(typeof a==='string'&&a['startsWith']('0x')?a:undefined);if(!f)return[];const {items:g}=await batchQueryTableItems(f,{'network':b,'noCache':c});return g['map'](h=>h['object'])['filter'](h=>h?.['type']==='TableItem_MachineNode')['map'](h=>{const i=h?.['data']??h,j=typeof i?.['name']==='string'?i['name']:'',k=Array['isArray'](i?.['value'])?i['value']:Array['isArray'](i?.['pairs'])?i['pairs']:[];if(!j)return null;return{'name':j,'pairs':k['map'](l=>({'prev_node':String(l?.['prev_node']??''),'threshold':Number(l?.['threshold']??0x0),'forwards':Array['isArray'](l?.['forwards'])?l['forwards']['map'](m=>{const n=typeof m?.['guard']==='object'&&m?.['guard']!==null?m['guard']['guard']??undefined:typeof m?.['guard']==='string'?m['guard']:undefined;return{'name':String(m?.['name']??''),'weight':Number(m?.['weight']??0x0),'namedOperator':m?.['namedOperator']!==undefined&&m?.['namedOperator']!==null?String(m['namedOperator']):undefined,'permissionIndex':m?.['permissionIndex']!==undefined&&m?.['permissionIndex']!==null?Number(m['permissionIndex']):undefined,'guard':n};}):[]}))};})['filter'](h=>h!==null);}export async function batchReadAddressKeyedFields(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f)['toLowerCase']())['filter'](f=>f['startsWith']('0x')))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e);}export async function batchReadKeyedItems(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f)['toLowerCase']())['filter'](f=>f['startsWith']('0x')))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e,{'strict':!![]});}export async function batchReadU64KeyedFields(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f))['filter'](f=>f!==''&&Number['isFinite'](Number(f))))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e,{'keyType':'u64'});}export const ENTITY_REGISTRAR_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000aab';export const ENTITY_LINKER_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000aaa';export async function batchFetchEntityRegistrar(a,b,c){try{return await batchReadAddressKeyedFields(ENTITY_REGISTRAR_OBJECT_ID,a,b,c);}catch{return new Map();}}export async function batchFetchEntityLinker(a,b,c){try{return await batchReadAddressKeyedFields(ENTITY_LINKER_OBJECT_ID,a,b,c);}catch{return new Map();}}export const ENTITY_PERMISSION_OBJECT_ID='0xaad';export const ENTITY_PERMISSION_ROLES={'OWNER':0x1,'ADMIN':0x2,'ENTITY':0x4};export async function batchFetchEntityPermission(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_PERMISSION_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byPermission':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=Number(n?.['role']??0x0),p=String(n?.['permission']??'')['toLowerCase'](),q=Number(n?.['time']??0x0);p&&(l['push']({'role':o,'permission':p,'time':q}),m['set'](p,(m['get'](p)??0x0)|o));}f['set'](i,{'items':l,'byPermission':m});}return f;}export async function fetchEntityPermission(a,b,c){try{const d=await batchFetchEntityPermission([a],b,c);return d['get'](String(a)['toLowerCase']());}catch{return undefined;}}export const ENTITY_CONTACT_OBJECT_ID='0xaa9';export async function batchFetchEntityContact(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_CONTACT_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byContact':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=String(n?.['contact']??'')['toLowerCase'](),p=Number(n?.['time']??0x0);o&&(l['push']({'contact':o,'time':p}),m['set'](o,(m['get'](o)??0x0)||p));}f['set'](i,{'items':l,'byContact':m});}return f;}export async function fetchEntityContact(a,b,c){try{const d=await batchFetchEntityContact([a],b,c);return d['get'](String(a)['toLowerCase']());}catch{return undefined;}}export const ENTITY_ORDER_OBJECT_ID='0xaa8';export const ENTITY_ORDER_ROLES={'OWNER':0x1,'AGENT':0x2};export async function batchFetchEntityOrder(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_ORDER_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byOrder':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=Number(n?.['role']??0x0),p=String(n?.['order']??'')['toLowerCase'](),q=Number(n?.['time']??0x0);p&&(l['push']({'role':o,'order':p,'time':q}),m['set'](p,(m['get'](p)??0x0)|o));}f['set'](i,{'items':l,'byOrder':m});}return f;}export const OBJECT_LINKER_CORE_OBJECT_ID='0xaae';export const OBJECT_LINKER_TX_OBJECT_ID='0xaaf';export const LINKER_RING_LIMIT=0x1450;export function ringWindowSaturated(a){return a>=LINKER_RING_LIMIT;}export async function batchFetchObjectLinker(b,c,e,f){const g=new Map(),h=await batchReadKeyedItems(b,c,e,f);for(const i of new Set((c??[])['map'](j=>String(j)['toLowerCase']()))){g['set'](i,{'items':[],'byWho':new Map()});}for(const [j,k]of h){const l=k,m=[],n=new Map();for(const o of Array['isArray'](l?.['items'])?l['items']:[]){const p=String(o?.['who']??'')['toLowerCase'](),q=Number(o?.['time']??0x0);p&&(m['push']({'who':p,'time':q}),n['set'](p,q));}g['set'](j,{'items':m,'byWho':n});}return g;}export function batchFetchObjectLinkerCore(a,b,c){return batchFetchObjectLinker(OBJECT_LINKER_CORE_OBJECT_ID,a,b,c);}export function batchFetchObjectLinkerTx(a,b,c){return batchFetchObjectLinker(OBJECT_LINKER_TX_OBJECT_ID,a,b,c);}async function fetchObjectLinker(a,b,c,d){try{const e=await batchFetchObjectLinker(a,[b],c,d);return e['get'](String(b)['toLowerCase']());}catch{return undefined;}}export function fetchObjectLinkerCore(a,b,c){return fetchObjectLinker(OBJECT_LINKER_CORE_OBJECT_ID,a,b,c);}export function fetchObjectLinkerTx(a,b,c){return fetchObjectLinker(OBJECT_LINKER_TX_OBJECT_ID,a,b,c);}export async function fetchServiceOrders(a,b,c){const d=await fetchObjectLinkerTx(a,b,c);if(!d)return undefined;const e=ringWindowSaturated(d['items']['length']),f=d['items']['filter'](g=>objectTypeFromAddress(g['who'])===ObjectType['Order']);return{'items':f,'byWho':new Map(f['map'](g=>[g['who'],g['time']])),'ring_saturated':e};}export async function fetchPermissionContext(a,b,c){try{const e=await batchQueryObjectsByIds([a],b,c),f=e[0x0],g=f?.['data']??f,h=new Set((g?.['admin']??[])['map'](k=>String(k)['toLowerCase']())),i=new Map(),{items:j}=await batchQueryTableItems(a,{'network':b,'noCache':c});for(const k of j){const l=k['object'],m=l?.['data']??l;m?.['address']!=null&&Array['isArray'](m['perm'])&&i['set'](String(m['address'])['toLowerCase'](),new Set(m['perm']['map'](n=>Number(n))));}return{'admin':h,'table':i};}catch{return undefined;}}export async function fetchOrderContext(a,b,c){try{const e=await batchQueryObjectsByIds([a],b,c),f=e[0x0];if(f?.['type']!=='Order'&&f?.['data']?.['type']!=='Order')return undefined;const g=f?.['data']??f;return{'builder':String(g['builder']??g['owner']??''),'agent':new Set((g['agent']??[])['map'](h=>String(h)['toLowerCase']()))};}catch{return undefined;}}
|
|
1
|
+
import{ObjectType,objectTypeFromAddress}from'@wowok/wowok';import{MAX_OBJECTS_PER_QUERY}from'./dataplane.js';import{SdkDataPlane}from'./sdk-dataplane.js';export const QUERY_OBJECTS_BATCH=MAX_OBJECTS_PER_QUERY;const planes=new Map();function batchPlane(a,b){const c=(a??'')+'|'+(b?0x1:0x0);let d=planes['get'](c);return!d&&(d=new SdkDataPlane(a??undefined,{'noCache':b}),planes['set'](c,d)),d;}export function lastUnresolvedInputs(a,b){return batchPlane(a,b)['unresolvedInputs'];}function parentToken(a){return String(a)['toLowerCase']();}export async function batchQueryObjectsByIds(a,b,c){const d=await batchPlane(b,c)['getObjects'](a);return[...d['values']()];}export async function fetchTableEntries(a,b){const {items:c,truncated:d}=await batchPlane(b?.['network'],b?.['noCache'])['getTable'](a,{'maxItems':b?.['maxItems'],'pageLimit':b?.['limit'],'fetchValues':![]});return{'entries':c['map'](f=>({'key':f['key'],'objectId':f['objectId']})),'truncated':d};}export async function fetchAllFieldObjectIds(a,b,c){const {entries:d}=await fetchTableEntries(a,{'network':b,'noCache':c});return d['map'](f=>f['objectId']);}export async function batchQueryTableItems(a,b){const c=await batchPlane(b?.['network'],b?.['noCache'])['getTable'](a,{'maxItems':b?.['maxItems'],'pageLimit':b?.['limit']});return{'items':c['items'],'truncated':c['truncated']};}export async function fetchMachineNodes(a,b,c){const d=await batchQueryObjectsByIds([a],b,c),e=d[0x0],f=e?.['object']??(typeof a==='string'&&a['startsWith']('0x')?a:undefined);if(!f)return[];const {items:g}=await batchQueryTableItems(f,{'network':b,'noCache':c});return g['map'](h=>h['object'])['filter'](h=>h?.['type']==='TableItem_MachineNode')['map'](h=>{const i=h?.['data']??h,j=typeof i?.['name']==='string'?i['name']:'',k=Array['isArray'](i?.['value'])?i['value']:Array['isArray'](i?.['pairs'])?i['pairs']:[];if(!j)return null;return{'name':j,'pairs':k['map'](l=>({'prev_node':String(l?.['prev_node']??''),'threshold':Number(l?.['threshold']??0x0),'forwards':Array['isArray'](l?.['forwards'])?l['forwards']['map'](m=>{const n=typeof m?.['guard']==='object'&&m?.['guard']!==null?m['guard']['guard']??undefined:typeof m?.['guard']==='string'?m['guard']:undefined;return{'name':String(m?.['name']??''),'weight':Number(m?.['weight']??0x0),'namedOperator':m?.['namedOperator']!==undefined&&m?.['namedOperator']!==null?String(m['namedOperator']):undefined,'permissionIndex':m?.['permissionIndex']!==undefined&&m?.['permissionIndex']!==null?Number(m['permissionIndex']):undefined,'guard':n};}):[]}))};})['filter'](h=>h!==null);}export async function batchReadAddressKeyedFields(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f)['toLowerCase']())['filter'](f=>f['startsWith']('0x')))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e);}export async function batchReadKeyedItems(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f)['toLowerCase']())['filter'](f=>f['startsWith']('0x')))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e,{'strict':!![]});}export async function batchReadU64KeyedFields(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f))['filter'](f=>f!==''&&Number['isFinite'](Number(f))))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e,{'keyType':'u64'});}export const ENTITY_REGISTRAR_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000aab';export const ENTITY_LINKER_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000aaa';export async function batchFetchEntityRegistrar(a,b,c){try{return await batchReadAddressKeyedFields(ENTITY_REGISTRAR_OBJECT_ID,a,b,c);}catch{return new Map();}}export async function batchFetchEntityLinker(a,b,c){try{return await batchReadAddressKeyedFields(ENTITY_LINKER_OBJECT_ID,a,b,c);}catch{return new Map();}}export const ENTITY_PERMISSION_OBJECT_ID='0xaad';export const ENTITY_PERMISSION_ROLES={'OWNER':0x1,'ADMIN':0x2,'ENTITY':0x4};export async function batchFetchEntityPermission(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_PERMISSION_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byPermission':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=Number(n?.['role']??0x0),p=String(n?.['permission']??'')['toLowerCase'](),q=Number(n?.['time']??0x0);p&&(l['push']({'role':o,'permission':p,'time':q}),m['set'](p,(m['get'](p)??0x0)|o));}f['set'](i,{'items':l,'byPermission':m});}return f;}export async function fetchEntityPermission(a,b,c){try{const d=await batchFetchEntityPermission([a],b,c);return d['get'](String(a)['toLowerCase']());}catch{return undefined;}}export const ENTITY_CONTACT_OBJECT_ID='0xaa9';export async function batchFetchEntityContact(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_CONTACT_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byContact':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=String(n?.['contact']??'')['toLowerCase'](),p=Number(n?.['time']??0x0);o&&(l['push']({'contact':o,'time':p}),m['set'](o,(m['get'](o)??0x0)||p));}f['set'](i,{'items':l,'byContact':m});}return f;}export async function fetchEntityContact(a,b,c){try{const d=await batchFetchEntityContact([a],b,c);return d['get'](String(a)['toLowerCase']());}catch{return undefined;}}export const ENTITY_ORDER_OBJECT_ID='0xaa8';export const ENTITY_ORDER_ROLES={'OWNER':0x1,'AGENT':0x2};export async function batchFetchEntityOrder(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_ORDER_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byOrder':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=Number(n?.['role']??0x0),p=String(n?.['order']??'')['toLowerCase'](),q=Number(n?.['time']??0x0);p&&(l['push']({'role':o,'order':p,'time':q}),m['set'](p,(m['get'](p)??0x0)|o));}f['set'](i,{'items':l,'byOrder':m});}return f;}export const OBJECT_LINKER_CORE_OBJECT_ID='0xaae';export const OBJECT_LINKER_TX_OBJECT_ID='0xaaf';export const LINKER_RING_LIMIT=0x1450;export function ringWindowSaturated(a){return a>=LINKER_RING_LIMIT;}export async function batchFetchObjectLinker(b,c,e,f){const g=new Map(),h=await batchReadKeyedItems(b,c,e,f);for(const i of new Set((c??[])['map'](j=>String(j)['toLowerCase']()))){g['set'](i,{'items':[],'byWho':new Map()});}for(const [j,k]of h){const l=k,m=[],n=new Map();for(const o of Array['isArray'](l?.['items'])?l['items']:[]){const p=String(o?.['who']??'')['toLowerCase'](),q=Number(o?.['time']??0x0);p&&(m['push']({'who':p,'time':q}),n['set'](p,q));}g['set'](j,{'items':m,'byWho':n});}return g;}export function batchFetchObjectLinkerCore(a,b,c){return batchFetchObjectLinker(OBJECT_LINKER_CORE_OBJECT_ID,a,b,c);}export function batchFetchObjectLinkerTx(a,b,c){return batchFetchObjectLinker(OBJECT_LINKER_TX_OBJECT_ID,a,b,c);}async function fetchObjectLinker(a,b,c,d){try{const e=await batchFetchObjectLinker(a,[b],c,d);return e['get'](String(b)['toLowerCase']());}catch{return undefined;}}export function fetchObjectLinkerCore(a,b,c){return fetchObjectLinker(OBJECT_LINKER_CORE_OBJECT_ID,a,b,c);}export function fetchObjectLinkerTx(a,b,c){return fetchObjectLinker(OBJECT_LINKER_TX_OBJECT_ID,a,b,c);}export async function fetchServiceOrders(a,b,c){const d=await fetchObjectLinkerTx(a,b,c);if(!d)return undefined;const e=ringWindowSaturated(d['items']['length']),f=d['items']['filter'](g=>objectTypeFromAddress(g['who'])===ObjectType['Order']);return{'items':f,'byWho':new Map(f['map'](g=>[g['who'],g['time']])),'ring_saturated':e};}export async function fetchPermissionContext(a,b,c){try{const e=await batchQueryObjectsByIds([a],b,c),f=e[0x0],g=f?.['data']??f,h=new Set((g?.['admin']??[])['map'](k=>String(k)['toLowerCase']())),i=new Map(),{items:j}=await batchQueryTableItems(a,{'network':b,'noCache':c});for(const k of j){const l=k['object'],m=l?.['data']??l;m?.['address']!=null&&Array['isArray'](m['perm'])&&i['set'](String(m['address'])['toLowerCase'](),new Set(m['perm']['map'](n=>Number(n))));}return{'admin':h,'table':i};}catch{return undefined;}}export async function fetchOrderContext(a,b,c){try{const e=await batchQueryObjectsByIds([a],b,c),f=e[0x0];if(f?.['type']!=='Order'&&f?.['data']?.['type']!=='Order')return undefined;const g=f?.['data']??f;return{'builder':String(g['builder']??g['owner']??''),'agent':new Set((g['agent']??[])['map'](h=>String(h)['toLowerCase']()))};}catch{return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bcs,deriveDynamicFieldID,query_events,query_objects,query_table,LocalMark,lastWriteAtAny}from'@wowok/wowok';import{chunk50,mapPool}from'./dataplane.js';const SESSION_CACHE_TTL_MS=0x5*0x3c*0x3e8;let sessionWatermark=lastWriteAtAny();function checkWriteClock(){const a=lastWriteAtAny();a>sessionWatermark&&(sessionWatermark=a,sessionEntries['clear']());}const sessionEntries=new Set();class SessionMap{['map']=new Map();['registered']=![];['get'](a){const b=this['map']['get'](a);if(!b)return undefined;if(Date['now']()-b['at']>SESSION_CACHE_TTL_MS)return this['map']['delete'](a),undefined;return b['value'];}['set'](a,b){!this['registered']&&(sessionEntries['add'](this),this['registered']=!![]),this['map']['set'](a,{'value':b,'at':Date['now']()});}['clear'](){this['map']['clear']();}}export class SdkDataPlane{['network'];['opts'];['objectCache']=new SessionMap();['keyedCache']=new Map();['stats']={'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0};constructor(a,b){this['network']=a,this['opts']=b;}async['getObjects'](a,b){const c=a['map'](j=>String(j)['toLowerCase']()),d=await LocalMark['Instance']()['get_many_address'](c),e=[...new Set(d['filter'](j=>!!j))],f=new Map(),g=[],h=this['opts']?.['noCache']===!![];if(!h)checkWriteClock();for(const j of e){const k=h?undefined:this['objectCache']['get'](j);k?(this['stats']['dedupHits']++,f['set'](j,k)):g['push'](j);}if(g['length']===0x0)return f;const i=chunk50(g);return await mapPool(i,this['opts']?.['concurrency']??0x4,async l=>{this['stats']['batches']++,this['stats']['byChannel']['objects']++;try{const m=await query_objects({'objects':l,'no_cache':this['opts']?.['noCache'],'network':this['network']});for(const n of m?.['objects']??[]){const p=String(n?.['object']??'')['toLowerCase']();if(!p)continue;if(!h)this['objectCache']['set'](p,n);f['set'](p,n);}}catch(q){if(b?.['strict'])throw q;}}),f;}async['getKeyedFields'](a,b,c){const d=c?.['keyType']??'address',e=String(a)['toLowerCase'](),f=a+':'+d,g=this['opts']?.['noCache']===!![];if(!g)checkWriteClock();const h=g?undefined:this['keyedCache']['get'](f),i=new Map(),j=[];for(const o of b){const p=String(o)['toLowerCase'](),q=h?.['get'](p);if(q){this['stats']['dedupHits']++,i['set'](p,q);continue;}const r=d==='u64'?bcs['u64']()['serialize'](Number(p))['toBytes']():bcs['Address']['serialize'](p)['toBytes'](),s=deriveDynamicFieldID(e,d,r)['toLowerCase']();j['push']({'key':p,'fieldId':s});}if(j['length']===0x0)return i;const k=new Map();for(const t of j)k['set'](t['fieldId'],t['key']);const l=chunk50(j)['length'],m=await this['getObjects']([...k['keys']()],{'strict':c?.['strict']});this['stats']['byChannel']['objects']=Math['max'](0x0,this['stats']['byChannel']['objects']-l),this['stats']['byChannel']['keyedFields']+=l;const n=h??new SessionMap();for(const [u,v]of k){const x=m['get'](u);if(!x)continue;const y=x['data']??x,z=y;n['set'](v,z),i['set'](v,z);}if(!g)this['keyedCache']['set'](f,n);return i;}async['getTable'](a,b){const c=[];let d=![],f;for(;;){this['stats']['batches']++,this['stats']['byChannel']['tables']++;let g;try{g=await query_table({'parent':a,'cursor':f??undefined,'limit':b?.['pageLimit'],'no_cache':this['opts']?.['noCache'],'network':this['network']});}catch{break;}for(const h of g?.['items']??[]){const i=String(h?.['object']??'')['toLowerCase']();if(i['startsWith']('0x'))c['push']({'key':String(h?.['key']?.['value']??''),'objectId':i});}if(b?.['maxItems']!=null&&c['length']>=b['maxItems']){c['length']=b['maxItems'],d=g?.['hasNextPage']===!![];break;}if(g?.['hasNextPage']!==!![]||!g['nextCursor'])break;f=String(g['nextCursor']);}if(b?.['fetchValues']!==![]&&c['length']>0x0){const j=await this['getObjects'](c['map'](k=>k['objectId']));for(const k of c)k['object']=j['get'](k['objectId']);}return{'items':c,'truncated':d};}async['getEvents'](a,b){const c=[];let d=b?.['cursor']??null;const e=b?.['maxPages']??0x1,f=b?.['limit']??0x32;let g=![];for(let h=0x0;h<e;h++){this['stats']['batches']++,this['stats']['byChannel']['events']++;let i;try{i=await query_events({'type':a,'cursor':d,'limit':f,'order':'descending','no_cache':this['opts']?.['noCache'],'network':this['network']});}catch{g=!![];break;}const j=i?.['data']??[];c['push'](...j);if(i?.['hasNextPage']!==!![]||!i['nextCursor']){d=i?.['nextCursor']??null;break;}d=i['nextCursor'];if(h+0x1===e)g=!![];}return{'events':c,'cursor':d,'truncated':g};}}
|
|
1
|
+
import{bcs,deriveDynamicFieldID,query_events,query_objects,query_table,LocalMark,lastWriteAtAny}from'@wowok/wowok';import{chunk50,mapPool}from'./dataplane.js';const SESSION_CACHE_TTL_MS=0x5*0x3c*0x3e8;let sessionWatermark=lastWriteAtAny();function checkWriteClock(){const a=lastWriteAtAny();a>sessionWatermark&&(sessionWatermark=a,sessionEntries['clear']());}const sessionEntries=new Set();class SessionMap{['map']=new Map();['registered']=![];['get'](a){const b=this['map']['get'](a);if(!b)return undefined;if(Date['now']()-b['at']>SESSION_CACHE_TTL_MS)return this['map']['delete'](a),undefined;return b['value'];}['set'](a,b){!this['registered']&&(sessionEntries['add'](this),this['registered']=!![]),this['map']['set'](a,{'value':b,'at':Date['now']()});}['clear'](){this['map']['clear']();}}export class SdkDataPlane{['network'];['opts'];['objectCache']=new SessionMap();['keyedCache']=new Map();['stats']={'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0};constructor(a,b){this['network']=a,this['opts']=b;}['unresolvedInputs']=[];async['getObjects'](a,b){const c=a['map'](j=>String(j)['toLowerCase']()),d=await LocalMark['Instance']()['get_many_address'](c),e=[...new Set(d['filter'](j=>!!j))],f=new Map(),g=[];this['unresolvedInputs']=a['map'](j=>String(j)['toLowerCase']())['filter']((j,k)=>j!==d[k]);const h=this['opts']?.['noCache']===!![];if(!h)checkWriteClock();for(const j of e){const k=h?undefined:this['objectCache']['get'](j);k?(this['stats']['dedupHits']++,f['set'](j,k)):g['push'](j);}if(g['length']===0x0)return f;const i=chunk50(g);return await mapPool(i,this['opts']?.['concurrency']??0x4,async l=>{this['stats']['batches']++,this['stats']['byChannel']['objects']++;try{const m=await query_objects({'objects':l,'no_cache':this['opts']?.['noCache'],'network':this['network']});for(const n of m?.['objects']??[]){const p=String(n?.['object']??'')['toLowerCase']();if(!p)continue;if(!h)this['objectCache']['set'](p,n);f['set'](p,n);}}catch(q){if(b?.['strict'])throw q;}}),f;}async['getKeyedFields'](a,b,c){const d=c?.['keyType']??'address',e=String(a)['toLowerCase'](),f=a+':'+d,g=this['opts']?.['noCache']===!![];if(!g)checkWriteClock();const h=g?undefined:this['keyedCache']['get'](f),i=new Map(),j=[];for(const o of b){const p=String(o)['toLowerCase'](),q=h?.['get'](p);if(q){this['stats']['dedupHits']++,i['set'](p,q);continue;}const r=d==='u64'?bcs['u64']()['serialize'](Number(p))['toBytes']():bcs['Address']['serialize'](p)['toBytes'](),s=deriveDynamicFieldID(e,d,r)['toLowerCase']();j['push']({'key':p,'fieldId':s});}if(j['length']===0x0)return i;const k=new Map();for(const t of j)k['set'](t['fieldId'],t['key']);const l=chunk50(j)['length'],m=await this['getObjects']([...k['keys']()],{'strict':c?.['strict']});this['stats']['byChannel']['objects']=Math['max'](0x0,this['stats']['byChannel']['objects']-l),this['stats']['byChannel']['keyedFields']+=l;const n=h??new SessionMap();for(const [u,v]of k){const x=m['get'](u);if(!x)continue;const y=x['data']??x,z=y;n['set'](v,z),i['set'](v,z);}if(!g)this['keyedCache']['set'](f,n);return i;}async['getTable'](a,b){const c=[];let d=![],f;for(;;){this['stats']['batches']++,this['stats']['byChannel']['tables']++;let g;try{g=await query_table({'parent':a,'cursor':f??undefined,'limit':b?.['pageLimit'],'no_cache':this['opts']?.['noCache'],'network':this['network']});}catch{break;}for(const h of g?.['items']??[]){const i=String(h?.['object']??'')['toLowerCase']();if(i['startsWith']('0x'))c['push']({'key':String(h?.['key']?.['value']??''),'objectId':i});}if(b?.['maxItems']!=null&&c['length']>=b['maxItems']){c['length']=b['maxItems'],d=g?.['hasNextPage']===!![];break;}if(g?.['hasNextPage']!==!![]||!g['nextCursor'])break;f=String(g['nextCursor']);}if(b?.['fetchValues']!==![]&&c['length']>0x0){const j=await this['getObjects'](c['map'](k=>k['objectId']));for(const k of c)k['object']=j['get'](k['objectId']);}return{'items':c,'truncated':d};}async['getEvents'](a,b){const c=[];let d=b?.['cursor']??null;const e=b?.['maxPages']??0x1,f=b?.['limit']??0x32;let g=![];for(let h=0x0;h<e;h++){this['stats']['batches']++,this['stats']['byChannel']['events']++;let i;try{i=await query_events({'type':a,'cursor':d,'limit':f,'order':'descending','no_cache':this['opts']?.['noCache'],'network':this['network']});}catch{g=!![];break;}const j=i?.['data']??[];c['push'](...j);if(i?.['hasNextPage']!==!![]||!i['nextCursor']){d=i?.['nextCursor']??null;break;}d=i['nextCursor'];if(h+0x1===e)g=!![];}return{'events':c,'cursor':d,'truncated':g};}}
|
|
@@ -40,7 +40,7 @@ export type Retention = "complete" | "bounded_exact" | "bounded_window" | "membe
|
|
|
40
40
|
export interface TopoEdgePayload {
|
|
41
41
|
amount?: string;
|
|
42
42
|
coinType?: string;
|
|
43
|
-
mode?: 0 | 1 | 2;
|
|
43
|
+
mode?: 0 | 1 | 2 | 3;
|
|
44
44
|
guard?: string;
|
|
45
45
|
roleBits?: number;
|
|
46
46
|
node?: string;
|
package/dist/harness/recover.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const RECOVERY_RULES={'insufficient_balance':{'error_code':'insufficient_balance','strategy':'claim_faucet','max_attempts':0x3,'automation':'semi','detail':'1.\x20Testnet:\x20claim\x20WOW\x20from\x20the\x20faucet\x202.\x20Mainnet:\x20transfer\x20ETH/USDT/USDC/WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge\x20(query\x20active\x20EVM\x20account\x20→\x20top\x20up\x20from\x20external\x20wallet\x20→\x20confirm\x20→\x20cross-chain)\x203.\x20Point\x20the\x20user\x20to\x20the\x20live\x20airdrop\x20page\x20(https://wowok.net/airdrop.html)\x20for\x20the\x20current\x20round\x204.\x20Retry\x20original\x20operation','user_prompt':'Insufficient\x20balance\x20for\x20gas\x20or\x20operation.\x20How\x20to\x20obtain\x20WOW\x20tokens:\x20(1)\x20Testnet\x20—\x20claim\x20WOW\x20from\x20the\x20faucet\x20(https://faucet.testnet.wowok.net);\x20all\x20merchant\x20and\x20order\x20testing\x20can\x20use\x20WOW\x20as\x20the\x20payment\x20token.\x20(2)\x20Mainnet\x20—\x20transfer\x20ETH\x20/\x20USDT\x20/\x20USDC\x20/\x20WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge:\x20first\x20query\x20the\x20active\x20EVM\x20account\x20(bridge_operation\x20query_active_evm_account,\x20auto-generated\x20on\x20first\x20use),\x20then\x20transfer\x20from\x20an\x20external\x20wallet\x20(e.g.\x20MetaMask)\x20to\x20that\x20address,\x20confirm\x20the\x20balance\x20arrived,\x20and\x20cross-chain\x20to\x20WOW\x20mainnet\x20(bridge_operation\x20cross_chain_evm_to_wow).\x20(3)\x20WOW\x20airdrop:\x20current\x20round\x20status,\x20pool\x20and\x20eligibility\x20are\x20published\x20live\x20at\x20https://wowok.net/airdrop.html\x20(referral:\x20https://wowok.net/refer.html)\x20—\x20open\x20that\x20page\x20rather\x20than\x20assuming\x20a\x20round\x20is\x20live\x20or\x20closed.\x20Query\x20wowok_buildin_info\x20with\x20info=\x27funding\x20guidance\x27\x20for\x20the\x20canonical\x20funding\x20guidance.'},'stock_exhausted':{'error_code':'stock_exhausted','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Merchant-side\x20inventory\x20shortfall\x20(Move\x20service:16\x20E_STOCK_NOT_ENOUGH)\x20—\x20NOT\x20a\x20buyer\x20balance\x20problem,\x20so\x20a\x20faucet\x20claim\x20will\x20NOT\x20help.\x201.\x20Reduce\x20the\x20purchase\x20quantity\x20to\x20the\x20item\x27s\x20remaining\x20stock\x202.\x20Pick\x20another\x20sale\x20item\x203.\x20Ask\x20the\x20merchant\x20to\x20restock,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x27s\x20stock\x20is\x20exhausted\x20for\x20the\x20requested\x20quantity.\x20Reduce\x20the\x20quantity,\x20choose\x20another\x20item,\x20or\x20ask\x20the\x20merchant\x20to\x20restock.'},'sale_suspended':{'error_code':'sale_suspended','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20merchant\x20suspended\x20this\x20sale\x20item\x20(Move\x20service:34\x20E_SALE_SUSPENDED).\x201.\x20Pick\x20another\x20(non-suspended)\x20item\x202.\x20Contact\x20the\x20merchant\x20to\x20resume\x20the\x20sale,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x20is\x20suspended\x20by\x20the\x20merchant.\x20Please\x20choose\x20another\x20item\x20or\x20contact\x20the\x20merchant.'},'discount_invalid':{'error_code':'discount_invalid','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20discount\x20is\x20outside\x20its\x20[time_start,\x20time_end]\x20validity\x20window\x20(Move\x20service:35\x20E_DISCOUNT_TIME_INVALID).\x201.\x20Retry\x20without\x20the\x20discount\x202.\x20Ask\x20the\x20merchant\x20for\x20a\x20fresh\x20discount,\x20then\x20retry','user_prompt':'The\x20discount\x20is\x20not\x20valid\x20at\x20the\x20current\x20time\x20(outside\x20its\x20validity\x20window).\x20Buy\x20without\x20the\x20discount\x20or\x20ask\x20the\x20merchant\x20for\x20a\x20new\x20one.'},'rate_limit':{'error_code':'rate_limit','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Rate\x20limit\x20hit\x20(HTTP\x20429).\x20Exponential\x20backoff\x20retry:\x202s\x20/\x204s\x20/\x208s\x20/\x2016s\x20/\x2032s.\x20Avoid\x20parallel\x20calls\x20while\x20the\x20limit\x20window\x20is\x20active.'},'gas_exceeded':{'error_code':'gas_exceeded','strategy':'adjust_params','max_attempts':0x3,'automation':'semi','detail':'Gas\x20budget\x20exceeded.\x201.\x20Increase\x20the\x20gas_budget\x20parameter\x202.\x20Reduce\x20the\x20operation\x20size\x20(fewer\x20objects\x20per\x20transaction)\x203.\x20Retry\x20the\x20original\x20operation','user_prompt':'Gas\x20budget\x20exceeded.\x20Increase\x20the\x20gas\x20budget\x20or\x20reduce\x20the\x20operation\x20size,\x20then\x20retry.'},'bcs_error':{'error_code':'bcs_error','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'BCS\x20serialization/deserialization\x20error\x20—\x20a\x20parameter\x20does\x20not\x20match\x20the\x20expected\x20type/structure.\x201.\x20Query\x20the\x20operation\x20schema\x20(schema_query)\x202.\x20Fix\x20the\x20offending\x20parameter\x20type\x20(e.g.\x20BigInt\x20vs\x20number,\x20vector\x20element\x20type)\x203.\x20Retry','user_prompt':'A\x20parameter\x20failed\x20serialization.\x20Check\x20the\x20parameter\x20types\x20against\x20the\x20schema\x20and\x20retry.'},'signature_error':{'error_code':'signature_error','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'Signature\x20verification\x20failed.\x201.\x20Verify\x20the\x20account\x20is\x20not\x20suspended\x202.\x20Check\x20the\x20network\x20matches\x20the\x20account\x27s\x203.\x20Switch\x20to\x20a\x20healthy\x20account\x20and\x20retry','user_prompt':'Signature\x20verification\x20failed.\x20The\x20account\x20may\x20be\x20suspended\x20or\x20misconfigured.\x20Switch\x20accounts\x20or\x20check\x20the\x20configuration\x20and\x20retry.'},'config_error':{'error_code':'config_error','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'Local\x20configuration\x20error\x20(network\x20not\x20specified,\x20persistent\x20storage\x20not\x20set).\x201.\x20Show\x20the\x20user\x20which\x20configuration\x20is\x20missing\x202.\x20Guide\x20the\x20user\x20through\x20the\x20account_operation/config\x20setup\x203.\x20Retry\x20after\x20the\x20user\x20fixes\x20it','user_prompt':'Local\x20configuration\x20is\x20incomplete.\x20Please\x20finish\x20the\x20account/network\x20setup\x20and\x20retry.'},'wip_verification_failed':{'error_code':'wip_verification_failed','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'WIP\x20file\x20not\x20publicly\x20reachable\x20/\x20hash\x20mismatch.\x201.\x20Upload\x20via\x20the\x20wip\x20storage\x20service\x20(wip_file\x20type=\x27upload\x27\x20—\x20official\x20free\x20store\x20or\x20storage=\x27custom\x27)\x202.\x20Or\x20deploy\x20to\x20a\x20public\x20URL\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20own\x20site)\x203.\x20Update\x20the\x20sale\x27s\x20wip\x20URL\x204.\x20Re-run\x20the\x20operation','user_prompt':'The\x20WIP\x20file\x20could\x20not\x20be\x20verified\x20from\x20a\x20public\x20URL.\x20Upload\x20it\x20with\x20wip_file\x20type=\x27upload\x27\x20(official\x20free\x20store\x20or\x20your\x20own\x20service)\x20or\x20deploy\x20it\x20(GitHub\x20Pages\x20/\x20IPFS),\x20update\x20the\x20sale\x27s\x20WIP\x20URL,\x20and\x20retry.'},'wip_storage_unavailable':{'error_code':'wip_storage_unavailable','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'Transient\x20wip\x20storage\x20transport\x20failure.\x201.\x20Retry\x20the\x20same\x20request\x20with\x20bounded\x20backoff\x202.\x20Large\x20WIP\x20files\x20are\x20network-sensitive:\x20compress\x20images\x20before\x20generate\x20(each\x20image\x20<=\x202MB,\x20total\x20<=\x2010MB)\x203.\x20Check\x20connectivity\x20to\x20the\x20storage\x20base\x20URL\x20if\x20retries\x20keep\x20failing','user_prompt':'The\x20wip\x20storage\x20request\x20failed\x20due\x20to\x20a\x20network\x20problem.\x20Retry\x20the\x20upload;\x20if\x20it\x20keeps\x20failing,\x20reduce\x20the\x20file\x20size\x20or\x20check\x20connectivity.'},'network_error':{'error_code':'network_error','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Exponential\x20backoff\x20retry:\x201s\x20/\x202s\x20/\x204s\x20/\x208s\x20/\x2016s.\x20Switch\x20RPC\x20node\x20if\x20available.'},'transaction_expired':{'error_code':'transaction_expired','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'The\x20transaction\x20expired\x20before\x20execution\x20(epoch\x20boundary\x20or\x20validator/gateway\x20outage)\x20—\x20it\x20did\x20NOT\x20land\x20and\x20nothing\x20was\x20committed.\x20Bounded\x20backoff\x20retry:\x2010s\x20/\x2030s\x20/\x2060s,\x20resubmit\x20the\x20SAME\x20call\x20unchanged.\x20If\x20a\x20dry_run\x20passes\x20while\x20the\x20real\x20call\x20keeps\x20failing,\x20the\x20fault\x20is\x20chain-side\x20—\x20wait\x20it\x20out.\x20Verify\x20with\x20onchain_events\x20if\x20unsure.'},'guard_rejected':{'error_code':'guard_rejected','strategy':'fill_submission','max_attempts':0x2,'automation':'semi','detail':'1.\x20Parse\x20Guard\x20table\x20structure\x202.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20them\x20and\x20resubmit\x20with\x20call_with_submission\x203.\x20If\x20it\x20defines\x20none,\x20the\x20rule\x20evaluated\x20false\x20—\x20adjust\x20the\x20call\x27s\x20parameters\x20(signer/query/state)\x20or\x20change\x20the\x20Guard\x20(docs#40)','user_prompt':'Guard\x20verification\x20rejected.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20in\x20the\x20required\x20submission\x20data\x20and\x20resubmit;\x20if\x20it\x20defines\x20none,\x20the\x20Guard\x20rule\x20evaluated\x20false\x20—\x20adjust\x20this\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20rule.'},'time_lock_not_elapsed':{'error_code':'time_lock_not_elapsed','strategy':'wait_and_retry','max_attempts':0x1,'automation':'semi','detail':'1.\x20Verify\x20Service\x20is\x20paused\x20(bPaused=true).\x20If\x20not,\x20submit\x20pause=true\x20first.\x202.\x20Wait\x20until\x20paused_time\x20+\x20setting_lock_duration\x20<=\x20current\x20clock.\x203.\x20Retry\x20the\x20original\x20operation.\x20Do\x20NOT\x20recreate\x20the\x20object.','user_prompt':'Service\x20setting_lock_duration\x20has\x20not\x20elapsed\x20since\x20the\x20Service\x20was\x20paused.\x20Please\x20pause\x20the\x20Service\x20if\x20it\x20is\x20not\x20already\x20paused,\x20wait\x20for\x20the\x20lock\x20duration\x20to\x20elapse,\x20then\x20retry.'},'immutable_violation':{'error_code':'immutable_violation','strategy':'recreate','max_attempts':0x1,'automation':'semi','detail':'1.\x20Stop\x20modification\x20attempt\x202.\x20Evaluate\x20creating\x20a\x20new\x20object\x20as\x20replacement\x203.\x20Re-plan\x20affected\x20phases','user_prompt':'Cannot\x20modify\x20an\x20immutable\x20object.\x20A\x20new\x20object\x20must\x20be\x20created\x20as\x20a\x20replacement.\x20Confirm\x20to\x20proceed\x20with\x20recreation.'},'permission_denied':{'error_code':'permission_denied','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20object\x27s\x20permission_guard\x202.\x20List\x20accounts\x20with\x20permission\x203.\x20Switch\x20account\x20or\x20prompt\x20user\x20to\x20add\x20permission','user_prompt':'Current\x20account\x20lacks\x20permission\x20for\x20this\x20operation.\x20Switch\x20to\x20an\x20authorized\x20account\x20or\x20update\x20the\x20Permission\x20object.'},'object_not_found':{'error_code':'object_not_found','strategy':'query_and_retry','max_attempts':0x3,'automation':'semi','detail':'1.\x20Verify\x20the\x20referenced\x20name/ID\x20spelling\x20(local_mark_list)\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network\x202.\x20If\x20recently\x20created,\x20re-query\x20the\x20object\x20(may\x20be\x20sync\x20delay)\x203.\x20If\x20truly\x20absent,\x20search\x20for\x20similar\x20objects\x204.\x20Prompt\x20user\x20to\x20reselect','user_prompt':'Referenced\x20object\x20not\x20found.\x20First\x20verify\x20the\x20name/ID\x20spelling\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network;\x20if\x20it\x20was\x20created\x20recently,\x20this\x20may\x20be\x20a\x20synchronization\x20delay\x20—\x20retry.\x20If\x20the\x20issue\x20persists,\x20please\x20select\x20a\x20valid\x20object.'},'state_conflict':{'error_code':'state_conflict','strategy':'adjust_params','max_attempts':0x2,'automation':'full','detail':'1.\x20Query\x20object\x27s\x20current\x20true\x20state\x202.\x20Update\x20ODG\x20status\x20annotations\x203.\x20Adjust\x20subsequent\x20operations\x20(e.g.,\x20skip\x20completed\x20steps)'},'invalid_parameter':{'error_code':'invalid_parameter','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20the\x20relevant\x20schema\x202.\x20Auto-fix\x20obvious\x20errors\x20(e.g.,\x20BigInt\x20vs\x20string)\x203.\x20If\x20unfixable,\x20prompt\x20user','user_prompt':'Parameter\x20validation\x20failed.\x20Please\x20check\x20the\x20parameter\x20types\x20and\x20values\x20against\x20the\x20schema\x20and\x20retry.'},'unknown':{'error_code':'unknown','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'1.\x20Report\x20full\x20error\x20context\x20to\x20the\x20user\x202.\x20Escalate\x20to\x20human\x20intervention\x203.\x20Flag\x20for\x20error-classification\x20rule\x20addition','user_prompt':'An\x20unclassified\x20error\x20occurred.\x20Please\x20review\x20the\x20error\x20details\x20and\x20contact\x20support\x20if\x20needed.'}};const operationAttempts=new Map();function getAttemptCount(a,b){const c=operationAttempts['get'](a);if(!c)return 0x0;return c['get'](b)??0x0;}function incrementAttempt(a,b){!operationAttempts['has'](a)&&operationAttempts['set'](a,new Map());const c=operationAttempts['get'](a),d=(c['get'](b)??0x0)+0x1;return c['set'](b,d),d;}function getTotalAttempts(a){const b=operationAttempts['get'](a);if(!b)return 0x0;let c=0x0;for(const d of b['values']())c+=d;return c;}export function resetAttempts(a){operationAttempts['delete'](a);}export function recover(a,b,c){const d=RECOVERY_RULES[a]??RECOVERY_RULES['unknown'],e=0x5,f=getTotalAttempts(b),g=getAttemptCount(b,a);if(f>=e)return{'strategy':'stop','should_retry':![],'max_attempts':e,'current_attempt':f,'detail':'Total\x20retry\x20limit\x20('+e+')\x20reached\x20for\x20operation\x20'+b+'.\x20Escalating\x20to\x20human\x20intervention.','user_prompt':'Maximum\x20retry\x20attempts\x20reached.\x20Manual\x20intervention\x20required.'};if(g>=d['max_attempts'])return{'strategy':'escalate_human','should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'detail':'Per-error-code\x20retry\x20limit\x20('+d['max_attempts']+')\x20reached\x20for\x20'+a+'.\x20Escalating\x20to\x20human.','user_prompt':'Recovery\x20attempts\x20for\x20'+a+'\x20exhausted.\x20Manual\x20intervention\x20required.'};const h=incrementAttempt(b,a);return{'strategy':d['strategy'],'should_retry':d['automation']==='full'||h<d['max_attempts'],'max_attempts':d['max_attempts'],'current_attempt':h,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};}export function getBackoffDelay(a){return Math['pow'](0x2,a-0x1)*0x3e8;}
|
|
1
|
+
export const RECOVERY_RULES={'insufficient_balance':{'error_code':'insufficient_balance','strategy':'claim_faucet','max_attempts':0x3,'automation':'semi','detail':'1.\x20Testnet:\x20claim\x20WOW\x20from\x20the\x20faucet\x202.\x20Mainnet:\x20transfer\x20ETH/USDT/USDC/WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge\x20(query\x20active\x20EVM\x20account\x20→\x20top\x20up\x20from\x20external\x20wallet\x20→\x20confirm\x20→\x20cross-chain)\x203.\x20Point\x20the\x20user\x20to\x20the\x20live\x20airdrop\x20page\x20(https://wowok.net/airdrop.html)\x20for\x20the\x20current\x20round\x204.\x20Retry\x20original\x20operation','user_prompt':'Insufficient\x20balance\x20for\x20gas\x20or\x20operation.\x20How\x20to\x20obtain\x20WOW\x20tokens:\x20(1)\x20Testnet\x20—\x20claim\x20WOW\x20from\x20the\x20faucet\x20(https://faucet.testnet.wowok.net);\x20all\x20merchant\x20and\x20order\x20testing\x20can\x20use\x20WOW\x20as\x20the\x20payment\x20token.\x20(2)\x20Mainnet\x20—\x20transfer\x20ETH\x20/\x20USDT\x20/\x20USDC\x20/\x20WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge:\x20first\x20query\x20the\x20active\x20EVM\x20account\x20(bridge_operation\x20query_active_evm_account,\x20auto-generated\x20on\x20first\x20use),\x20then\x20transfer\x20from\x20an\x20external\x20wallet\x20(e.g.\x20MetaMask)\x20to\x20that\x20address,\x20confirm\x20the\x20balance\x20arrived,\x20and\x20cross-chain\x20to\x20WOW\x20mainnet\x20(bridge_operation\x20cross_chain_evm_to_wow).\x20(3)\x20WOW\x20airdrop:\x20current\x20round\x20status,\x20pool\x20and\x20eligibility\x20are\x20published\x20live\x20at\x20https://wowok.net/airdrop.html\x20(referral:\x20https://wowok.net/refer.html)\x20—\x20open\x20that\x20page\x20rather\x20than\x20assuming\x20a\x20round\x20is\x20live\x20or\x20closed.\x20Query\x20wowok_buildin_info\x20with\x20info=\x27funding\x20guidance\x27\x20for\x20the\x20canonical\x20funding\x20guidance.'},'stock_exhausted':{'error_code':'stock_exhausted','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Merchant-side\x20inventory\x20shortfall\x20(Move\x20service:16\x20E_STOCK_NOT_ENOUGH)\x20—\x20NOT\x20a\x20buyer\x20balance\x20problem,\x20so\x20a\x20faucet\x20claim\x20will\x20NOT\x20help.\x201.\x20Reduce\x20the\x20purchase\x20quantity\x20to\x20the\x20item\x27s\x20remaining\x20stock\x202.\x20Pick\x20another\x20sale\x20item\x203.\x20Ask\x20the\x20merchant\x20to\x20restock,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x27s\x20stock\x20is\x20exhausted\x20for\x20the\x20requested\x20quantity.\x20Reduce\x20the\x20quantity,\x20choose\x20another\x20item,\x20or\x20ask\x20the\x20merchant\x20to\x20restock.'},'sale_suspended':{'error_code':'sale_suspended','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20merchant\x20suspended\x20this\x20sale\x20item\x20(Move\x20service:34\x20E_SALE_SUSPENDED).\x201.\x20Pick\x20another\x20(non-suspended)\x20item\x202.\x20Contact\x20the\x20merchant\x20to\x20resume\x20the\x20sale,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x20is\x20suspended\x20by\x20the\x20merchant.\x20Please\x20choose\x20another\x20item\x20or\x20contact\x20the\x20merchant.'},'discount_invalid':{'error_code':'discount_invalid','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20discount\x20is\x20outside\x20its\x20[time_start,\x20time_end]\x20validity\x20window\x20(Move\x20service:35\x20E_DISCOUNT_TIME_INVALID).\x201.\x20Retry\x20without\x20the\x20discount\x202.\x20Ask\x20the\x20merchant\x20for\x20a\x20fresh\x20discount,\x20then\x20retry','user_prompt':'The\x20discount\x20is\x20not\x20valid\x20at\x20the\x20current\x20time\x20(outside\x20its\x20validity\x20window).\x20Buy\x20without\x20the\x20discount\x20or\x20ask\x20the\x20merchant\x20for\x20a\x20new\x20one.'},'rate_limit':{'error_code':'rate_limit','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Rate\x20limit\x20hit\x20(HTTP\x20429).\x20Exponential\x20backoff\x20retry:\x202s\x20/\x204s\x20/\x208s\x20/\x2016s\x20/\x2032s.\x20Avoid\x20parallel\x20calls\x20while\x20the\x20limit\x20window\x20is\x20active.'},'gas_exceeded':{'error_code':'gas_exceeded','strategy':'adjust_params','max_attempts':0x3,'automation':'semi','detail':'Gas\x20budget\x20exceeded.\x201.\x20Increase\x20the\x20gas_budget\x20parameter\x202.\x20Reduce\x20the\x20operation\x20size\x20(fewer\x20objects\x20per\x20transaction)\x203.\x20Retry\x20the\x20original\x20operation','user_prompt':'Gas\x20budget\x20exceeded.\x20Increase\x20the\x20gas\x20budget\x20or\x20reduce\x20the\x20operation\x20size,\x20then\x20retry.'},'bcs_error':{'error_code':'bcs_error','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'BCS\x20serialization/deserialization\x20error\x20—\x20a\x20parameter\x20does\x20not\x20match\x20the\x20expected\x20type/structure.\x201.\x20Query\x20the\x20operation\x20schema\x20(schema_query)\x202.\x20Fix\x20the\x20offending\x20parameter\x20type\x20(e.g.\x20BigInt\x20vs\x20number,\x20vector\x20element\x20type)\x203.\x20Retry','user_prompt':'A\x20parameter\x20failed\x20serialization.\x20Check\x20the\x20parameter\x20types\x20against\x20the\x20schema\x20and\x20retry.'},'signature_error':{'error_code':'signature_error','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'Signature\x20verification\x20failed.\x201.\x20Verify\x20the\x20account\x20is\x20not\x20suspended\x202.\x20Check\x20the\x20network\x20matches\x20the\x20account\x27s\x203.\x20Switch\x20to\x20a\x20healthy\x20account\x20and\x20retry','user_prompt':'Signature\x20verification\x20failed.\x20The\x20account\x20may\x20be\x20suspended\x20or\x20misconfigured.\x20Switch\x20accounts\x20or\x20check\x20the\x20configuration\x20and\x20retry.'},'config_error':{'error_code':'config_error','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'Local\x20configuration\x20error\x20(network\x20not\x20specified,\x20persistent\x20storage\x20not\x20set).\x201.\x20Show\x20the\x20user\x20which\x20configuration\x20is\x20missing\x202.\x20Guide\x20the\x20user\x20through\x20the\x20account_operation/config\x20setup\x203.\x20Retry\x20after\x20the\x20user\x20fixes\x20it','user_prompt':'Local\x20configuration\x20is\x20incomplete.\x20Please\x20finish\x20the\x20account/network\x20setup\x20and\x20retry.'},'wip_verification_failed':{'error_code':'wip_verification_failed','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'WIP\x20file\x20not\x20publicly\x20reachable\x20/\x20hash\x20mismatch.\x201.\x20Upload\x20via\x20the\x20wip\x20storage\x20service\x20(wip_file\x20type=\x27upload\x27\x20—\x20official\x20free\x20store\x20or\x20storage=\x27custom\x27)\x202.\x20Or\x20deploy\x20to\x20a\x20public\x20URL\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20own\x20site)\x203.\x20Update\x20the\x20sale\x27s\x20wip\x20URL\x204.\x20Re-run\x20the\x20operation','user_prompt':'The\x20WIP\x20file\x20could\x20not\x20be\x20verified\x20from\x20a\x20public\x20URL.\x20Upload\x20it\x20with\x20wip_file\x20type=\x27upload\x27\x20(official\x20free\x20store\x20or\x20your\x20own\x20service)\x20or\x20deploy\x20it\x20(GitHub\x20Pages\x20/\x20IPFS),\x20update\x20the\x20sale\x27s\x20WIP\x20URL,\x20and\x20retry.'},'wip_storage_unavailable':{'error_code':'wip_storage_unavailable','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'Transient\x20wip\x20storage\x20transport\x20failure.\x201.\x20Retry\x20the\x20same\x20request\x20with\x20bounded\x20backoff\x202.\x20Large\x20WIP\x20files\x20are\x20network-sensitive:\x20compress\x20images\x20before\x20generate\x20(each\x20image\x20<=\x202MB,\x20total\x20<=\x2010MB)\x203.\x20Check\x20connectivity\x20to\x20the\x20storage\x20base\x20URL\x20if\x20retries\x20keep\x20failing','user_prompt':'The\x20wip\x20storage\x20request\x20failed\x20due\x20to\x20a\x20network\x20problem.\x20Retry\x20the\x20upload;\x20if\x20it\x20keeps\x20failing,\x20reduce\x20the\x20file\x20size\x20or\x20check\x20connectivity.'},'network_error':{'error_code':'network_error','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Exponential\x20backoff\x20retry:\x201s\x20/\x202s\x20/\x204s\x20/\x208s\x20/\x2016s.\x20Switch\x20RPC\x20node\x20if\x20available.'},'transaction_expired':{'error_code':'transaction_expired','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'The\x20transaction\x20expired\x20before\x20execution\x20(epoch\x20boundary\x20or\x20validator/gateway\x20outage)\x20—\x20it\x20did\x20NOT\x20land\x20and\x20nothing\x20was\x20committed.\x20Bounded\x20backoff\x20retry:\x2010s\x20/\x2030s\x20/\x2060s,\x20resubmit\x20the\x20SAME\x20call\x20unchanged.\x20If\x20a\x20dry_run\x20passes\x20while\x20the\x20real\x20call\x20keeps\x20failing,\x20the\x20fault\x20is\x20chain-side\x20—\x20wait\x20it\x20out.\x20Verify\x20with\x20onchain_events\x20if\x20unsure.'},'guard_rejected':{'error_code':'guard_rejected','strategy':'fill_submission','max_attempts':0x2,'automation':'semi','detail':'1.\x20Parse\x20Guard\x20table\x20structure\x202.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20them\x20and\x20resubmit\x20with\x20call_with_submission\x203.\x20If\x20it\x20defines\x20none,\x20the\x20rule\x20evaluated\x20false\x20—\x20adjust\x20the\x20call\x27s\x20parameters\x20(signer/query/state)\x20or\x20change\x20the\x20Guard\x20(docs#40)\x204.\x20When\x20the\x20failure\x20is\x20passport\x20E_VERIFY_FAILED\x20and\x20a\x20submission\x20was\x20supplied,\x20the\x20response\x20appends\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line\x20naming\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20fix\x20that\x20guard\x20first','user_prompt':'Guard\x20verification\x20rejected.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20in\x20the\x20required\x20submission\x20data\x20and\x20resubmit;\x20if\x20it\x20defines\x20none,\x20the\x20Guard\x20rule\x20evaluated\x20false\x20—\x20adjust\x20this\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20rule.\x20When\x20the\x20response\x20includes\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line,\x20it\x20names\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20address\x20that\x20guard\x20first.'},'time_lock_not_elapsed':{'error_code':'time_lock_not_elapsed','strategy':'wait_and_retry','max_attempts':0x1,'automation':'semi','detail':'1.\x20Verify\x20Service\x20is\x20paused\x20(bPaused=true).\x20If\x20not,\x20submit\x20pause=true\x20first.\x202.\x20Wait\x20until\x20paused_time\x20+\x20setting_lock_duration\x20<=\x20current\x20clock.\x203.\x20Retry\x20the\x20original\x20operation.\x20Do\x20NOT\x20recreate\x20the\x20object.','user_prompt':'Service\x20setting_lock_duration\x20has\x20not\x20elapsed\x20since\x20the\x20Service\x20was\x20paused.\x20Please\x20pause\x20the\x20Service\x20if\x20it\x20is\x20not\x20already\x20paused,\x20wait\x20for\x20the\x20lock\x20duration\x20to\x20elapse,\x20then\x20retry.'},'immutable_violation':{'error_code':'immutable_violation','strategy':'recreate','max_attempts':0x1,'automation':'semi','detail':'1.\x20Stop\x20modification\x20attempt\x202.\x20Evaluate\x20creating\x20a\x20new\x20object\x20as\x20replacement\x203.\x20Re-plan\x20affected\x20phases','user_prompt':'Cannot\x20modify\x20an\x20immutable\x20object.\x20A\x20new\x20object\x20must\x20be\x20created\x20as\x20a\x20replacement.\x20Confirm\x20to\x20proceed\x20with\x20recreation.'},'permission_denied':{'error_code':'permission_denied','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20object\x27s\x20permission_guard\x202.\x20List\x20accounts\x20with\x20permission\x203.\x20Switch\x20account\x20or\x20prompt\x20user\x20to\x20add\x20permission','user_prompt':'Current\x20account\x20lacks\x20permission\x20for\x20this\x20operation.\x20Switch\x20to\x20an\x20authorized\x20account\x20or\x20update\x20the\x20Permission\x20object.'},'object_not_found':{'error_code':'object_not_found','strategy':'query_and_retry','max_attempts':0x3,'automation':'semi','detail':'1.\x20Verify\x20the\x20referenced\x20name/ID\x20spelling\x20(local_mark_list)\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network\x202.\x20If\x20recently\x20created,\x20re-query\x20the\x20object\x20(may\x20be\x20sync\x20delay)\x203.\x20If\x20truly\x20absent,\x20search\x20for\x20similar\x20objects\x204.\x20Prompt\x20user\x20to\x20reselect','user_prompt':'Referenced\x20object\x20not\x20found.\x20First\x20verify\x20the\x20name/ID\x20spelling\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network;\x20if\x20it\x20was\x20created\x20recently,\x20this\x20may\x20be\x20a\x20synchronization\x20delay\x20—\x20retry.\x20If\x20the\x20issue\x20persists,\x20please\x20select\x20a\x20valid\x20object.'},'state_conflict':{'error_code':'state_conflict','strategy':'adjust_params','max_attempts':0x2,'automation':'full','detail':'1.\x20Query\x20object\x27s\x20current\x20true\x20state\x202.\x20Update\x20ODG\x20status\x20annotations\x203.\x20Adjust\x20subsequent\x20operations\x20(e.g.,\x20skip\x20completed\x20steps)'},'invalid_parameter':{'error_code':'invalid_parameter','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20the\x20relevant\x20schema\x202.\x20Auto-fix\x20obvious\x20errors\x20(e.g.,\x20BigInt\x20vs\x20string)\x203.\x20If\x20unfixable,\x20prompt\x20user','user_prompt':'Parameter\x20validation\x20failed.\x20Please\x20check\x20the\x20parameter\x20types\x20and\x20values\x20against\x20the\x20schema\x20and\x20retry.'},'unknown':{'error_code':'unknown','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'1.\x20Report\x20full\x20error\x20context\x20to\x20the\x20user\x202.\x20Escalate\x20to\x20human\x20intervention\x203.\x20Flag\x20for\x20error-classification\x20rule\x20addition','user_prompt':'An\x20unclassified\x20error\x20occurred.\x20Please\x20review\x20the\x20error\x20details\x20and\x20contact\x20support\x20if\x20needed.'}};const operationAttempts=new Map();function getAttemptCount(a,b){const c=operationAttempts['get'](a);if(!c)return 0x0;return c['get'](b)??0x0;}function incrementAttempt(a,b){!operationAttempts['has'](a)&&operationAttempts['set'](a,new Map());const c=operationAttempts['get'](a),d=(c['get'](b)??0x0)+0x1;return c['set'](b,d),d;}function getTotalAttempts(a){const b=operationAttempts['get'](a);if(!b)return 0x0;let c=0x0;for(const d of b['values']())c+=d;return c;}export function resetAttempts(a){operationAttempts['delete'](a);}export function recover(a,b,c){const d=RECOVERY_RULES[a]??RECOVERY_RULES['unknown'],e=0x5,f=getTotalAttempts(b),g=getAttemptCount(b,a);if(f>=e)return{'strategy':'stop','should_retry':![],'max_attempts':e,'current_attempt':f,'detail':'Total\x20retry\x20limit\x20('+e+')\x20reached\x20for\x20operation\x20'+b+'.\x20Escalating\x20to\x20human\x20intervention.','user_prompt':'Maximum\x20retry\x20attempts\x20reached.\x20Manual\x20intervention\x20required.'};if(g>=d['max_attempts'])return{'strategy':'escalate_human','should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'detail':'Per-error-code\x20retry\x20limit\x20('+d['max_attempts']+')\x20reached\x20for\x20'+a+'.\x20Escalating\x20to\x20human.','user_prompt':'Recovery\x20attempts\x20for\x20'+a+'\x20exhausted.\x20Manual\x20intervention\x20required.'};const h=incrementAttempt(b,a);return{'strategy':d['strategy'],'should_retry':d['automation']==='full'||h<d['max_attempts'],'max_attempts':d['max_attempts'],'current_attempt':h,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};}export function getBackoffDelay(a){return Math['pow'](0x2,a-0x1)*0x3e8;}
|