@wowok/agent-mcp 3.2.9 → 3.3.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/README.md +2 -2
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +10 -1
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.js +1 -1
- package/dist/extensions/capability-manifest.js +1 -1
- package/dist/extensions/industry-audit.spec.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/graph/onchain/facts.spec.js +1 -1
- package/dist/graph/onchain/field-manifest.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/intent/types.d.ts +1 -1
- package/dist/intent/types.js +1 -1
- package/dist/keeper/KeeperScan.d.ts +2 -1
- package/dist/keeper/KeeperScan.js +1 -1
- package/dist/keeper/keeper.spec.js +1 -1
- package/dist/keeper/types.d.ts +3 -0
- package/dist/keeper/types.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +34 -0
- package/dist/knowledge/allocator-rail-verifier.js +1 -0
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/arbitration-venue-order.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +19 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/alloc_audit.json +1 -1
- package/dist/knowledge/baselines/rules/arb.json +1 -1
- package/dist/knowledge/baselines/rules/guard.json +15 -5
- package/dist/knowledge/baselines/rules/machine.json +9 -6
- package/dist/knowledge/baselines/rules/plan.json +12 -12
- package/dist/knowledge/baselines/semantic-facts.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +1 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/contract-invariants.js +1 -1
- 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 +1 -1
- package/dist/knowledge/guard-anchor-reach.js +1 -1
- 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-field-cognition.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/index.js +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-puzzle.d.ts +1 -1
- package/dist/knowledge/machine-puzzle.js +1 -1
- package/dist/knowledge/machine-risk.js +1 -1
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/machine-topology.d.ts +8 -0
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/permission-ledger.js +1 -1
- package/dist/knowledge/protocol-facts.d.ts +16 -0
- package/dist/knowledge/protocol-facts.js +1 -0
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/reward-ledger.d.ts +2 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-templates.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +0 -2
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +7 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +13 -1
- 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/tool-constraints.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/normalize.d.ts +1 -1
- package/dist/monitor/normalize.js +1 -1
- package/dist/monitor/types.d.ts +1 -1
- package/dist/monitor/types.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/game-theory.d.ts +1 -0
- package/dist/playbooks/service-build/game-theory.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.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/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/relationship/registry.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/role/profiles.js +1 -1
- package/dist/rules.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +5 -1
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/arbitration.d.ts +4 -4
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +39 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +1 -0
- package/dist/schema/call/contact.d.ts +4 -4
- package/dist/schema/call/demand.d.ts +4 -4
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +12 -4
- package/dist/schema/call/order.d.ts +4 -4
- package/dist/schema/call/permission.d.ts +4 -4
- package/dist/schema/call/progress.d.ts +4 -4
- package/dist/schema/call/receipt.d.ts +8 -0
- package/dist/schema/call/receipt.js +1 -1
- package/dist/schema/call/repository.d.ts +4 -4
- package/dist/schema/call/reward.d.ts +24 -4
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +6 -4
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +4 -4
- package/dist/schema/common/index.d.ts +2 -2
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/goal/index.d.ts +5 -1
- package/dist/schema/goal/planning.d.ts +10 -2
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +3 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +9 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/local/index.d.ts +10 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/operations.d.ts +35 -22
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +16 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +52 -48
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +1 -0
- package/dist/schema/schema-query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workspace/index.d.ts +9 -0
- package/dist/schema/workspace/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +1 -0
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/benchmark_migration_operation.schema.json +27 -3
- package/dist/schemas/bridge_operation.output.json +1 -0
- package/dist/schemas/goal_operation.schema.json +26 -2
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +8 -0
- package/dist/schemas/industry_pack_operation.schema.json +9 -0
- package/dist/schemas/intent_radar.output.json +8 -2
- package/dist/schemas/intent_radar.schema.json +4 -1
- package/dist/schemas/local_cache_operation.output.json +1 -0
- package/dist/schemas/local_history_operation.output.json +1 -0
- package/dist/schemas/local_info_operation.output.json +1 -0
- package/dist/schemas/local_mark_operation.output.json +1 -0
- package/dist/schemas/monitor_events.schema.json +3 -1
- package/dist/schemas/onchain_events.output.json +275 -11
- package/dist/schemas/onchain_events.schema.json +25 -1
- package/dist/schemas/onchain_operations.output.json +40 -0
- package/dist/schemas/onchain_operations.schema.json +573 -104
- package/dist/schemas/onchain_operations_allocation.schema.json +2 -2
- package/dist/schemas/onchain_operations_arbitration.schema.json +11 -7
- package/dist/schemas/onchain_operations_contact.schema.json +9 -5
- package/dist/schemas/onchain_operations_demand.schema.json +9 -5
- package/dist/schemas/onchain_operations_guard.schema.json +342 -4
- package/dist/schemas/onchain_operations_machine.schema.json +17 -5
- package/dist/schemas/onchain_operations_order.schema.json +9 -5
- package/dist/schemas/onchain_operations_permission.schema.json +9 -5
- package/dist/schemas/onchain_operations_progress.schema.json +9 -5
- package/dist/schemas/onchain_operations_repository.schema.json +9 -5
- package/dist/schemas/onchain_operations_reward.schema.json +89 -9
- package/dist/schemas/onchain_operations_service.schema.json +18 -11
- package/dist/schemas/onchain_operations_treasury.schema.json +9 -5
- package/dist/schemas/query_toolkit.output.json +237 -14
- package/dist/schemas/schema_query.schema.json +3 -2
- package/dist/schemas/workspace_operation.output.json +23 -3
- package/dist/schemas/workspace_operation.schema.json +3 -3
- package/dist/tools/handlers/benchmark-migration.d.ts +45 -1
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/keeper.d.ts +1 -1
- package/dist/tools/handlers/onchain.d.ts +12 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/workflow.js +1 -1
- package/dist/tools/handlers/workspace.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/agent.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/rules-hook.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
package/dist/keeper/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const KEEPER_DETECTORS=['payment_unclaimed','progress_actionable','settlement_pending','timeout_intermediate'];export const AUTO_EXECUTABLE_DETECTORS=['payment_unclaimed'];export const KEEPER_DEFAULTS={'scan_interval_ms':0x1d4c0,'max_scan_objects':0x14,'max_auto_execute_per_scan':0x5,'auto_retry_cooldown_ms':0x1b7740};export const KEEPER_MIN={'scan_interval_ms':0x7530,'max_scan_objects':0x1,'max_auto_execute_per_scan':0x1,'auto_retry_cooldown_ms':0xea60};export function defaultKeeperConfig(){return{'enabled':!![],'detectors':{'payment_unclaimed':!![],'progress_actionable':!![],'settlement_pending':!![],'timeout_intermediate':!![]},'scan_interval_ms':KEEPER_DEFAULTS['scan_interval_ms'],'max_scan_objects':KEEPER_DEFAULTS['max_scan_objects'],'max_auto_execute_per_scan':KEEPER_DEFAULTS['max_auto_execute_per_scan'],'auto_retry_cooldown_ms':KEEPER_DEFAULTS['auto_retry_cooldown_ms']};}export function clampKeeperConfig(a){const b=(c,d,e)=>{const f=Number(c);return Number['isFinite'](f)?Math['max'](e,Math['floor'](f)):d;};return{...a,'scan_interval_ms':b(a['scan_interval_ms'],KEEPER_DEFAULTS['scan_interval_ms'],KEEPER_MIN['scan_interval_ms']),'max_scan_objects':b(a['max_scan_objects'],KEEPER_DEFAULTS['max_scan_objects'],KEEPER_MIN['max_scan_objects']),'max_auto_execute_per_scan':b(a['max_auto_execute_per_scan'],KEEPER_DEFAULTS['max_auto_execute_per_scan'],KEEPER_MIN['max_auto_execute_per_scan']),'auto_retry_cooldown_ms':b(a['auto_retry_cooldown_ms'],KEEPER_DEFAULTS['auto_retry_cooldown_ms'],KEEPER_MIN['auto_retry_cooldown_ms'])};}export function newKeeperTaskId(){return'ktask_'+Date['now']()['toString'](0x24)+'_'+Math['random']()['toString'](0x24)['slice'](0x2,0x8);}export function newKeeperRuleId(){return'krule_'+Date['now']()['toString'](0x24)+'_'+Math['random']()['toString'](0x24)['slice'](0x2,0x8);}
|
|
1
|
+
export const KEEPER_DETECTORS=['payment_unclaimed','progress_actionable','settlement_pending','timeout_intermediate'];export const AUTO_EXECUTABLE_DETECTORS=['payment_unclaimed'];export const KEEPER_DEFAULTS={'scan_interval_ms':0x1d4c0,'max_scan_objects':0x14,'max_auto_execute_per_scan':0x5,'auto_retry_cooldown_ms':0x1b7740,'timeout_intermediate_ms':0x5265c00};export const KEEPER_MIN={'scan_interval_ms':0x7530,'max_scan_objects':0x1,'max_auto_execute_per_scan':0x1,'auto_retry_cooldown_ms':0xea60,'timeout_intermediate_ms':0x36ee80};export function defaultKeeperConfig(){return{'enabled':!![],'detectors':{'payment_unclaimed':!![],'progress_actionable':!![],'settlement_pending':!![],'timeout_intermediate':!![]},'scan_interval_ms':KEEPER_DEFAULTS['scan_interval_ms'],'max_scan_objects':KEEPER_DEFAULTS['max_scan_objects'],'max_auto_execute_per_scan':KEEPER_DEFAULTS['max_auto_execute_per_scan'],'auto_retry_cooldown_ms':KEEPER_DEFAULTS['auto_retry_cooldown_ms'],'timeout_intermediate_ms':KEEPER_DEFAULTS['timeout_intermediate_ms']};}export function clampKeeperConfig(a){const b=(c,d,e)=>{const f=Number(c);return Number['isFinite'](f)?Math['max'](e,Math['floor'](f)):d;};return{...a,'scan_interval_ms':b(a['scan_interval_ms'],KEEPER_DEFAULTS['scan_interval_ms'],KEEPER_MIN['scan_interval_ms']),'max_scan_objects':b(a['max_scan_objects'],KEEPER_DEFAULTS['max_scan_objects'],KEEPER_MIN['max_scan_objects']),'max_auto_execute_per_scan':b(a['max_auto_execute_per_scan'],KEEPER_DEFAULTS['max_auto_execute_per_scan'],KEEPER_MIN['max_auto_execute_per_scan']),'auto_retry_cooldown_ms':b(a['auto_retry_cooldown_ms'],KEEPER_DEFAULTS['auto_retry_cooldown_ms'],KEEPER_MIN['auto_retry_cooldown_ms']),'timeout_intermediate_ms':b(a['timeout_intermediate_ms'],KEEPER_DEFAULTS['timeout_intermediate_ms'],KEEPER_MIN['timeout_intermediate_ms'])};}export function newKeeperTaskId(){return'ktask_'+Date['now']()['toString'](0x24)+'_'+Math['random']()['toString'](0x24)['slice'](0x2,0x8);}export function newKeeperRuleId(){return'krule_'+Date['now']()['toString'](0x24)+'_'+Math['random']()['toString'](0x24)['slice'](0x2,0x8);}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface GuardTreeNode {
|
|
2
|
+
type?: string;
|
|
3
|
+
nodes?: GuardTreeNode[];
|
|
4
|
+
node?: GuardTreeNode;
|
|
5
|
+
query?: string;
|
|
6
|
+
object?: {
|
|
7
|
+
identifier?: number;
|
|
8
|
+
};
|
|
9
|
+
identifier?: number;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface GuardTableRow {
|
|
13
|
+
identifier?: number;
|
|
14
|
+
b_submission?: boolean;
|
|
15
|
+
value_type?: string;
|
|
16
|
+
value?: unknown;
|
|
17
|
+
[k: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface RailGuardInput {
|
|
20
|
+
key: string;
|
|
21
|
+
track: "settlement" | "refund";
|
|
22
|
+
table: unknown[];
|
|
23
|
+
root?: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface RailNodeInput {
|
|
26
|
+
name: string;
|
|
27
|
+
semanticRole?: string;
|
|
28
|
+
}
|
|
29
|
+
export type RailFindingCode = "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_POLARITY_COLLISION" | "RAIL_DEAD_LITERAL";
|
|
30
|
+
export interface RailFinding {
|
|
31
|
+
code: RailFindingCode;
|
|
32
|
+
detail: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function verifyAllocatorRails(guards: RailGuardInput[], nodes: RailNodeInput[]): RailFinding[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const SYM_NODE='progress.current',SYM_CLAIMED='order.claimed_by\x20some';function slotValue(a,b){if(b===undefined)return{'value':undefined,'isSubmission':![]};const c=a['find'](d=>d['identifier']===b);if(!c)return{'value':undefined,'isSubmission':![]};return{'value':c['value'],'isSubmission':c['b_submission']===!![]};}function classifyQueryLhs(a){if(a===SYM_NODE)return{'kind':'node'};if(a===SYM_CLAIMED)return{'kind':'claimed'};return{'kind':'unknown'};}function resolveValue(a,b){if(!b||b['type']!=='identifier')return{'known':![]};const c=slotValue(a,b['identifier']);if(c['isSubmission'])return{'known':![]};if(c['value']===undefined)return{'known':![]};return{'known':!![],'value':c['value']};}function evaluate(a,b,d){if(!b||typeof b['type']!=='string')return undefined;switch(b['type']){case'logic_and':{const e=Array['isArray'](b['nodes'])?b['nodes']:[];let f=![];for(const g of e){const h=evaluate(a,g,d);if(h===![])return![];if(h===undefined)f=!![];}return f?undefined:!![];}case'logic_or':{const i=Array['isArray'](b['nodes'])?b['nodes']:[];let j=![];for(const k of i){const l=evaluate(a,k,d);if(l===!![])return!![];if(l===undefined)j=!![];}return j?undefined:![];}case'logic_not':{const m=evaluate(a,b['node'],d);if(m===undefined)return undefined;return!m;}case'logic_equal':{const n=Array['isArray'](b['nodes'])?b['nodes']:[];if(n['length']<0x2)return undefined;const o=classifyQueryLhs(n[0x0]?.['query']),p=resolveValue(a,n[0x1]),q=o['kind']==='unknown'?classifyQueryLhs(n[0x1]?.['query']):o,r=!p['known']&&n[0x1]?.['query']!==undefined?resolveValue(a,n[0x0]):p;if(q['kind']==='node'){if(!r['known']||typeof r['value']!=='string')return undefined;return d['node']===r['value'];}if(q['kind']==='claimed'){if(!r['known']||typeof r['value']!=='boolean')return undefined;return d['claimed']===r['value'];}return undefined;}default:return undefined;}}function satisfiable(a,b,c){return evaluate(a,b,c)!==![];}function findDeadLiterals(a,b,c,d){if(!a||typeof a['type']!=='string')return;if(a['type']==='logic_and'&&Array['isArray'](a['nodes'])){const e=new Map();for(const f of a['nodes']){const g=resolvableEquality(f,b);if(g)e['set'](g['symbol'],g['value']);}for(const h of a['nodes']){const i=resolvableEquality(h,b);if(i){const k=e['get'](i['symbol']);if(k!==undefined&&k!==i['value']){d['push']({'code':'RAIL_DEAD_LITERAL','detail':deadLiteralDetail(c,i['symbol'],k,i['value'])});return;}continue;}const j=findClash(h,b,e);if(j){d['push']({'code':'RAIL_DEAD_LITERAL','detail':deadLiteralDetail(c,j['symbol'],j['pinned'],j['value'])});return;}}for(const l of a['nodes'])findDeadLiterals(l,b,c,d);return;}if(Array['isArray'](a['nodes'])){for(const m of a['nodes'])findDeadLiterals(m,b,c,d);}if(a['node'])findDeadLiterals(a['node'],b,c,d);}function resolvableEquality(c,d){if(!c||c['type']!=='logic_equal'||!Array['isArray'](c['nodes']))return undefined;for(const [e,f]of[[c['nodes'][0x0],c['nodes'][0x1]],[c['nodes'][0x1],c['nodes'][0x0]]]){if(!e||typeof e['query']!=='string')continue;const g=classifyQueryLhs(e['query']);if(g['kind']==='unknown')continue;const h=resolveValue(d,f);if(!h['known'])continue;return{'symbol':g['kind']==='node'?SYM_NODE:SYM_CLAIMED,'value':h['value']};}return undefined;}function findClash(a,b,c){if(!a||typeof a['type']!=='string')return undefined;if(a['type']==='logic_not')return undefined;const d=resolvableEquality(a,b);if(d){const e=c['get'](d['symbol']);if(e!==undefined&&e!==d['value'])return{'symbol':d['symbol'],'pinned':e,'value':d['value']};return undefined;}if(Array['isArray'](a['nodes']))for(const f of a['nodes']){const g=findClash(f,b,c);if(g)return g;}if(a['node'])return findClash(a['node'],b,c);return undefined;}function deadLiteralDetail(a,b,c,d){return'allocator\x20guard\x20\x27'+a+'\x27:\x20one\x20conjunction\x20scope\x20carries\x20'+b+'\x20'+('==\x20'+JSON['stringify'](c)+'\x20and\x20ALSO\x20'+b+'\x20==\x20'+JSON['stringify'](d)+'\x20—\x20the\x20second\x20')+'literal\x20contradicts\x20the\x20first\x20and\x20is\x20a\x20DEAD\x20literal\x20(azx7-mn-261014\x20CR-azx7-01:\x20a\x20pinned\x20'+'node\x20equality\x20made\x20the\x20sibling\x20closed_cancel/item_lost\x20legs\x20unreachable,\x20stranding\x20the\x20'+'escrow\x20at\x20every\x20other\x20terminal).\x20Hoist\x20the\x20node\x20predicate\x20to\x20ONE\x20top-level\x20n-ary\x20logic_or\x20'+'instead\x20of\x20AND-prepending\x20a\x20single-node\x20gate.';}export function verifyAllocatorRails(a,b){const c=[];if(a['length']===0x0||b['length']===0x0)return c;const d=b['filter'](i=>i['semanticRole']==='cancelled'||i['semanticRole']==='final'),e=b['map'](i=>({'node':i['name'],'claimed':!![]}));for(const i of a){if(i['root']===undefined)continue;const j=i['table'];findDeadLiterals(i['root'],j,i['key'],c);}for(const k of d){const l={'node':k['name'],'claimed':![]},m=a['some'](n=>satisfiable(n['table'],n['root'],l));!m&&c['push']({'code':'RAIL_TERMINAL_UNCOVERED','detail':'terminal\x20node\x20\x27'+k['name']+'\x27\x20(role\x20'+k['semanticRole']+')\x20has\x20NO\x20allocator\x20rail\x20'+'satisfiable\x20at\x20claimed_by=none\x20—\x20a\x20normal\x20(unclaimed)\x20order\x20reaching\x20this\x20'+'terminal\x20strands\x20its\x20escrow\x20forever\x20(azx7-mn-261014\x20CR-azx7-01:\x20refund\x20'+'rejected\x20abort\x207\x20at\x20closed_cancel/item_lost;\x20crs-mn-261014\x20F-30:\x20double-'+'negated\x20claimed_by\x20leg\x20bricked\x20the\x20refund\x20at\x20returned).\x20Guards/allocators\x20'+'freeze\x20at\x20publish\x20—\x20fix\x20the\x20rail\x20polarity/node-set\x20BEFORE\x20publishing.'});}const f=a['some'](n=>e['some'](o=>satisfiable(n['table'],n['root'],o)));!f&&c['push']({'code':'RAIL_AWARD_EXIT_MISSING','detail':'no\x20allocator\x20rail\x20is\x20satisfiable\x20at\x20claimed_by=some\x20on\x20ANY\x20machine\x20node\x20—\x20an\x20'+'arbitration-paid\x20order\x20has\x20NO\x20escrow\x20exit\x20(escrow-exit\x20invariant,\x20az-mn-261007).\x20'+'Pair\x20the\x20refund\x20rail\x20with\x20a\x20merchant-recovery\x20allocator\x20asserting\x20order.claimed_by\x20'+'some\x20==\x20true\x20(query\x201570)\x20on\x20the\x20post-delivery\x20node\x20set.'});const h=a['filter'](n=>n['root']!==undefined);for(const n of e){const o=h['some'](q=>q['track']==='refund'&&satisfiable(q['table'],q['root'],n));if(!o)continue;const p=a['some'](q=>claimedTrueLegPasses(q,n));p&&c['push']({'code':'RAIL_POLARITY_COLLISION','detail':'at\x20node\x20\x27'+n['node']+'\x27\x20with\x20claimed_by=some,\x20BOTH\x20a\x20refund-track\x20rail\x20and\x20an\x20'+'award-polarity\x20rail\x20(claimed_by\x20some\x20==\x20true)\x20are\x20satisfiable\x20—\x20the\x20pairing\x20'+'can\x20double-pay\x20the\x20same\x20escrow\x20(crs-mn-261014\x20F-30:\x20the\x20double-negated\x20refund\x20'+'leg\x20passed\x20only\x20AFTER\x20the\x20award\x20paid;\x20dry-run\x20simulated\x20the\x20escrow\x20draining\x20'+'on\x20top\x20of\x20a\x20paid\x20ruling).\x20The\x20refund\x20leg\x20must\x20be\x20logic_equal[query\x20'+'\x27order.claimed_by\x20some\x27,\x20Bool\x20false]\x20—\x20never\x20logic_not(query)==false.'});}return c;}function claimedTrueLegPasses(a,b){const c=a['table'],d={'node':b['node'],'claimed':!![]};return satisfiable(c,a['root'],d)&&!satisfiable(c,a['root'],{'node':b['node'],'claimed':![]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ARB_STATUS_CODE={'Principal_confirming':0x0,'Arbitrator_confirming':0x1,'Voting':0x2,'Arbitrated':0x3,'Objectionable':0x4,'Finished':0x5,'Withdrawn':0x6};export const ARB_TERMINAL_STATUSES=['Finished','Withdrawn'];export const ARB_STATUS_ALIASES={'created':'Principal_confirming','voting':'Voting','feedback':'Arbitrator_confirming','confirmed':'Arbitrated','completed':'Finished','reset':'Objectionable','disputed':'Withdrawn'};export const ARBITRATION_PERMISSIONS=[{'index':0x15e,'name':'ARBITRATION_NEW','description':'Create\x20new\x20Arbitration\x20object','governed_operations':['create\x20a\x20new\x20arbitration\x20service']},{'index':0x15f,'name':'ARBITRATION_DESCRIPTION','description':'Modify\x20Arbitration\x20description','governed_operations':['modify\x20the\x20arbitration\x20description']},{'index':0x160,'name':'ARBITRATION_ENDPOINT','description':'Reserved\x20placeholder\x20—\x20not\x20used\x20on-chain\x20(SDK\x20commented\x20out)','governed_operations':[],'is_reserved':!![]},{'index':0x161,'name':'ARBITRATION_LOCATION','description':'Set\x20Arbitration\x20location','governed_operations':['set\x20the\x20arbitration\x20location']},{'index':0x162,'name':'ARBITRATION_VOTING_GUARD','description':'Manage\x20voting_guard\x20list\x20(add\x20/\x20remove\x20/\x20clear)\x20—\x20controls\x20vote\x20weight','governed_operations':['add\x20a\x20passport-identifier\x20voting\x20guard\x20(dynamic\x20weight)','add\x20a\x20fixed-weight\x20voting\x20guard','remove\x20a\x20voting\x20guard','clear\x20the\x20voting\x20guard\x20list']},{'index':0x163,'name':'ARBITRATION_USAGE_GUARD','description':'Set\x20/\x20clear\x20usage_guard\x20—\x20controls\x20who\x20can\x20file\x20disputes','governed_operations':['set\x20the\x20usage\x20guard\x20(restrict\x20who\x20can\x20file\x20disputes)','clear\x20the\x20usage\x20guard']},{'index':0x164,'name':'ARBITRATION_PAUSE','description':'Pause\x20/\x20resume\x20Arbitration\x20(bPaused\x20default\x20true)','governed_operations':['pause/resume\x20the\x20arbitration\x20service']},{'index':0x165,'name':'ARBITRATION_FEE','description':'Set\x20dispute\x20application\x20fee\x20(u64)','governed_operations':['set\x20the\x20dispute\x20application\x20fee']},{'index':0x166,'name':'ARBITRATION_VOTE','description':'Cast\x20a\x20vote.\x20With\x20an\x20EMPTY\x20voting_guard\x20this\x20is\x20an\x20equal-weight\x20vote\x20(1\x20person\x201\x20vote)\x20—\x20'+'NOT\x20permissionless:\x20vote()\x20asserts\x20permission\x20358\x20unconditionally,\x20so\x20every\x20voter\x20(both\x20disputing\x20'+'parties\x20in\x20open\x20voting)\x20must\x20be\x20GRANTED\x20358\x20first.\x20A\x20fresh\x20Arbitration\x20has\x20no\x20grants\x20at\x20all,\x20so\x20'+'without\x20explicit\x20grants\x20nobody\x20can\x20vote\x20(E-13,\x20test/6)','governed_operations':['cast\x20a\x20vote\x20(empty\x20voting_guard\x20=\x201\x20person\x201\x20vote,\x20permission\x20358\x20still\x20required)','cast\x20a\x20weighted\x20vote\x20via\x20voting_guard\x20(weights\x20resolved\x20per\x20guard)']},{'index':0x167,'name':'ARBITRATION_ARBITRATION','description':'Make\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)','governed_operations':['issue\x20the\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)']},{'index':0x168,'name':'ARBITRATION_FEEDBACK','description':'Provide\x20feedback\x20on\x20Arb\x20case','governed_operations':['attach\x20feedback\x20to\x20the\x20Arb\x20case']},{'index':0x169,'name':'ARBITRATION_CONFIRM','description':'Confirm\x20materials\x20submitted\x20by\x20principal\x20(starts\x20voting\x20phase)','governed_operations':['confirm\x20the\x20principal\x27s\x20materials\x20(starts\x20the\x20voting\x20phase)']},{'index':0x16a,'name':'ARBITRATION_VOTING_DEADLINE_CHANGE','description':'Change\x20voting\x20deadline\x20for\x20an\x20Arb\x20case','governed_operations':['change\x20the\x20voting\x20deadline\x20for\x20an\x20Arb\x20case']},{'index':0x16b,'name':'ARBITRATION_RESET','description':'Reset\x20arbitration\x20—\x20principal\x20resubmits\x20materials,\x20restart\x20lifecycle','governed_operations':['reset\x20the\x20arbitration\x20(principal\x20resubmits\x20materials)']},{'index':0x16c,'name':'ARBITRATION_ARB_WITHDRAW','description':'Withdraw\x20arbitration\x20fees\x20from\x20Arb\x20into\x20Arbitration.balance','governed_operations':['withdraw\x20arbitration\x20fees\x20from\x20the\x20Arb\x20into\x20Arbitration.balance']},{'index':0x16d,'name':'ARBITRATION_FEES_ALLOC','description':'Allocate\x20arbitration\x20fees\x20to\x20Allocation\x20object','governed_operations':['allocate\x20arbitration\x20fees\x20to\x20an\x20Allocation\x20object']},{'index':0x16e,'name':'ARBITRATION_FEES_TRANSFER','description':'Transfer\x20arbitration\x20fees\x20to\x20Treasury\x20object','governed_operations':['transfer\x20arbitration\x20fees\x20to\x20a\x20Treasury\x20object']},{'index':0x16f,'name':'ARBITRATION_OWNER_RECEIVE','description':'Owner\x20receive\x20(unwrap\x20received\x20Coin/Object\x20and\x20send\x20to\x20Permission\x20owner)','governed_operations':['owner\x20receipt\x20of\x20payments\x20(unwrapped\x20to\x20the\x20owner)','owner\x20receipt\x20of\x20whole\x20objects']},{'index':0x170,'name':'ARBITRATION_UM','description':'Set\x20/\x20clear\x20User\x20Manager\x20(Contact\x20object)','governed_operations':['bind\x20a\x20Contact\x20as\x20the\x20UM\x20coordinator','unbind\x20the\x20UM\x20Contact']}];export const DUAL_GUARD_MATRIX=[{'voting_guard_empty':!![],'usage_guard_empty':!![],'dispute_method':'dispute','vote_method':'vote','scenario':'Open\x20dispute\x20+\x20open\x20voting\x20(1\x20person\x201\x20vote)'},{'voting_guard_empty':!![],'usage_guard_empty':![],'dispute_method':'dispute_via_passport','vote_method':'vote','scenario':'Restricted\x20dispute\x20+\x20open\x20voting'},{'voting_guard_empty':![],'usage_guard_empty':!![],'dispute_method':'dispute','vote_method':'vote_weighted_by_guard','scenario':'Open\x20dispute\x20+\x20weighted\x20voting'},{'voting_guard_empty':![],'usage_guard_empty':![],'dispute_method':'dispute_via_passport','vote_method':'vote_weighted_by_guard','scenario':'Restricted\x20dispute\x20+\x20weighted\x20voting\x20(most\x20controlled)'}];export const ARBITRATION_SCENES=[{'id':'arbitration_create','name':'Create\x20new\x20Arbitration\x20service','operation_category':'lifecycle','permission_index':0x15e,'permission_name':'ARBITRATION_NEW','requires_voting_guard':'any','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['create\x20a\x20new\x20arbitration\x20service'],'common_patterns':['Pre-publish\x20config:\x20create\x20Arbitration\x20+\x20Permission\x20together','bPaused\x20defaults\x20to\x20true\x20—\x20must\x20call\x20pause(false)\x20to\x20enable','Generic\x20T:\x20choose\x20Coin\x20type\x20(e.g.\x200x2::wow::WOW)\x20at\x20creation','object-linker\x20binding\x20(core):\x20permission\x20+\x20arbitration\x20linked\x20by\x20an\x20affiliation\x20core\x20binding'],'recommended_templates':['T-AB-01','T-AB-02']},{'id':'arbitration_dispute','name':'File\x20dispute\x20against\x20an\x20Order\x20(creates\x20Arb\x20case)','operation_category':'dispute','permission_index':0x0,'permission_name':'(order\x20op\x20permission\x20—\x20no\x20ARBITRATION_*\x20index)','required_arb_status':[],'resulting_arb_status':'Arbitrator_confirming','requires_voting_guard':'any','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['file\x20a\x20dispute\x20against\x20an\x20Order\x20(creates\x20the\x20Arb\x20case)'],'common_patterns':['Fee\x20gate:\x20coin::value(&fee)\x20>=\x20self.fee,\x20else\x20E_FEE_NOT_ENOUGH','Order\x20op\x20permission\x20check\x20required\x20(caller\x20must\x20hold\x20the\x20matching\x20order\x20operation\x20permission)','Creates\x20independent\x20Arb<T>\x20object\x20with\x20its\x20own\x20lifecycle','If\x20usage_guard\x20is\x20Some\x20→\x20the\x20dispute\x20must\x20go\x20through\x20passport\x20verification','Order.dispute\x20list:\x20appends\x20new\x20Arb\x20(max\x2010\x20per\x20Order)','One-shot\x20filing:\x20the\x20Arb\x20is\x20created\x20directly\x20in\x20Arbitrator_confirming\x20status\x20—\x20proposition\x20and\x20description\x20are\x20final\x20at\x20filing;\x20edits\x20require\x20the\x20arbitrator\x20to\x20reset\x20the\x20case\x20back\x20to\x20Principal_confirming\x20first.\x20Assemble\x20the\x20complete\x20proposition\x20before\x20calling\x20dispute.'],'recommended_templates':['T-AB-01','T-AB-03','T-AB-04']},{'id':'arbitration_vote','name':'Vote\x20on\x20Arb\x20propositions','operation_category':'voting','permission_index':0x166,'permission_name':'ARBITRATION_VOTE','required_arb_status':['Voting'],'requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['open\x20a\x20vote\x20(1\x20person\x201\x20vote)','cast\x20a\x20weighted\x20vote\x20(weights\x20resolved\x20from\x20the\x20voting\x20guard)'],'common_patterns':['Open\x20vote:\x20voting_guard\x20empty\x20→\x20plain\x20vote\x20(passport\x20variant\x20supported);\x20equal\x20weight\x20'+'(1\x20person\x201\x20vote)\x20but\x20still\x20requires\x20permission\x20358\x20for\x20EVERY\x20voter\x20—\x20grant\x20358\x20to\x20both\x20'+'disputing\x20parties,\x20otherwise\x20no\x20one\x20can\x20vote\x20(E-13)','Weighted\x20vote:\x20voting_guard\x20non-empty\x20→\x20vote\x20weight\x20resolved\x20per\x20voting\x20guard','votes:\x20u8\x20array\x20—\x20index\x20into\x20proposition\x20list\x20(0..N-1)','Mismatch:\x20vote()\x20with\x20non-empty\x20voting_guard\x20→\x20E_VOTING_GUARD_USED','Guard\x20not\x20in\x20list:\x20E_VOTING_GUARD_NOT_FOUND','E-15:\x20the\x20voting_deadline\x20IS\x20the\x20dispute-resolution\x20delay\x20window\x20—\x20the\x20ruling\x20(arbitration)\x20'+'aborts\x20with\x20E_VOTING_DEADLINE_NOT_PASSED\x20until\x20the\x20deadline\x20elapses.\x20Size\x20the\x20window\x20to\x20the\x20'+'business\x20expectation\x20(e.g.\x2010\x20minutes\x20for\x20tests,\x20days\x20for\x20production)'],'recommended_templates':['T-AB-02','T-AB-03']},{'id':'arbitration_confirm','name':'Confirm\x20principal\x20materials\x20and\x20start\x20voting\x20phase','operation_category':'ruling','permission_index':0x169,'permission_name':'ARBITRATION_CONFIRM','required_arb_status':['Arbitrator_confirming'],'resulting_arb_status':'Voting','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['confirm\x20the\x20principal\x27s\x20materials\x20(starts\x20the\x20voting\x20phase)'],'common_patterns':['Transitions\x20Arb\x20from\x20Arbitrator_confirming\x20→\x20Voting','voting_deadline:\x20u64\x20timestamp_ms\x20(null\x20=\x20no\x20deadline)','Once\x20in\x20Voting,\x20only\x20vote\x20/\x20voting_deadline_change\x20/\x20reset\x20allowed'],'recommended_templates':['T-AB-01','T-AB-02']},{'id':'arbitration_feedback','name':'Provide\x20feedback\x20on\x20Arb\x20case','operation_category':'ruling','permission_index':0x168,'permission_name':'ARBITRATION_FEEDBACK','required_arb_status':['Principal_confirming','Arbitrator_confirming','Voting','Arbitrated','Objectionable'],'requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['attach\x20feedback\x20to\x20the\x20Arb\x20case'],'common_patterns':['Feedback\x20is\x20informational\x20—\x20does\x20not\x20change\x20Arb\x20status','Used\x20by\x20principal\x20/\x20arbitrator\x20/\x20voters\x20to\x20attach\x20notes','No\x20state\x20transition;\x20supplements\x20the\x20case\x20record'],'recommended_templates':['T-AB-01','T-AB-07']},{'id':'arbitration_ruling','name':'Make\x20definitive\x20arbitration\x20ruling\x20with\x20indemnity','operation_category':'ruling','permission_index':0x167,'permission_name':'ARBITRATION_ARBITRATION','required_arb_status':['Voting'],'resulting_arb_status':'Arbitrated','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['issue\x20the\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)'],'common_patterns':['Ruling\x20produces:\x20feedback\x20(string)\x20+\x20indemnity\x20(u64)','indemnity\x20is\x20compensation\x20amount\x20—\x20paid\x20through\x20the\x20order\x20compensation\x20flow','compensation\x20is\x20package-internal\x20—\x20only\x20the\x20order\x20lifecycle\x20can\x20trigger\x20it','Once\x20Arbitrated,\x20case\x20enters\x20Objectionable\x20window\x20(reset\x20possible)','E-16:\x20the\x20indemnity\x20is\x20paid\x20from\x20the\x20SERVICE\x27s\x20merchant-prepaid\x20compensation_fund\x20pool,\x20'+'NOT\x20from\x20the\x20order\x20escrow.\x20If\x20the\x20pool\x20is\x20smaller\x20than\x20the\x20indemnity,\x20arb_claim_compensation\x20'+'aborts\x20with\x20code\x2027\x20(E_COMPENSATION_NOT_MATCH)\x20—\x20the\x20ruling\x20stands\x20but\x20is\x20unpayable\x20until\x20the\x20'+'merchant\x20tops\x20up\x20(the\x20abort\x20does\x20NOT\x20consume\x20the\x20claim)','E-17/E-17b:\x20the\x20ruling\x20does\x20NOT\x20propagate\x20to\x20the\x20Machine/Allocation\x20escrow,\x20so\x20a\x20settlement\x20'+'forward\x20can\x20still\x20FIRE\x20after\x20a\x20claim.\x20But\x20the\x20order\x20has\x20SEALED\x20itself:\x20compensate()\x20sets\x20'+'claimed_by\x20(single-use,\x20E_ORDER_ALREADY_CLAIMED),\x20and\x20both\x20owner_receive\x20entries\x20assert\x20'+'claimed_by\x20is\x20none\x20—\x20so\x20any\x20escrow\x20the\x20refund\x20track\x20splits\x20after\x20the\x20claim\x20is\x20UNCLAIMABLE\x20by\x20'+'anyone.\x20The\x20provider\x20release\x20track\x20(direct\x20transfer)\x20stays\x20usable.\x20So\x20\x27accept\x20both\x20payouts\x27\x20is\x20'+'NOT\x20available\x20by\x20default:\x20claim\x20→\x20refund\x20is\x20closed\x20by\x20the\x20seal;\x20only\x20refund\x20→\x20claim\x20stacks,\x20and\x20'+'that\x20direction\x20is\x20the\x20ARBITRATOR\x27S\x20to\x20net\x20(see\x20the\x20netting\x20rule)\x20or\x20the\x20merchant\x27s\x20to\x20gate\x20'+'(refund\x20allocator\x20Guard\x20on\x20order.claimed_by).\x20RULED-ZERO\x20SEAL\x20(BKN-P1,\x20decision\x20option\x20a):\x20'+'the\x20seal\x20is\x20amount-insensitive\x20—\x20a\x20ZERO-award\x20ruling\x20also\x20writes\x20claimed_by\x20(the\x20ruling\x20operation\x20'+'checks\x20the\x20fund\x20balance\x20only,\x20no\x20amount\x20floor),\x20so\x20on\x20ruled-zero\x20the\x20buyer\x27s\x20refund\x20leg\x20'+'(claimed_by\x20none)\x20closes\x20even\x20though\x20nothing\x20was\x20paid,\x20and\x20the\x20merchant-recovery\x20leg\x20'+'(claimed_by\x20some)\x20becomes\x20the\x20only\x20escrow\x20exit\x20—\x20the\x20principal\x20exits\x20to\x20the\x20MERCHANT,\x20not\x20'+'the\x20buyer.\x20The\x20pairing\x20guarantees\x20no\x20stranding,\x20not\x20no-misallocation:\x20award-amount\x20polarity\x20'+'is\x20not\x20expressible\x20on\x20the\x20refund\x20track\x20(long-term:\x20N-9\x20order-authority\x20model\x20window)'],'recommended_templates':['T-AB-01','T-AB-05']},{'id':'arbitration_reset','name':'Reset\x20arbitration\x20—\x20principal\x20resubmits\x20materials','operation_category':'ruling','permission_index':0x16b,'permission_name':'ARBITRATION_RESET','required_arb_status':['Objectionable','Arbitrator_confirming'],'resulting_arb_status':'Principal_confirming','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['reset\x20the\x20arbitration\x20(principal\x20resubmits\x20materials)'],'common_patterns':['Resets\x20Arb\x20from\x20Objectionable/Arbitrator_confirming\x20→\x20Principal_confirming','Used\x20when\x20principal\x20objects\x20to\x20ruling\x20and\x20resubmits\x20materials','Feedback\x20required\x20(string\x20explaining\x20reset\x20reason)','Restart\x20full\x20lifecycle:\x20Principal_confirming\x20→\x20...\x20→\x20Finished'],'recommended_templates':['T-AB-07']},{'id':'arbitration_arb_withdraw','name':'Withdraw\x20arbitration\x20fees\x20from\x20Arb\x20into\x20Arbitration.balance','operation_category':'fund','permission_index':0x16c,'permission_name':'ARBITRATION_ARB_WITHDRAW','required_arb_status':['Finished','Arbitrated'],'requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['withdraw\x20arbitration\x20fees\x20from\x20the\x20Arb\x20into\x20Arbitration.balance'],'common_patterns':['Moves\x20fees\x20from\x20the\x20Arb\x20object\x20into\x20Arbitration.balance\x20(clock-checked)','Finished:\x20withdraw\x20immediately','Arbitrated:\x20must\x20wait\x20WITHDRAW_DURATION_TIME\x20(30d)\x20past\x20indemnity.time\x20—\x20silence\x20=\x20acceptance','Objectionable:\x20NEVER\x20withdrawable\x20(protocol\x20141)\x20—\x20the\x20fee\x20stays\x20escrowed\x20until\x20the\x20objection\x20cycle\x20is\x20closed\x20by\x20the\x20principal\x20re-confirming','Increases\x20Arbitration.balance\x20—\x20funds\x20available\x20for\x20fee\x20allocation/transfer'],'recommended_templates':['T-AB-06']},{'id':'arbitration_fees_alloc','name':'Allocate\x20arbitration\x20fees\x20to\x20Allocation\x20object','operation_category':'fund','permission_index':0x16d,'permission_name':'ARBITRATION_FEES_ALLOC','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['allocate\x20arbitration\x20fees\x20to\x20an\x20Allocation\x20object'],'common_patterns':['Destination:\x20Allocation\x20object\x20(parameterized\x20fund\x20distribution)','payment_remark\x20+\x20payment_index:\x20bookkeeping\x20for\x20Payment\x20object','May\x20create\x20new\x20Payment\x20object\x20if\x20newPayment\x20name\x20provided','Triggers\x20balance::withdraw_all\x20—\x20extracts\x20ALL\x20balance'],'recommended_templates':['T-AB-06']},{'id':'arbitration_fees_transfer','name':'Transfer\x20arbitration\x20fees\x20to\x20Treasury\x20object','operation_category':'fund','permission_index':0x16e,'permission_name':'ARBITRATION_FEES_TRANSFER','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['transfer\x20arbitration\x20fees\x20to\x20a\x20Treasury\x20object'],'common_patterns':['Destination:\x20Treasury\x20object\x20(general\x20fund\x20pool)','Same\x20bookkeeping\x20as\x20fee\x20allocation\x20(remark\x20+\x20index\x20+\x20newPayment)','Triggers\x20balance::withdraw_all\x20—\x20extracts\x20ALL\x20balance','Choose\x20Allocation\x20vs\x20Treasury\x20by\x20distribution\x20need'],'recommended_templates':['T-AB-06']},{'id':'arbitration_voting_guard_config','name':'Configure\x20voting_guard\x20list\x20(add\x20/\x20set\x20/\x20remove\x20/\x20clear)','operation_category':'guard','permission_index':0x162,'permission_name':'ARBITRATION_VOTING_GUARD','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['add\x20a\x20passport-identifier\x20voting\x20guard\x20(dynamic\x20weight)','add\x20a\x20fixed-weight\x20voting\x20guard','remove\x20a\x20voting\x20guard','clear\x20the\x20voting\x20guard\x20list'],'common_patterns':['Max\x2050\x20guards:\x20MAX_VOTING_GUARD_COUNT=50\x20(off-by-one-safe:\x20len<50\x20allows\x20add)','GuardIdentifier(u8):\x20dynamic\x20weight\x20from\x20Passport\x20submission\x20value','FixedValue(u32):\x20static\x20weight\x20(e.g.\x20100\x20votes\x20per\x20holder)','Add\x20same\x20guard\x20twice\x20→\x20updates\x20vote_weight\x20(no\x20duplicate)','op=\x27set\x27\x20=\x20clear\x20then\x20add;\x20op=\x27add\x27\x20=\x20append;\x20op=\x27remove\x27\x20=\x20by\x20address'],'recommended_templates':['T-AB-02','T-AB-03']},{'id':'arbitration_usage_guard_config','name':'Configure\x20usage_guard\x20(set\x20/\x20clear)','operation_category':'guard','permission_index':0x163,'permission_name':'ARBITRATION_USAGE_GUARD','requires_voting_guard':'not_applicable','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['set\x20the\x20usage\x20guard\x20(restrict\x20who\x20can\x20file\x20disputes)','clear\x20the\x20usage\x20guard'],'common_patterns':['Single\x20guard\x20(Option<address>)\x20—\x20not\x20a\x20list','Some(guard):\x20the\x20dispute\x20must\x20go\x20through\x20passport\x20verification','None:\x20dispute\x20can\x20use\x20either\x20variant\x20(no\x20passport\x20needed)','object-linker\x20affiliation\x20change:\x20updates\x20link\x20when\x20guard\x20changes'],'recommended_templates':['T-AB-04']},{'id':'arbitration_pause','name':'Pause\x20/\x20resume\x20Arbitration\x20service','operation_category':'lifecycle','permission_index':0x164,'permission_name':'ARBITRATION_PAUSE','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['pause/resume\x20the\x20arbitration\x20service'],'common_patterns':['bPaused\x20default\x20true\x20—\x20new\x20Arbitration\x20cannot\x20accept\x20disputes','pause(false)\x20to\x20enable,\x20pause(true)\x20to\x20disable','Paused\x20Arbitration\x20rejects\x20dispute\x20(E_PAUSED)','Does\x20not\x20affect\x20already-open\x20Arb\x20cases'],'recommended_templates':['T-AB-01']},{'id':'arbitration_service_statement','name':'Service\x20(defendant)\x20appends\x20a\x20text\x20statement\x20to\x20the\x20case\x20record','operation_category':'dispute','permission_index':0x141,'permission_name':'SERVICE_ARB_STATEMENT','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['append\x20the\x20seller\x27s\x20text\x20statement\x20to\x20a\x20case\x20against\x20an\x20order\x20of\x20the\x20service\x20(ArbStatementEvent)'],'common_patterns':['Defendant-side\x20voice\x20WITHOUT\x20holding\x20the\x20order\x20—\x20the\x20arb/arbitration\x20function\x20family\x20is\x20order-anchored;\x20this\x20entry\x20is\x20service-anchored','PRIMARY\x20evidence\x20channel\x20is\x20Messenger:\x20submit\x20encrypted\x20WTS\x20records\x20of\x20the\x20exchange\x20with\x20the\x20order\x20customer\x20first','This\x20statement\x20is\x20the\x20SECONDARY\x20channel:\x20declare\x20facts\x20or\x20report\x20customer\x20behavior\x20(absence,\x20non-cooperation)\x20on\x20the\x20case\x20record','Event-only:\x20nothing\x20on\x20the\x20Arb\x20object\x20is\x20mutated;\x20the\x20record\x20cannot\x20be\x20rewritten\x20or\x20deleted\x20by\x20any\x20party','Text\x20length\x20cap\x20identical\x20to\x20description/objection\x20(DESCRIPTION\x20bound,\x204000)'],'recommended_templates':[]}];export const ARBITRATION_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return ARBITRATION_SCENES['filter'](b=>b['operation_category']===a);}export function findSceneById(a){return ARBITRATION_SCENES['find'](b=>b['id']===a);}export function findSceneByPermissionIndex(a){return ARBITRATION_SCENES['find'](b=>b['permission_index']===a);}export function getPermissionByIndex(a){return ARBITRATION_PERMISSIONS['find'](b=>b['index']===a);}export function getPermissionByName(a){return ARBITRATION_PERMISSIONS['find'](b=>b['name']===a);}export function isReservedIndex(a){const b=getPermissionByIndex(a);return!!b?.['is_reserved'];}export function isUsedPermissionIndex(a){const b=getPermissionByIndex(a);return!!b&&!b['is_reserved'];}export function getActivePermissionCount(){return ARBITRATION_PERMISSIONS['filter'](a=>!a['is_reserved'])['length'];}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[{'keywords':['create','new'],'sceneId':'arbitration_create'},{'keywords':['dispute','file','complaint'],'sceneId':'arbitration_dispute'},{'keywords':['vote','voting','decide'],'sceneId':'arbitration_vote'},{'keywords':['confirm','materials'],'sceneId':'arbitration_confirm'},{'keywords':['feedback','opinion'],'sceneId':'arbitration_feedback'},{'keywords':['ruling','arbitration','verdict'],'sceneId':'arbitration_ruling'},{'keywords':['reset','resubmit'],'sceneId':'arbitration_reset'},{'keywords':['arb_withdraw','withdraw','withdraw\x20fees'],'sceneId':'arbitration_arb_withdraw'},{'keywords':['allocate','allocate\x20fees','fees\x20allocation'],'sceneId':'arbitration_fees_alloc'},{'keywords':['fees_transfer','transfer','transfer\x20in'],'sceneId':'arbitration_fees_transfer'},{'keywords':['voting_guard','voting\x20guard'],'sceneId':'arbitration_voting_guard_config'},{'keywords':['usage_guard','usage\x20guard'],'sceneId':'arbitration_usage_guard_config'},{'keywords':['pause','enable'],'sceneId':'arbitration_pause'}];for(const {keywords:d,sceneId:e}of c){if(d['some'](f=>b['includes'](f['toLowerCase']()))){const f=findSceneById(e);if(f)return f;}}return undefined;}export function getDualGuardMatrixEntry(a,b){return DUAL_GUARD_MATRIX['find'](c=>c['voting_guard_empty']===a&&c['usage_guard_empty']===b);}export function isValidArbStatusTransition(a,b){const c={'Principal_confirming':['Arbitrator_confirming'],'Arbitrator_confirming':['Voting','Principal_confirming'],'Voting':['Arbitrated'],'Arbitrated':['Objectionable','Finished','Withdrawn'],'Objectionable':['Principal_confirming'],'Finished':['Withdrawn'],'Withdrawn':[]};return c[a]?.['includes'](b)??![];}export function isTerminalArbStatus(a){return ARB_TERMINAL_STATUSES['includes'](a);}export function getScenesProducingStatus(a){return ARBITRATION_SCENES['filter'](b=>b['resulting_arb_status']===a);}export function getScenesRequiringStatus(a){return ARBITRATION_SCENES['filter'](b=>b['required_arb_status']?.['includes'](a));}export function getArbitrationScenesCount(){return ARBITRATION_SCENES['length'];}export function getAllArbitrationPermissions(){return[...ARBITRATION_PERMISSIONS];}export function getActiveArbitrationPermissions(){return ARBITRATION_PERMISSIONS['filter'](a=>!a['is_reserved']);}
|
|
1
|
+
export const ARB_STATUS_CODE={'Principal_confirming':0x0,'Arbitrator_confirming':0x1,'Voting':0x2,'Arbitrated':0x3,'Objectionable':0x4,'Finished':0x5,'Withdrawn':0x6};export const ARB_TERMINAL_STATUSES=['Finished','Withdrawn'];export const ARB_STATUS_ALIASES={'created':'Principal_confirming','voting':'Voting','feedback':'Arbitrator_confirming','confirmed':'Arbitrated','completed':'Finished','reset':'Objectionable','disputed':'Withdrawn'};export const ARBITRATION_PERMISSIONS=[{'index':0x15e,'name':'ARBITRATION_NEW','description':'Create\x20new\x20Arbitration\x20object','governed_operations':['create\x20a\x20new\x20arbitration\x20service']},{'index':0x15f,'name':'ARBITRATION_DESCRIPTION','description':'Modify\x20Arbitration\x20description','governed_operations':['modify\x20the\x20arbitration\x20description']},{'index':0x160,'name':'ARBITRATION_ENDPOINT','description':'Reserved\x20placeholder\x20—\x20not\x20used\x20on-chain\x20(SDK\x20commented\x20out)','governed_operations':[],'is_reserved':!![]},{'index':0x161,'name':'ARBITRATION_LOCATION','description':'Set\x20Arbitration\x20location','governed_operations':['set\x20the\x20arbitration\x20location']},{'index':0x162,'name':'ARBITRATION_VOTING_GUARD','description':'Manage\x20voting_guard\x20list\x20(add\x20/\x20remove\x20/\x20clear)\x20—\x20controls\x20vote\x20weight','governed_operations':['add\x20a\x20passport-identifier\x20voting\x20guard\x20(dynamic\x20weight)','add\x20a\x20fixed-weight\x20voting\x20guard','remove\x20a\x20voting\x20guard','clear\x20the\x20voting\x20guard\x20list']},{'index':0x163,'name':'ARBITRATION_USAGE_GUARD','description':'Set\x20/\x20clear\x20usage_guard\x20—\x20controls\x20who\x20can\x20file\x20disputes','governed_operations':['set\x20the\x20usage\x20guard\x20(restrict\x20who\x20can\x20file\x20disputes)','clear\x20the\x20usage\x20guard']},{'index':0x164,'name':'ARBITRATION_PAUSE','description':'Pause\x20/\x20resume\x20Arbitration\x20(bPaused\x20default\x20true)','governed_operations':['pause/resume\x20the\x20arbitration\x20service']},{'index':0x165,'name':'ARBITRATION_FEE','description':'Set\x20dispute\x20application\x20fee\x20(u64)','governed_operations':['set\x20the\x20dispute\x20application\x20fee']},{'index':0x166,'name':'ARBITRATION_VOTE','description':'Cast\x20a\x20vote.\x20With\x20an\x20EMPTY\x20voting_guard\x20this\x20is\x20an\x20equal-weight\x20vote\x20(1\x20person\x201\x20vote)\x20—\x20'+'NOT\x20permissionless:\x20plain\x20voting\x20asserts\x20permission\x20358\x20on\x20the\x20arbitration\x27s\x20bound\x20Permission,\x20'+'whose\x20admin\x20ALWAYS\x20passes\x20the\x20assert\x20(a\x20fresh\x20Permission\x20seeds\x20its\x20creator\x20as\x20the\x20sole\x20admin;\x20'+'the\x20table\x20starts\x20empty).\x20So\x20only\x20the\x20arb-side\x20admin\x20and\x20explicit\x20358\x20grantees\x20can\x20vote\x20—\x20the\x20'+'disputing\x20customer\x20must\x20be\x20GRANTED\x20358\x20first,\x20or\x20voting\x20collapses\x20to\x20admin-only\x20(E-13,\x20test/6)','governed_operations':['cast\x20a\x20vote\x20(empty\x20voting_guard\x20=\x201\x20person\x201\x20vote,\x20permission\x20358\x20still\x20required)','cast\x20a\x20weighted\x20vote\x20via\x20voting_guard\x20(weights\x20resolved\x20per\x20guard)']},{'index':0x167,'name':'ARBITRATION_ARBITRATION','description':'Make\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)','governed_operations':['issue\x20the\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)']},{'index':0x168,'name':'ARBITRATION_FEEDBACK','description':'Provide\x20feedback\x20on\x20Arb\x20case','governed_operations':['attach\x20feedback\x20to\x20the\x20Arb\x20case']},{'index':0x169,'name':'ARBITRATION_CONFIRM','description':'Confirm\x20materials\x20submitted\x20by\x20principal\x20(starts\x20voting\x20phase)','governed_operations':['confirm\x20the\x20principal\x27s\x20materials\x20(starts\x20the\x20voting\x20phase)']},{'index':0x16a,'name':'ARBITRATION_VOTING_DEADLINE_CHANGE','description':'Change\x20voting\x20deadline\x20for\x20an\x20Arb\x20case','governed_operations':['change\x20the\x20voting\x20deadline\x20for\x20an\x20Arb\x20case']},{'index':0x16b,'name':'ARBITRATION_RESET','description':'Reset\x20arbitration\x20—\x20principal\x20resubmits\x20materials,\x20restart\x20lifecycle','governed_operations':['reset\x20the\x20arbitration\x20(principal\x20resubmits\x20materials)']},{'index':0x16c,'name':'ARBITRATION_ARB_WITHDRAW','description':'Withdraw\x20arbitration\x20fees\x20from\x20Arb\x20into\x20Arbitration.balance','governed_operations':['withdraw\x20arbitration\x20fees\x20from\x20the\x20Arb\x20into\x20Arbitration.balance']},{'index':0x16d,'name':'ARBITRATION_FEES_ALLOC','description':'Allocate\x20arbitration\x20fees\x20to\x20Allocation\x20object','governed_operations':['allocate\x20arbitration\x20fees\x20to\x20an\x20Allocation\x20object']},{'index':0x16e,'name':'ARBITRATION_FEES_TRANSFER','description':'Transfer\x20arbitration\x20fees\x20to\x20Treasury\x20object','governed_operations':['transfer\x20arbitration\x20fees\x20to\x20a\x20Treasury\x20object']},{'index':0x16f,'name':'ARBITRATION_OWNER_RECEIVE','description':'Owner\x20receive\x20(unwrap\x20received\x20Coin/Object\x20and\x20send\x20to\x20Permission\x20owner)','governed_operations':['owner\x20receipt\x20of\x20payments\x20(unwrapped\x20to\x20the\x20owner)','owner\x20receipt\x20of\x20whole\x20objects']},{'index':0x170,'name':'ARBITRATION_UM','description':'Set\x20/\x20clear\x20User\x20Manager\x20(Contact\x20object)','governed_operations':['bind\x20a\x20Contact\x20as\x20the\x20UM\x20coordinator','unbind\x20the\x20UM\x20Contact']}];export const DUAL_GUARD_MATRIX=[{'voting_guard_empty':!![],'usage_guard_empty':!![],'dispute_method':'dispute','vote_method':'vote','scenario':'Open\x20dispute\x20+\x20open\x20voting\x20(1\x20person\x201\x20vote)'},{'voting_guard_empty':!![],'usage_guard_empty':![],'dispute_method':'dispute_via_passport','vote_method':'vote','scenario':'Restricted\x20dispute\x20+\x20open\x20voting'},{'voting_guard_empty':![],'usage_guard_empty':!![],'dispute_method':'dispute','vote_method':'vote_weighted_by_guard','scenario':'Open\x20dispute\x20+\x20weighted\x20voting'},{'voting_guard_empty':![],'usage_guard_empty':![],'dispute_method':'dispute_via_passport','vote_method':'vote_weighted_by_guard','scenario':'Restricted\x20dispute\x20+\x20weighted\x20voting\x20(most\x20controlled)'}];export const ARBITRATION_SCENES=[{'id':'arbitration_create','name':'Create\x20new\x20Arbitration\x20service','operation_category':'lifecycle','permission_index':0x15e,'permission_name':'ARBITRATION_NEW','requires_voting_guard':'any','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['create\x20a\x20new\x20arbitration\x20service'],'common_patterns':['Pre-publish\x20config:\x20create\x20Arbitration\x20+\x20Permission\x20together','bPaused\x20defaults\x20to\x20true\x20—\x20must\x20call\x20pause(false)\x20to\x20enable','Generic\x20T:\x20choose\x20Coin\x20type\x20(e.g.\x200x2::wow::WOW)\x20at\x20creation','object-linker\x20binding\x20(core):\x20permission\x20+\x20arbitration\x20linked\x20by\x20an\x20affiliation\x20core\x20binding'],'recommended_templates':['T-AB-01','T-AB-02']},{'id':'arbitration_dispute','name':'File\x20dispute\x20against\x20an\x20Order\x20(creates\x20Arb\x20case)','operation_category':'dispute','permission_index':0x0,'permission_name':'(order\x20op\x20permission\x20—\x20no\x20ARBITRATION_*\x20index)','required_arb_status':[],'resulting_arb_status':'Arbitrator_confirming','requires_voting_guard':'any','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['file\x20a\x20dispute\x20against\x20an\x20Order\x20(creates\x20the\x20Arb\x20case)'],'common_patterns':['Fee\x20gate:\x20coin::value(&fee)\x20>=\x20self.fee,\x20else\x20E_FEE_NOT_ENOUGH','Order\x20op\x20permission\x20check\x20required\x20(caller\x20must\x20hold\x20the\x20matching\x20order\x20operation\x20permission)','Creates\x20independent\x20Arb<T>\x20object\x20with\x20its\x20own\x20lifecycle','If\x20usage_guard\x20is\x20Some\x20→\x20the\x20dispute\x20must\x20go\x20through\x20passport\x20verification','Order.dispute\x20list:\x20appends\x20new\x20Arb\x20(max\x2010\x20per\x20Order)','One-shot\x20filing:\x20the\x20Arb\x20is\x20created\x20directly\x20in\x20Arbitrator_confirming\x20status\x20—\x20proposition\x20and\x20description\x20are\x20final\x20at\x20filing;\x20edits\x20require\x20the\x20arbitrator\x20to\x20reset\x20the\x20case\x20back\x20to\x20Principal_confirming\x20first.\x20Assemble\x20the\x20complete\x20proposition\x20before\x20calling\x20dispute.'],'recommended_templates':['T-AB-01','T-AB-03','T-AB-04']},{'id':'arbitration_vote','name':'Vote\x20on\x20Arb\x20propositions','operation_category':'voting','permission_index':0x166,'permission_name':'ARBITRATION_VOTE','required_arb_status':['Voting'],'requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['open\x20a\x20vote\x20(1\x20person\x201\x20vote)','cast\x20a\x20weighted\x20vote\x20(weights\x20resolved\x20from\x20the\x20voting\x20guard)'],'common_patterns':['Open\x20vote:\x20voting_guard\x20empty\x20→\x20plain\x20vote\x20(passport\x20variant\x20supported);\x20equal\x20weight\x20'+'(1\x20person\x201\x20vote)\x20but\x20permission\x20358\x20still\x20gates\x20every\x20NON-admin\x20voter\x20—\x20the\x20bound\x20'+'Permission\x27s\x20admin\x20(its\x20creator,\x20by\x20default)\x20always\x20passes,\x20so\x20grant\x20358\x20to\x20the\x20disputing\x20'+'parties\x20or\x20voting\x20collapses\x20to\x20admin-only\x20(E-13)','Weighted\x20vote:\x20voting_guard\x20non-empty\x20→\x20vote\x20weight\x20resolved\x20per\x20voting\x20guard','votes:\x20u8\x20array\x20—\x20index\x20into\x20proposition\x20list\x20(0..N-1)','Mismatch:\x20vote()\x20with\x20non-empty\x20voting_guard\x20→\x20E_VOTING_GUARD_USED','Guard\x20not\x20in\x20list:\x20E_VOTING_GUARD_NOT_FOUND','E-15:\x20the\x20voting_deadline\x20IS\x20the\x20dispute-resolution\x20delay\x20window\x20—\x20the\x20ruling\x20(arbitration)\x20'+'aborts\x20with\x20E_VOTING_DEADLINE_NOT_PASSED\x20until\x20the\x20deadline\x20elapses.\x20Size\x20the\x20window\x20to\x20the\x20'+'business\x20expectation\x20(e.g.\x2010\x20minutes\x20for\x20tests,\x20days\x20for\x20production)'],'recommended_templates':['T-AB-02','T-AB-03']},{'id':'arbitration_confirm','name':'Confirm\x20principal\x20materials\x20and\x20start\x20voting\x20phase','operation_category':'ruling','permission_index':0x169,'permission_name':'ARBITRATION_CONFIRM','required_arb_status':['Arbitrator_confirming'],'resulting_arb_status':'Voting','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['confirm\x20the\x20principal\x27s\x20materials\x20(starts\x20the\x20voting\x20phase)'],'common_patterns':['Transitions\x20Arb\x20from\x20Arbitrator_confirming\x20→\x20Voting','voting_deadline:\x20u64\x20timestamp_ms\x20(null\x20=\x20no\x20deadline)','Once\x20in\x20Voting,\x20only\x20vote\x20/\x20voting_deadline_change\x20/\x20reset\x20allowed'],'recommended_templates':['T-AB-01','T-AB-02']},{'id':'arbitration_feedback','name':'Provide\x20feedback\x20on\x20Arb\x20case','operation_category':'ruling','permission_index':0x168,'permission_name':'ARBITRATION_FEEDBACK','required_arb_status':['Principal_confirming','Arbitrator_confirming','Voting','Arbitrated','Objectionable'],'requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['attach\x20feedback\x20to\x20the\x20Arb\x20case'],'common_patterns':['Feedback\x20is\x20informational\x20—\x20does\x20not\x20change\x20Arb\x20status','Used\x20by\x20principal\x20/\x20arbitrator\x20/\x20voters\x20to\x20attach\x20notes','No\x20state\x20transition;\x20supplements\x20the\x20case\x20record'],'recommended_templates':['T-AB-01','T-AB-07']},{'id':'arbitration_ruling','name':'Make\x20definitive\x20arbitration\x20ruling\x20with\x20indemnity','operation_category':'ruling','permission_index':0x167,'permission_name':'ARBITRATION_ARBITRATION','required_arb_status':['Voting'],'resulting_arb_status':'Arbitrated','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['issue\x20the\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)'],'common_patterns':['Ruling\x20produces:\x20feedback\x20(string)\x20+\x20indemnity\x20(u64)','indemnity\x20is\x20compensation\x20amount\x20—\x20paid\x20through\x20the\x20order\x20compensation\x20flow','compensation\x20is\x20package-internal\x20—\x20only\x20the\x20order\x20lifecycle\x20can\x20trigger\x20it','Once\x20Arbitrated,\x20case\x20enters\x20Objectionable\x20window\x20(reset\x20possible)','E-16:\x20the\x20indemnity\x20is\x20paid\x20from\x20the\x20SERVICE\x27s\x20merchant-prepaid\x20compensation_fund\x20pool,\x20'+'NOT\x20from\x20the\x20order\x20escrow.\x20If\x20the\x20pool\x20is\x20smaller\x20than\x20the\x20indemnity,\x20arb_claim_compensation\x20'+'aborts\x20with\x20code\x2027\x20(E_COMPENSATION_NOT_MATCH)\x20—\x20the\x20ruling\x20stands\x20but\x20is\x20unpayable\x20until\x20the\x20'+'merchant\x20tops\x20up\x20(the\x20abort\x20does\x20NOT\x20consume\x20the\x20claim)','E-17/E-17b:\x20the\x20ruling\x20does\x20NOT\x20propagate\x20to\x20the\x20Machine/Allocation\x20escrow,\x20so\x20a\x20settlement\x20'+'forward\x20can\x20still\x20FIRE\x20after\x20a\x20claim.\x20But\x20the\x20order\x20has\x20SEALED\x20itself:\x20compensate()\x20sets\x20'+'claimed_by\x20(single-use,\x20E_ORDER_ALREADY_CLAIMED),\x20and\x20both\x20owner_receive\x20entries\x20assert\x20'+'claimed_by\x20is\x20none\x20—\x20so\x20any\x20escrow\x20the\x20refund\x20track\x20splits\x20after\x20the\x20claim\x20is\x20UNCLAIMABLE\x20by\x20'+'anyone.\x20The\x20provider\x20release\x20track\x20(direct\x20transfer)\x20stays\x20usable.\x20So\x20\x27accept\x20both\x20payouts\x27\x20is\x20'+'NOT\x20available\x20by\x20default:\x20claim\x20→\x20refund\x20is\x20closed\x20by\x20the\x20seal;\x20only\x20refund\x20→\x20claim\x20stacks,\x20and\x20'+'that\x20direction\x20is\x20the\x20ARBITRATOR\x27S\x20to\x20net\x20(see\x20the\x20netting\x20rule)\x20or\x20the\x20merchant\x27s\x20to\x20gate\x20'+'(refund\x20allocator\x20Guard\x20on\x20order.claimed_by).\x20RULED-ZERO\x20SEAL\x20(BKN-P1,\x20decision\x20option\x20a):\x20'+'the\x20seal\x20is\x20amount-insensitive\x20—\x20a\x20ZERO-award\x20ruling\x20also\x20writes\x20claimed_by\x20(the\x20ruling\x20operation\x20'+'checks\x20the\x20fund\x20balance\x20only,\x20no\x20amount\x20floor),\x20so\x20on\x20ruled-zero\x20the\x20buyer\x27s\x20refund\x20leg\x20'+'(claimed_by\x20none)\x20closes\x20even\x20though\x20nothing\x20was\x20paid,\x20and\x20the\x20merchant-recovery\x20leg\x20'+'(claimed_by\x20some)\x20becomes\x20the\x20only\x20escrow\x20exit\x20—\x20the\x20principal\x20exits\x20to\x20the\x20MERCHANT,\x20not\x20'+'the\x20buyer.\x20The\x20pairing\x20guarantees\x20no\x20stranding,\x20not\x20no-misallocation:\x20award-amount\x20polarity\x20'+'is\x20not\x20expressible\x20on\x20the\x20refund\x20track\x20(long-term:\x20N-9\x20order-authority\x20model\x20window)'],'recommended_templates':['T-AB-01','T-AB-05']},{'id':'arbitration_reset','name':'Reset\x20arbitration\x20—\x20principal\x20resubmits\x20materials','operation_category':'ruling','permission_index':0x16b,'permission_name':'ARBITRATION_RESET','required_arb_status':['Objectionable','Arbitrator_confirming'],'resulting_arb_status':'Principal_confirming','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['reset\x20the\x20arbitration\x20(principal\x20resubmits\x20materials)'],'common_patterns':['Resets\x20Arb\x20from\x20Objectionable/Arbitrator_confirming\x20→\x20Principal_confirming','Used\x20when\x20principal\x20objects\x20to\x20ruling\x20and\x20resubmits\x20materials','Feedback\x20required\x20(string\x20explaining\x20reset\x20reason)','Restart\x20full\x20lifecycle:\x20Principal_confirming\x20→\x20...\x20→\x20Finished'],'recommended_templates':['T-AB-07']},{'id':'arbitration_arb_withdraw','name':'Withdraw\x20arbitration\x20fees\x20from\x20Arb\x20into\x20Arbitration.balance','operation_category':'fund','permission_index':0x16c,'permission_name':'ARBITRATION_ARB_WITHDRAW','required_arb_status':['Finished','Arbitrated'],'requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['withdraw\x20arbitration\x20fees\x20from\x20the\x20Arb\x20into\x20Arbitration.balance'],'common_patterns':['Moves\x20fees\x20from\x20the\x20Arb\x20object\x20into\x20Arbitration.balance\x20(clock-checked)','Finished:\x20withdraw\x20immediately','Arbitrated:\x20must\x20wait\x20WITHDRAW_DURATION_TIME\x20(30d)\x20past\x20indemnity.time\x20—\x20silence\x20=\x20acceptance','Objectionable:\x20NEVER\x20withdrawable\x20(protocol\x20141)\x20—\x20the\x20fee\x20stays\x20escrowed\x20until\x20the\x20objection\x20cycle\x20is\x20closed\x20by\x20the\x20principal\x20re-confirming','Increases\x20Arbitration.balance\x20—\x20funds\x20available\x20for\x20fee\x20allocation/transfer'],'recommended_templates':['T-AB-06']},{'id':'arbitration_fees_alloc','name':'Allocate\x20arbitration\x20fees\x20to\x20Allocation\x20object','operation_category':'fund','permission_index':0x16d,'permission_name':'ARBITRATION_FEES_ALLOC','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['allocate\x20arbitration\x20fees\x20to\x20an\x20Allocation\x20object'],'common_patterns':['Destination:\x20Allocation\x20object\x20(parameterized\x20fund\x20distribution)','payment_remark\x20+\x20payment_index:\x20bookkeeping\x20for\x20Payment\x20object','May\x20create\x20new\x20Payment\x20object\x20if\x20newPayment\x20name\x20provided','Triggers\x20balance::withdraw_all\x20—\x20extracts\x20ALL\x20balance'],'recommended_templates':['T-AB-06']},{'id':'arbitration_fees_transfer','name':'Transfer\x20arbitration\x20fees\x20to\x20Treasury\x20object','operation_category':'fund','permission_index':0x16e,'permission_name':'ARBITRATION_FEES_TRANSFER','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['transfer\x20arbitration\x20fees\x20to\x20a\x20Treasury\x20object'],'common_patterns':['Destination:\x20Treasury\x20object\x20(general\x20fund\x20pool)','Same\x20bookkeeping\x20as\x20fee\x20allocation\x20(remark\x20+\x20index\x20+\x20newPayment)','Triggers\x20balance::withdraw_all\x20—\x20extracts\x20ALL\x20balance','Choose\x20Allocation\x20vs\x20Treasury\x20by\x20distribution\x20need'],'recommended_templates':['T-AB-06']},{'id':'arbitration_voting_guard_config','name':'Configure\x20voting_guard\x20list\x20(add\x20/\x20set\x20/\x20remove\x20/\x20clear)','operation_category':'guard','permission_index':0x162,'permission_name':'ARBITRATION_VOTING_GUARD','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['add\x20a\x20passport-identifier\x20voting\x20guard\x20(dynamic\x20weight)','add\x20a\x20fixed-weight\x20voting\x20guard','remove\x20a\x20voting\x20guard','clear\x20the\x20voting\x20guard\x20list'],'common_patterns':['Max\x2050\x20guards:\x20MAX_VOTING_GUARD_COUNT=50\x20(off-by-one-safe:\x20len<50\x20allows\x20add)','GuardIdentifier(u8):\x20dynamic\x20weight\x20from\x20Passport\x20submission\x20value','FixedValue(u32):\x20static\x20weight\x20(e.g.\x20100\x20votes\x20per\x20holder)','Add\x20same\x20guard\x20twice\x20→\x20updates\x20vote_weight\x20(no\x20duplicate)','op=\x27set\x27\x20=\x20clear\x20then\x20add;\x20op=\x27add\x27\x20=\x20append;\x20op=\x27remove\x27\x20=\x20by\x20address'],'recommended_templates':['T-AB-02','T-AB-03']},{'id':'arbitration_usage_guard_config','name':'Configure\x20usage_guard\x20(set\x20/\x20clear)','operation_category':'guard','permission_index':0x163,'permission_name':'ARBITRATION_USAGE_GUARD','requires_voting_guard':'not_applicable','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['set\x20the\x20usage\x20guard\x20(restrict\x20who\x20can\x20file\x20disputes)','clear\x20the\x20usage\x20guard'],'common_patterns':['Single\x20guard\x20(Option<address>)\x20—\x20not\x20a\x20list','Some(guard):\x20the\x20dispute\x20must\x20go\x20through\x20passport\x20verification','None:\x20dispute\x20can\x20use\x20either\x20variant\x20(no\x20passport\x20needed)','object-linker\x20affiliation\x20change:\x20updates\x20link\x20when\x20guard\x20changes'],'recommended_templates':['T-AB-04']},{'id':'arbitration_pause','name':'Pause\x20/\x20resume\x20Arbitration\x20service','operation_category':'lifecycle','permission_index':0x164,'permission_name':'ARBITRATION_PAUSE','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['pause/resume\x20the\x20arbitration\x20service'],'common_patterns':['bPaused\x20default\x20true\x20—\x20new\x20Arbitration\x20cannot\x20accept\x20disputes','pause(false)\x20to\x20enable,\x20pause(true)\x20to\x20disable','Paused\x20Arbitration\x20rejects\x20dispute\x20(E_PAUSED)','Does\x20not\x20affect\x20already-open\x20Arb\x20cases'],'recommended_templates':['T-AB-01']},{'id':'arbitration_service_statement','name':'Service\x20(defendant)\x20appends\x20a\x20text\x20statement\x20to\x20the\x20case\x20record','operation_category':'dispute','permission_index':0x141,'permission_name':'SERVICE_ARB_STATEMENT','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['append\x20the\x20seller\x27s\x20text\x20statement\x20to\x20a\x20case\x20against\x20an\x20order\x20of\x20the\x20service\x20(ArbStatementEvent)'],'common_patterns':['Defendant-side\x20voice\x20WITHOUT\x20holding\x20the\x20order\x20—\x20the\x20arb/arbitration\x20function\x20family\x20is\x20order-anchored;\x20this\x20entry\x20is\x20service-anchored','PRIMARY\x20evidence\x20channel\x20is\x20Messenger:\x20submit\x20encrypted\x20WTS\x20records\x20of\x20the\x20exchange\x20with\x20the\x20order\x20customer\x20first','This\x20statement\x20is\x20the\x20SECONDARY\x20channel:\x20declare\x20facts\x20or\x20report\x20customer\x20behavior\x20(absence,\x20non-cooperation)\x20on\x20the\x20case\x20record','Event-only:\x20nothing\x20on\x20the\x20Arb\x20object\x20is\x20mutated;\x20the\x20record\x20cannot\x20be\x20rewritten\x20or\x20deleted\x20by\x20any\x20party','Text\x20length\x20cap\x20identical\x20to\x20description/objection\x20(DESCRIPTION\x20bound,\x204000)'],'recommended_templates':[]}];export const ARBITRATION_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return ARBITRATION_SCENES['filter'](b=>b['operation_category']===a);}export function findSceneById(a){return ARBITRATION_SCENES['find'](b=>b['id']===a);}export function findSceneByPermissionIndex(a){return ARBITRATION_SCENES['find'](b=>b['permission_index']===a);}export function getPermissionByIndex(a){return ARBITRATION_PERMISSIONS['find'](b=>b['index']===a);}export function getPermissionByName(a){return ARBITRATION_PERMISSIONS['find'](b=>b['name']===a);}export function isReservedIndex(a){const b=getPermissionByIndex(a);return!!b?.['is_reserved'];}export function isUsedPermissionIndex(a){const b=getPermissionByIndex(a);return!!b&&!b['is_reserved'];}export function getActivePermissionCount(){return ARBITRATION_PERMISSIONS['filter'](a=>!a['is_reserved'])['length'];}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[{'keywords':['create','new'],'sceneId':'arbitration_create'},{'keywords':['dispute','file','complaint'],'sceneId':'arbitration_dispute'},{'keywords':['vote','voting','decide'],'sceneId':'arbitration_vote'},{'keywords':['confirm','materials'],'sceneId':'arbitration_confirm'},{'keywords':['feedback','opinion'],'sceneId':'arbitration_feedback'},{'keywords':['ruling','arbitration','verdict'],'sceneId':'arbitration_ruling'},{'keywords':['reset','resubmit'],'sceneId':'arbitration_reset'},{'keywords':['arb_withdraw','withdraw','withdraw\x20fees'],'sceneId':'arbitration_arb_withdraw'},{'keywords':['allocate','allocate\x20fees','fees\x20allocation'],'sceneId':'arbitration_fees_alloc'},{'keywords':['fees_transfer','transfer','transfer\x20in'],'sceneId':'arbitration_fees_transfer'},{'keywords':['voting_guard','voting\x20guard'],'sceneId':'arbitration_voting_guard_config'},{'keywords':['usage_guard','usage\x20guard'],'sceneId':'arbitration_usage_guard_config'},{'keywords':['pause','enable'],'sceneId':'arbitration_pause'}];for(const {keywords:d,sceneId:e}of c){if(d['some'](f=>b['includes'](f['toLowerCase']()))){const f=findSceneById(e);if(f)return f;}}return undefined;}export function getDualGuardMatrixEntry(a,b){return DUAL_GUARD_MATRIX['find'](c=>c['voting_guard_empty']===a&&c['usage_guard_empty']===b);}export function isValidArbStatusTransition(a,b){const c={'Principal_confirming':['Arbitrator_confirming'],'Arbitrator_confirming':['Voting','Principal_confirming'],'Voting':['Arbitrated'],'Arbitrated':['Objectionable','Finished','Withdrawn'],'Objectionable':['Principal_confirming'],'Finished':['Withdrawn'],'Withdrawn':[]};return c[a]?.['includes'](b)??![];}export function isTerminalArbStatus(a){return ARB_TERMINAL_STATUSES['includes'](a);}export function getScenesProducingStatus(a){return ARBITRATION_SCENES['filter'](b=>b['resulting_arb_status']===a);}export function getScenesRequiringStatus(a){return ARBITRATION_SCENES['filter'](b=>b['required_arb_status']?.['includes'](a));}export function getArbitrationScenesCount(){return ARBITRATION_SCENES['length'];}export function getAllArbitrationPermissions(){return[...ARBITRATION_PERMISSIONS];}export function getActiveArbitrationPermissions(){return ARBITRATION_PERMISSIONS['filter'](a=>!a['is_reserved']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ARBITRATION_ACTIVATION_NOTES=['ACTIVATION:\x20a\x20newly\x20created\x20Arbitration\x20is\x20born\x20PAUSED\x20(bPaused=true).\x20This\x20template\x20passes\x20pause:false\x20in\x20the\x20create\x20payload\x20to\x20unpause\x20in\x20the\x20SAME\x20transaction\x20(the\x20creator\x20is\x20an\x20admin\x20of\x20the\x20new\x20Permission,\x20so\x20the\x20356\x20check\x20passes).\x20If\x20the\x20unpause\x20is\x20skipped,\x20no\x20dispute\x20can\x20be\x20filed\x20(E_PAUSED)\x20until\x20a\x20separate\x20{operation_type:\x27arbitration\x27,\x20data:{object:\x27<arb>\x27,\x20pause:false}}\x20is\x20issued.','PERMISSIONS:\x20a\x20freshly\x20created\x20Arbitration\x20has\x20an\x20EMPTY\x20permission\x20table\x20—\x20every\x20operation\x20aborts\x20with\x20\x27Missing\x20permission\x27\x20(code\x205)\x20until\x20grants\x20are\x20issued\x20via\x20its\x20Permission\x20object:\x20356\x20(pause/unpause),\x20358\x20(vote),\x20359\x20(issue\x20ruling),\x20361\x20(arbitrator\x20material\x20confirm),\x20plus\x20357/362/363/364-368\x20(fee\x20/\x20deadline\x20/\x20reset\x20/\x20withdraw\x20/\x20receive).','OPEN\x20VOTE\x20IS\x20NOT\x20PERMISSIONLESS:\x20an\x20empty\x20voting_guard\x20means\x20EQUAL\x20WEIGHT\x20(1\x20person\x201\x20vote),\x20but\x20vote()\x20still\x20asserts\x20ARBITRATION_VOTE=358\x20—\x20\x27anyone\x20can\x20vote\x27\x20requires\x20granting\x20358\x20to\x20the\x20intended\x20voters\x20first.'];export const ARBITRATION_TEMPLATES=[{'id':'T-AB-01','name':'Single-arbiter\x20quick\x20ruling','description':'Simplest\x20Arbitration:\x20one\x20arbiter\x20makes\x20all\x20rulings.\x20voting_guard\x20empty\x20(open\x20vote,\x20but\x20only\x20arbiter\x20has\x20358\x20perm).\x20Suitable\x20for\x20small-scale\x20/\x20fast\x20dispute\x20resolution.','applicable_scenes':['arbitration_create','arbitration_ruling','arbitration_confirm'],'industry_tags':['retail','freelance','small_business'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner\x20(also\x20admin)','required':!![]},{'name':'arbiter_address','type':'address','description':'Single\x20arbiter\x20address\x20(gets\x20ARBITRATION_VOTE=358\x20+\x20ARBITRATION_ARBITRATION=359)','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type\x20for\x20arbitration\x20fee\x20(e.g.\x200x2::wow::WOW)','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20application\x20fee\x20(u64,\x20in\x20Coin\x20base\x20units)','required':![],'default':0x0},{'name':'arbitration_name','type':'string','description':'Local\x20name\x20for\x20the\x20Arbitration\x20object','required':![]}],'body':a=>({'object':{'name':a['arbitration_name']??'single_arb_arbitration','type_parameter':a['coin_type'],'permission':{'name':(a['arbitration_name']??'single_arb')+'_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x0),'pause':![]}),'notes':['voting_guard\x20remains\x20empty\x20→\x20vote()\x20uses\x20open\x20vote\x20(1\x20person\x201\x20vote)','Only\x20arbiter_address\x20should\x20be\x20granted\x20ARBITRATION_VOTE\x20(358)\x20+\x20ARBITRATION_ARBITRATION\x20(359)','Fast\x20ruling:\x20arbiter\x20confirms\x20materials\x20→\x20votes\x20→\x20makes\x20ruling\x20in\x20one\x20session','Not\x20suitable\x20for\x20high-value\x20disputes\x20(no\x20consensus\x20check)',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-02','name':'Multi-arbiter\x20voting\x20(weighted)','description':'Multiple\x20arbiters\x20vote\x20with\x20weighted\x20voting_guard.\x20Each\x20arbiter\x27s\x20Guard\x20has\x20FixedValue\x20weight.\x20Ruling\x20requires\x20majority\x20weight.','applicable_scenes':['arbitration_create','arbitration_vote','arbitration_voting_guard_config'],'industry_tags':['governance','dao','committee'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner','required':!![]},{'name':'arbiter_guards','type':'string[]','description':'Guard\x20addresses\x20for\x20each\x20arbiter\x20(will\x20be\x20added\x20to\x20voting_guard)','required':!![]},{'name':'vote_weights','type':'string[]','description':'FixedValue\x20weights\x20for\x20each\x20arbiter\x20(parallel\x20to\x20arbiter_guards)','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20fee','required':![],'default':0x0}],'body':a=>{const b=a['arbiter_guards']['map']((c,d)=>({'guard':c,'vote_weight':{'FixedValue':Number(a['vote_weights'][d]??0x1)}}));return{'object':{'name':'weighted_arbitration','type_parameter':a['coin_type'],'permission':{'name':'weighted_arb_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x0),'pause':![],'voting_guard':{'op':'set','guards':b}};},'notes':['voting_guard\x20non-empty\x20→\x20votes\x20MUST\x20be\x20submitted\x20via\x20the\x20Passport-verified\x20voting\x20path','Each\x20arbiter\x27s\x20Guard\x20must\x20be\x20a\x20valid\x20Guard\x20object\x20they\x20can\x20submit\x20Passport\x20for','Consider:\x20max(arbiter_weights)\x20/\x20total_weights\x20<\x200.5\x20to\x20avoid\x20collusion\x20(see\x20R-AB-3-01)','Max\x2050\x20voting_guards\x20(MAX_VOTING_GUARD_COUNT)',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-03','name':'Public\x20voting\x20arbitration','description':'voting_guard\x20allows\x20public\x20to\x20vote\x20(anyone\x20with\x20a\x20Guard\x20can\x20vote).\x20Suitable\x20for\x20community-driven\x20dispute\x20resolution.','applicable_scenes':['arbitration_create','arbitration_vote','arbitration_voting_guard_config'],'industry_tags':['community','public_goods','social'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner','required':!![]},{'name':'public_guard','type':'address','description':'Guard\x20address\x20anyone\x20can\x20submit\x20Passport\x20for\x20(e.g.\x20based\x20on\x20account\x20existence)','required':!![]},{'name':'vote_weight','type':'number','description':'FixedValue\x20weight\x20per\x20public\x20voter\x20(e.g.\x201)','required':![],'default':0x1},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]}],'body':a=>({'object':{'name':'public_arbitration','type_parameter':a['coin_type'],'permission':{'name':'public_arb_permission'}},'description':a['description'],'fee':'0','pause':![],'voting_guard':{'op':'set','guards':[{'guard':a['public_guard'],'vote_weight':{'FixedValue':Number(a['vote_weight']??0x1)}}]}}),'notes':['Public\x20voting:\x20anyone\x20holding\x20the\x20public_guard\x20can\x20vote','Consider\x20using\x20GuardIdentifier\x20(dynamic\x20weight)\x20for\x20token-weighted\x20voting','Low/zero\x20fee\x20to\x20encourage\x20participation\x20—\x20but\x20watch\x20for\x20spam\x20disputes','Suitable\x20for\x20community\x20moderation,\x20content\x20disputes,\x20public\x20goods\x20arbitration',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-04','name':'Scope-restricted\x20arbitration','description':'usage_guard\x20filters\x20which\x20disputes\x20can\x20be\x20filed.\x20Only\x20users\x20passing\x20the\x20Guard\x20can\x20file\x20disputes.\x20Suitable\x20for\x20verified-merchant\x20/\x20KYC\x20arbitration.','applicable_scenes':['arbitration_create','arbitration_usage_guard_config','arbitration_dispute'],'industry_tags':['kyc','verified_merchant','enterprise'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner','required':!![]},{'name':'usage_guard_address','type':'address','description':'Guard\x20address\x20that\x20filters\x20who\x20can\x20file\x20disputes\x20(KYC/verification)','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'arbiter_address','type':'address','description':'Arbiter\x20address\x20(single\x20arbiter\x20for\x20simplicity)','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20fee\x20(higher\x20to\x20deter\x20spam)','required':![],'default':0x3b9aca00}],'body':a=>({'object':{'name':'restricted_arbitration','type_parameter':a['coin_type'],'permission':{'name':'restricted_arb_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x3b9aca00),'pause':![],'usage_guard':a['usage_guard_address']}),'notes':['usage_guard\x20set\x20→\x20disputes\x20MUST\x20be\x20filed\x20via\x20the\x20Passport-verified\x20dispute\x20variant','Guard\x20verifies:\x20KYC\x20/\x20membership\x20/\x20token-balance\x20/\x20etc.','Higher\x20fee\x20(default\x201\x20WOW)\x20to\x20deter\x20spam\x20from\x20verified\x20users','Arbiter\x20should\x20also\x20be\x20Guard-verified\x20for\x20consistency',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-05','name':'Arbitration\x20committee','description':'Multi-arbiter\x20committee\x20with\x20weighted\x20voting\x20+\x20usage_guard.\x20Most\x20controlled\x20configuration\x20—\x20restricted\x20dispute\x20filing\x20+\x20weighted\x20voting\x20+\x20multi-arbiter\x20ruling.','applicable_scenes':['arbitration_create','arbitration_voting_guard_config','arbitration_usage_guard_config','arbitration_ruling'],'industry_tags':['enterprise','legal','high_value'],'params':[{'name':'owner_address','type':'address','description':'Committee\x20owner','required':!![]},{'name':'committee_guards','type':'string[]','description':'Guard\x20addresses\x20for\x20each\x20committee\x20member','required':!![]},{'name':'member_weights','type':'string[]','description':'Vote\x20weights\x20for\x20each\x20member\x20(parallel\x20to\x20committee_guards)','required':!![]},{'name':'membership_guard','type':'address','description':'usage_guard\x20for\x20dispute\x20filing\x20(membership\x20verification)','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20fee\x20(high\x20for\x20high-value\x20disputes)','required':![],'default':0x2540be400}],'body':a=>{const b=a['committee_guards']['map']((c,d)=>({'guard':c,'vote_weight':{'FixedValue':Number(a['member_weights'][d]??0x1)}}));return{'object':{'name':'committee_arbitration','type_parameter':a['coin_type'],'permission':{'name':'committee_arb_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x2540be400),'pause':![],'voting_guard':{'op':'set','guards':b},'usage_guard':a['membership_guard']};},'notes':['Most\x20restrictive\x20config:\x20weighted\x20voting\x20+\x20restricted\x20filing','Suitable\x20for\x20high-value\x20B2B\x20disputes,\x20legal\x20arbitration,\x20enterprise\x20SLA\x20enforcement','Committee\x20members\x20should\x20have\x20clear\x20escalation\x20/\x20tiebreaker\x20rules','All\x20disputes\x20require\x20Passport\x20(both\x20filing\x20and\x20voting)',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-06','name':'Fee-split\x20arbitration','description':'Pre-configured\x20fee-distribution\x20destination.\x20After\x20the\x20fee\x20withdrawal\x20(364),\x20fees\x20are\x20automatically\x20distributed\x20to\x20the\x20Allocation\x20(for\x20arbiter\x20compensation).','applicable_scenes':['arbitration_create','arbitration_arb_withdraw','arbitration_fees_alloc'],'industry_tags':['marketplace','service','platform'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner','required':!![]},{'name':'allocation_address','type':'address','description':'Allocation\x20object\x20address\x20for\x20fee\x20distribution\x20to\x20arbiters','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'arbiter_address','type':'address','description':'Arbiter\x20(single\x20for\x20simplicity)','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20fee\x20(will\x20be\x20split\x20to\x20arbiters\x20via\x20Allocation)','required':![],'default':0x12a05f200}],'body':a=>({'object':{'name':'feesplit_arbitration','type_parameter':a['coin_type'],'permission':{'name':'feesplit_arb_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x12a05f200),'pause':![]}),'notes':['Fee-split\x20is\x20a\x202-step\x20process:\x20withdraw\x20fees\x20from\x20the\x20Arb\x20object\x20(364)\x20→\x20transfer\x20them\x20out\x20of\x20the\x20Arbitration\x20balance\x20(365/366)','Fee\x20withdrawal\x20(364)\x20moves\x20fees\x20from\x20the\x20Arb\x20object\x20into\x20the\x20Arbitration\x20balance','Fee\x20distribution\x20(365)\x20or\x20the\x20balance\x20transfer\x20(366)\x20moves\x20fees\x20to\x20the\x20Allocation/Treasury','Allocation\x20policy\x20determines\x20how\x20fees\x20are\x20split\x20among\x20arbiters','Payment\x20object\x20is\x20created\x20for\x20bookkeeping\x20(payment_remark\x20+\x20payment_index)',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-07','name':'Appeal\x20arbitration\x20(reset\x20flow)','description':'Template\x20for\x20reset\x20operation\x20—\x20disputant\x20objects\x20to\x20ruling\x20and\x20resubmits\x20materials.\x20Restarts\x20Arb\x20lifecycle\x20from\x20Principal_confirming.','applicable_scenes':['arbitration_reset','arbitration_ruling'],'industry_tags':['legal','appeal','high_value'],'params':[{'name':'arbitration_object','type':'address','description':'Existing\x20Arbitration\x20object\x20address','required':!![]},{'name':'arb_address','type':'address','description':'Arb\x20object\x20address\x20to\x20reset\x20(must\x20be\x20in\x20Objectionable/Arbitrated\x20status)','required':!![]},{'name':'reset_feedback','type':'string','description':'Feedback\x20explaining\x20why\x20disputant\x20objects\x20to\x20the\x20ruling','required':!![]}],'body':a=>({'object':a['arbitration_object'],'reset':{'arb':a['arb_address'],'feedback':a['reset_feedback']}}),'notes':['Precondition:\x20Arb\x20must\x20be\x20in\x20Objectionable\x20(4)\x20or\x20Arbitrated\x20(3)\x20status','Post-condition:\x20Arb\x20status\x20→\x20Principal_confirming\x20(0),\x20lifecycle\x20restarts','Original\x20ruling\x20is\x20invalidated\x20—\x20new\x20voting\x20+\x20ruling\x20required','Consider\x20capping\x20reset\x20count\x20to\x20prevent\x20infinite\x20appeals','reset\x20feedback\x20is\x20permanent\x20—\x20recorded\x20on-chain\x20for\x20audit\x20trail']}];export const ARBITRATION_TEMPLATES_VERSION='1.0.0';export function getAllTemplates(){return[...ARBITRATION_TEMPLATES];}export function getTemplateById(a){return ARBITRATION_TEMPLATES['find'](b=>b['id']===a);}export function getTemplatesByScene(a){return ARBITRATION_TEMPLATES['filter'](b=>b['applicable_scenes']['includes'](a));}export function getTemplatesByIndustry(a){return ARBITRATION_TEMPLATES['filter'](b=>b['industry_tags']['includes'](a)||b['industry_tags']['includes']('universal'));}export function suggestTemplateForScene(a){const b=getTemplatesByScene(a);return b['length']>0x0?b[0x0]:undefined;}export function listTemplates(){return ARBITRATION_TEMPLATES['map'](a=>({'id':a['id'],'name':a['name'],'description':a['description'],'scenes':a['applicable_scenes']}));}export function fillTemplate(a,b){const c=getTemplateById(a);if(!c)return{'ok':![],'error':'Template\x20'+a+'\x20not\x20found'};for(const d of c['params']){if(d['required']&&!(d['name']in b))return{'ok':![],'error':'Missing\x20required\x20param:\x20'+d['name']};}return{'ok':!![],'body':c['body'](b)};}
|
|
1
|
+
export const ARBITRATION_ACTIVATION_NOTES=['ACTIVATION:\x20a\x20newly\x20created\x20Arbitration\x20is\x20born\x20PAUSED\x20(bPaused=true).\x20This\x20template\x20passes\x20pause:false\x20in\x20the\x20create\x20payload\x20to\x20unpause\x20in\x20the\x20SAME\x20transaction\x20(the\x20creator\x20is\x20an\x20admin\x20of\x20the\x20new\x20Permission,\x20so\x20the\x20356\x20check\x20passes).\x20If\x20the\x20unpause\x20is\x20skipped,\x20no\x20dispute\x20can\x20be\x20filed\x20(E_PAUSED)\x20until\x20a\x20separate\x20{operation_type:\x27arbitration\x27,\x20data:{object:\x27<arb>\x27,\x20pause:false}}\x20is\x20issued.','PERMISSIONS:\x20a\x20freshly\x20created\x20Arbitration\x27s\x20Permission\x20table\x20starts\x20EMPTY\x20—\x20its\x20CREATOR\x20is\x20seeded\x20as\x20the\x20sole\x20admin\x20and\x20always\x20passes\x20every\x20assert,\x20so\x20only\x20NON-admin\x20callers\x20abort\x20with\x20\x27Missing\x20permission\x27\x20(code\x205)\x20until\x20grants\x20are\x20issued\x20via\x20its\x20Permission\x20object:\x20356\x20(pause/unpause),\x20358\x20(vote),\x20359\x20(issue\x20ruling),\x20361\x20(arbitrator\x20material\x20confirm),\x20plus\x20357/362/363/364-368\x20(fee\x20/\x20deadline\x20/\x20reset\x20/\x20withdraw\x20/\x20receive).','OPEN\x20VOTE\x20IS\x20NOT\x20PERMISSIONLESS:\x20an\x20empty\x20voting_guard\x20means\x20EQUAL\x20WEIGHT\x20(1\x20person\x201\x20vote),\x20but\x20vote()\x20still\x20asserts\x20ARBITRATION_VOTE=358\x20—\x20\x27anyone\x20can\x20vote\x27\x20requires\x20granting\x20358\x20to\x20the\x20intended\x20voters\x20first.'];export const ARBITRATION_TEMPLATES=[{'id':'T-AB-01','name':'Single-arbiter\x20quick\x20ruling','description':'Simplest\x20Arbitration:\x20one\x20arbiter\x20makes\x20all\x20rulings.\x20voting_guard\x20empty\x20(open\x20vote,\x20but\x20only\x20arbiter\x20has\x20358\x20perm).\x20Suitable\x20for\x20small-scale\x20/\x20fast\x20dispute\x20resolution.','applicable_scenes':['arbitration_create','arbitration_ruling','arbitration_confirm'],'industry_tags':['retail','freelance','small_business'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner\x20(also\x20admin)','required':!![]},{'name':'arbiter_address','type':'address','description':'Single\x20arbiter\x20address\x20(gets\x20ARBITRATION_VOTE=358\x20+\x20ARBITRATION_ARBITRATION=359)','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type\x20for\x20arbitration\x20fee\x20(e.g.\x200x2::wow::WOW)','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20application\x20fee\x20(u64,\x20in\x20Coin\x20base\x20units)','required':![],'default':0x0},{'name':'arbitration_name','type':'string','description':'Local\x20name\x20for\x20the\x20Arbitration\x20object','required':![]}],'body':a=>({'object':{'name':a['arbitration_name']??'single_arb_arbitration','type_parameter':a['coin_type'],'permission':{'name':(a['arbitration_name']??'single_arb')+'_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x0),'pause':![]}),'notes':['voting_guard\x20remains\x20empty\x20→\x20plain\x20votes\x20hard-require\x20the\x20vote\x20permission\x20(358):\x20by\x20default\x20ONLY\x20the\x20creator-admin\x20can\x20vote\x20(here\x20the\x20arbiter).\x20This\x20is\x20NOT\x20open\x20voting\x20—\x20a\x20dispute\x20dead-locks\x20when\x20that\x20admin\x20is\x20unresponsive\x20(crs9-F-36;\x20R-ARB-VOTE-LOCK\x20blocks\x20the\x20service\x20publish).\x20Weight\x20semantics\x20stay\x20one-voter-one-vote;\x20for\x20real\x20open\x20voting\x20bind\x20the\x20always-true\x20guard\x20(T-AB-03\x20/\x20tpl_voting_guard_open_vote)','Only\x20arbiter_address\x20should\x20be\x20granted\x20ARBITRATION_VOTE\x20(358)\x20+\x20ARBITRATION_ARBITRATION\x20(359)','Fast\x20ruling:\x20arbiter\x20confirms\x20materials\x20→\x20votes\x20→\x20makes\x20ruling\x20in\x20one\x20session','Not\x20suitable\x20for\x20high-value\x20disputes\x20(no\x20consensus\x20check)',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-02','name':'Multi-arbiter\x20voting\x20(weighted)','description':'Multiple\x20arbiters\x20vote\x20with\x20weighted\x20voting_guard.\x20Each\x20arbiter\x27s\x20Guard\x20has\x20FixedValue\x20weight.\x20Ruling\x20requires\x20majority\x20weight.','applicable_scenes':['arbitration_create','arbitration_vote','arbitration_voting_guard_config'],'industry_tags':['governance','dao','committee'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner','required':!![]},{'name':'arbiter_guards','type':'string[]','description':'Guard\x20addresses\x20for\x20each\x20arbiter\x20(will\x20be\x20added\x20to\x20voting_guard)','required':!![]},{'name':'vote_weights','type':'string[]','description':'FixedValue\x20weights\x20for\x20each\x20arbiter\x20(parallel\x20to\x20arbiter_guards)','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20fee','required':![],'default':0x0}],'body':a=>{const b=a['arbiter_guards']['map']((c,d)=>({'guard':c,'vote_weight':{'FixedValue':Number(a['vote_weights'][d]??0x1)}}));return{'object':{'name':'weighted_arbitration','type_parameter':a['coin_type'],'permission':{'name':'weighted_arb_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x0),'pause':![],'voting_guard':{'op':'set','guards':b}};},'notes':['voting_guard\x20non-empty\x20→\x20votes\x20MUST\x20be\x20submitted\x20via\x20the\x20Passport-verified\x20voting\x20path','Each\x20arbiter\x27s\x20Guard\x20must\x20be\x20a\x20valid\x20Guard\x20object\x20they\x20can\x20submit\x20Passport\x20for','Consider:\x20max(arbiter_weights)\x20/\x20total_weights\x20<\x200.5\x20to\x20avoid\x20collusion\x20(see\x20R-AB-3-01)','Max\x2050\x20voting_guards\x20(MAX_VOTING_GUARD_COUNT)',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-03','name':'Public\x20voting\x20arbitration','description':'voting_guard\x20allows\x20public\x20to\x20vote\x20(anyone\x20with\x20a\x20Guard\x20can\x20vote).\x20Suitable\x20for\x20community-driven\x20dispute\x20resolution.','applicable_scenes':['arbitration_create','arbitration_vote','arbitration_voting_guard_config'],'industry_tags':['community','public_goods','social'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner','required':!![]},{'name':'public_guard','type':'address','description':'Guard\x20address\x20anyone\x20can\x20submit\x20Passport\x20for\x20(e.g.\x20based\x20on\x20account\x20existence)','required':!![]},{'name':'vote_weight','type':'number','description':'FixedValue\x20weight\x20per\x20public\x20voter\x20(e.g.\x201)','required':![],'default':0x1},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]}],'body':a=>({'object':{'name':'public_arbitration','type_parameter':a['coin_type'],'permission':{'name':'public_arb_permission'}},'description':a['description'],'fee':'0','pause':![],'voting_guard':{'op':'set','guards':[{'guard':a['public_guard'],'vote_weight':{'FixedValue':Number(a['vote_weight']??0x1)}}]}}),'notes':['Public\x20voting:\x20anyone\x20holding\x20the\x20public_guard\x20can\x20vote','This\x20shape\x20also\x20clears\x20R-ARB-VOTE-LOCK:\x20an\x20EMPTY\x20voting_guard\x20is\x20NOT\x20open\x20voting\x20(plain\x20votes\x20would\x20hard-require\x20the\x20vote\x20permission\x20358,\x20admin-only\x20by\x20default,\x20crs9-F-36)\x20—\x20the\x20always-true\x20guard\x20is\x20the\x20declared\x20voter\x20universe\x20(tpl_voting_guard_open_vote\x20is\x20the\x20guard-side\x20template)','Once\x20voting_guard\x20is\x20set,\x20every\x20vote\x20call\x20MUST\x20carry\x20voting_guard\x20in\x20the\x20payload\x20(a\x20plain\x20vote\x20aborts\x20on-chain\x20with\x20E_VOTING_GUARD_USED,\x20abort\x202)','Consider\x20using\x20GuardIdentifier\x20(dynamic\x20weight)\x20for\x20token-weighted\x20voting','Low/zero\x20fee\x20to\x20encourage\x20participation\x20—\x20but\x20watch\x20for\x20spam\x20disputes','Suitable\x20for\x20community\x20moderation,\x20content\x20disputes,\x20public\x20goods\x20arbitration',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-04','name':'Scope-restricted\x20arbitration','description':'usage_guard\x20filters\x20which\x20disputes\x20can\x20be\x20filed.\x20Only\x20users\x20passing\x20the\x20Guard\x20can\x20file\x20disputes.\x20Suitable\x20for\x20verified-merchant\x20/\x20KYC\x20arbitration.','applicable_scenes':['arbitration_create','arbitration_usage_guard_config','arbitration_dispute'],'industry_tags':['kyc','verified_merchant','enterprise'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner','required':!![]},{'name':'usage_guard_address','type':'address','description':'Guard\x20address\x20that\x20filters\x20who\x20can\x20file\x20disputes\x20(KYC/verification)','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'arbiter_address','type':'address','description':'Arbiter\x20address\x20(single\x20arbiter\x20for\x20simplicity)','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20fee\x20(higher\x20to\x20deter\x20spam)','required':![],'default':0x3b9aca00}],'body':a=>({'object':{'name':'restricted_arbitration','type_parameter':a['coin_type'],'permission':{'name':'restricted_arb_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x3b9aca00),'pause':![],'usage_guard':a['usage_guard_address']}),'notes':['usage_guard\x20set\x20→\x20disputes\x20MUST\x20be\x20filed\x20via\x20the\x20Passport-verified\x20dispute\x20variant','Guard\x20verifies:\x20KYC\x20/\x20membership\x20/\x20token-balance\x20/\x20etc.','Higher\x20fee\x20(default\x201\x20WOW)\x20to\x20deter\x20spam\x20from\x20verified\x20users','Arbiter\x20should\x20also\x20be\x20Guard-verified\x20for\x20consistency',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-05','name':'Arbitration\x20committee','description':'Multi-arbiter\x20committee\x20with\x20weighted\x20voting\x20+\x20usage_guard.\x20Most\x20controlled\x20configuration\x20—\x20restricted\x20dispute\x20filing\x20+\x20weighted\x20voting\x20+\x20multi-arbiter\x20ruling.','applicable_scenes':['arbitration_create','arbitration_voting_guard_config','arbitration_usage_guard_config','arbitration_ruling'],'industry_tags':['enterprise','legal','high_value'],'params':[{'name':'owner_address','type':'address','description':'Committee\x20owner','required':!![]},{'name':'committee_guards','type':'string[]','description':'Guard\x20addresses\x20for\x20each\x20committee\x20member','required':!![]},{'name':'member_weights','type':'string[]','description':'Vote\x20weights\x20for\x20each\x20member\x20(parallel\x20to\x20committee_guards)','required':!![]},{'name':'membership_guard','type':'address','description':'usage_guard\x20for\x20dispute\x20filing\x20(membership\x20verification)','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20fee\x20(high\x20for\x20high-value\x20disputes)','required':![],'default':0x2540be400}],'body':a=>{const b=a['committee_guards']['map']((c,d)=>({'guard':c,'vote_weight':{'FixedValue':Number(a['member_weights'][d]??0x1)}}));return{'object':{'name':'committee_arbitration','type_parameter':a['coin_type'],'permission':{'name':'committee_arb_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x2540be400),'pause':![],'voting_guard':{'op':'set','guards':b},'usage_guard':a['membership_guard']};},'notes':['Most\x20restrictive\x20config:\x20weighted\x20voting\x20+\x20restricted\x20filing','Suitable\x20for\x20high-value\x20B2B\x20disputes,\x20legal\x20arbitration,\x20enterprise\x20SLA\x20enforcement','Committee\x20members\x20should\x20have\x20clear\x20escalation\x20/\x20tiebreaker\x20rules','All\x20disputes\x20require\x20Passport\x20(both\x20filing\x20and\x20voting)',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-06','name':'Fee-split\x20arbitration','description':'Pre-configured\x20fee-distribution\x20destination.\x20After\x20the\x20fee\x20withdrawal\x20(364),\x20fees\x20are\x20automatically\x20distributed\x20to\x20the\x20Allocation\x20(for\x20arbiter\x20compensation).','applicable_scenes':['arbitration_create','arbitration_arb_withdraw','arbitration_fees_alloc'],'industry_tags':['marketplace','service','platform'],'params':[{'name':'owner_address','type':'address','description':'Arbitration\x20owner','required':!![]},{'name':'allocation_address','type':'address','description':'Allocation\x20object\x20address\x20for\x20fee\x20distribution\x20to\x20arbiters','required':!![]},{'name':'coin_type','type':'string','description':'Coin\x20type','required':!![]},{'name':'description','type':'string','description':'Arbitration\x20description','required':!![]},{'name':'arbiter_address','type':'address','description':'Arbiter\x20(single\x20for\x20simplicity)','required':!![]},{'name':'fee_amount','type':'number','description':'Dispute\x20fee\x20(will\x20be\x20split\x20to\x20arbiters\x20via\x20Allocation)','required':![],'default':0x12a05f200}],'body':a=>({'object':{'name':'feesplit_arbitration','type_parameter':a['coin_type'],'permission':{'name':'feesplit_arb_permission'}},'description':a['description'],'fee':String(a['fee_amount']??0x12a05f200),'pause':![]}),'notes':['Fee-split\x20is\x20a\x202-step\x20process:\x20withdraw\x20fees\x20from\x20the\x20Arb\x20object\x20(364)\x20→\x20transfer\x20them\x20out\x20of\x20the\x20Arbitration\x20balance\x20(365/366)','Fee\x20withdrawal\x20(364)\x20moves\x20fees\x20from\x20the\x20Arb\x20object\x20into\x20the\x20Arbitration\x20balance','Fee\x20distribution\x20(365)\x20or\x20the\x20balance\x20transfer\x20(366)\x20moves\x20fees\x20to\x20the\x20Allocation/Treasury','Allocation\x20policy\x20determines\x20how\x20fees\x20are\x20split\x20among\x20arbiters','Payment\x20object\x20is\x20created\x20for\x20bookkeeping\x20(payment_remark\x20+\x20payment_index)',...ARBITRATION_ACTIVATION_NOTES]},{'id':'T-AB-07','name':'Appeal\x20arbitration\x20(reset\x20flow)','description':'Template\x20for\x20reset\x20operation\x20—\x20disputant\x20objects\x20to\x20ruling\x20and\x20resubmits\x20materials.\x20Restarts\x20Arb\x20lifecycle\x20from\x20Principal_confirming.','applicable_scenes':['arbitration_reset','arbitration_ruling'],'industry_tags':['legal','appeal','high_value'],'params':[{'name':'arbitration_object','type':'address','description':'Existing\x20Arbitration\x20object\x20address','required':!![]},{'name':'arb_address','type':'address','description':'Arb\x20object\x20address\x20to\x20reset\x20(must\x20be\x20in\x20Objectionable/Arbitrated\x20status)','required':!![]},{'name':'reset_feedback','type':'string','description':'Feedback\x20explaining\x20why\x20disputant\x20objects\x20to\x20the\x20ruling','required':!![]}],'body':a=>({'object':a['arbitration_object'],'reset':{'arb':a['arb_address'],'feedback':a['reset_feedback']}}),'notes':['Precondition:\x20Arb\x20must\x20be\x20in\x20Objectionable\x20(4)\x20or\x20Arbitrated\x20(3)\x20status','Post-condition:\x20Arb\x20status\x20→\x20Principal_confirming\x20(0),\x20lifecycle\x20restarts','Original\x20ruling\x20is\x20invalidated\x20—\x20new\x20voting\x20+\x20ruling\x20required','Consider\x20capping\x20reset\x20count\x20to\x20prevent\x20infinite\x20appeals','reset\x20feedback\x20is\x20permanent\x20—\x20recorded\x20on-chain\x20for\x20audit\x20trail']}];export const ARBITRATION_TEMPLATES_VERSION='1.0.0';export function getAllTemplates(){return[...ARBITRATION_TEMPLATES];}export function getTemplateById(a){return ARBITRATION_TEMPLATES['find'](b=>b['id']===a);}export function getTemplatesByScene(a){return ARBITRATION_TEMPLATES['filter'](b=>b['applicable_scenes']['includes'](a));}export function getTemplatesByIndustry(a){return ARBITRATION_TEMPLATES['filter'](b=>b['industry_tags']['includes'](a)||b['industry_tags']['includes']('universal'));}export function suggestTemplateForScene(a){const b=getTemplatesByScene(a);return b['length']>0x0?b[0x0]:undefined;}export function listTemplates(){return ARBITRATION_TEMPLATES['map'](a=>({'id':a['id'],'name':a['name'],'description':a['description'],'scenes':a['applicable_scenes']}));}export function fillTemplate(a,b){const c=getTemplateById(a);if(!c)return{'ok':![],'error':'Template\x20'+a+'\x20not\x20found'};for(const d of c['params']){if(d['required']&&!(d['name']in b))return{'ok':![],'error':'Missing\x20required\x20param:\x20'+d['name']};}return{'ok':!![],'body':c['body'](b)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ARBITRATION_VENUE_ORDER=[{'id':'V1-activation','title':'Activation\x20order','severity':'must','requirement':'A\x20venue\x20is\x20born\x20PAUSED\x20and\x20permissionless:\x20unpause\x20it\x20and\x20issue\x20the\x20operator\x20grants\x20BEFORE\x20'+'accepting\x20disputes\x20—\x20otherwise\x20filing\x20aborts\x20(paused)\x20and\x20every\x20operation\x20aborts\x20(empty\x20table).','rationale':'On-chain:\x20a\x20new\x20Arbitration\x20starts\x20bPaused=true\x20and\x20its\x20Permission\x20table\x20starts\x20empty;\x20the\x20'+'pause\x20check\x20and\x20the\x20permission\x20assertion\x20run\x20on\x20EVERY\x20entry\x20point.'},{'id':'V2-voting','title':'Voting\x20order','severity':'must','requirement':'Decide\x20and\x20disclose\x20WHO\x20may\x20vote\x20and\x20with\x20what\x20weight:\x20an\x20empty\x20voting_guard\x20is\x20equal\x20weight\x20'+'(1\x20person\x201\x20vote)\x20but\x20still\x20requires\x20the\x20vote\x20grant\x20for\x20every\x20intended\x20voter;\x20a\x20configured\x20'+'roster\x20should\x20keep\x20the\x20largest\x20share\x20below\x20half\x20so\x20no\x20single\x20party\x20rules\x20alone.','rationale':'On-chain:\x20voting\x20always\x20asserts\x20the\x20vote\x20permission\x20(open\x20vote\x20is\x20NOT\x20permissionless);\x20a\x20'+'non-empty\x20roster\x20weighs\x20votes\x20by\x20the\x20guards\x27\x20declared\x20weights.'},{'id':'V3-neutrality','title':'Neutrality\x20order','severity':'must','requirement':'The\x20venue\x20must\x20be\x20controlled\x20independently\x20of\x20any\x20merchant\x20it\x20serves:\x20distinct\x20account,\x20'+'distinct\x20Permission\x20object,\x20no\x20shared\x20admin\x20—\x20a\x20merchant\x20must\x20never\x20be\x20able\x20to\x20vote\x20on\x20or\x20'+'rule\x20its\x20own\x20disputes.','rationale':'On-chain:\x20the\x20Service↔Arbitration\x20binding\x20enforces\x20distinct\x20Permission\x20OBJECTS\x20only;\x20WHO\x20'+'controls\x20them\x20is\x20not\x20checked\x20by\x20the\x20chain,\x20so\x20the\x20venue\x27s\x20neutrality\x20is\x20a\x20venue-duty.\x20The\x20'+'publish\x20gate\x20(same-controller\x20check)\x20backstops\x20this\x20at\x20Service\x20publish.'},{'id':'V4-evidence','title':'Evidence\x20order','severity':'must','requirement':'Confirm\x20materials\x20ONLY\x20after\x20checking\x20them\x20against\x20the\x20order\x27s\x20on-chain\x20record\x20—\x20the\x20'+'material-confirm\x20step\x20is\x20the\x20venue\x27s\x20fact-review\x20gate\x20and\x20it\x20STARTS\x20the\x20vote.\x20Collect:\x20the\x20'+'order\x20object\x20(service,\x20amounts,\x20parties),\x20the\x20progress\x20history\x20(who\x20advanced\x20which\x20node,\x20'+'when),\x20the\x20allocation\x20payments\x20(what\x20already\x20flowed\x20out),\x20and\x20pre-order\x20negotiation\x20evidence\x20'+'(encrypted\x20messenger\x20thread;\x20exportable\x20signed\x20evidence\x20files).\x20Network-tiered\x20trust:\x20'+'guard-verified\x20statements\x20count\x20on\x20mainnet\x20only;\x20anchor\x20evidence\x20to\x20the\x20chain\x20where\x20the\x20'+'commercial\x20record\x20lives.','rationale':'On-chain:\x20material\x20confirm\x20is\x20a\x20permissioned\x20venue\x20op\x20that\x20transitions\x20the\x20case\x20into\x20voting;\x20'+'everything\x20it\x20should\x20be\x20checked\x20against\x20(order/progress/allocation/messenger\x20proofs)\x20is\x20'+'chain-queryable\x20or\x20chain-anchored\x20—\x20the\x20fact\x20base\x20precedes\x20the\x20vote,\x20not\x20the\x20reverse.'},{'id':'V5-ruling','title':'Ruling\x20and\x20execution\x20order','severity':'must','requirement':'Rule\x20within\x20the\x20voting\x20deadline\x20and\x20remember\x20the\x20venue\x20moves\x20NO\x20funds:\x20a\x20ruling\x20writes\x20the\x20'+'verdict\x20(indemnity\x20+\x20feedback)\x20onto\x20the\x20case,\x20and\x20the\x20ORDER\x20executes\x20the\x20compensation\x20through\x20'+'its\x20own\x20escrow\x20rails.\x20Leave\x20the\x20objection\x20window\x20to\x20elapse\x20before\x20treating\x20the\x20case\x20as\x20final,\x20'+'and\x20withdraw\x20only\x20after\x20the\x20withdraw\x20lock.','rationale':'On-chain:\x20the\x20ruling\x20op\x20mutates\x20the\x20case\x20record\x20only;\x20compensation\x20runs\x20on\x20the\x20Order\x20(the\x20'+'bridge\x20object)\x20—\x20a\x20venue\x20that\x20promises\x20to\x20\x27pay\x20the\x20winner\x27\x20directly\x20is\x20promising\x20something\x20'+'the\x20primitive\x20does\x20not\x20do.\x20Terminal\x20states:\x20Objectionable\x20→\x20Finished;\x20withdrawal\x20gated\x20by\x20a\x20'+'fixed\x20duration.'},{'id':'V6-economics','title':'Economics\x20order','severity':'should','requirement':'Set\x20the\x20filing\x20fee\x20as\x20a\x20deliberate\x20commercial\x20signal\x20and\x20disclose\x20it:\x20a\x20zero\x20fee\x20is\x20a\x20free-'+'dispute\x20model\x20(the\x20filing\x20coin\x20returns\x20to\x20the\x20filer;\x20the\x20venue\x20earns\x20nothing\x20per\x20case),\x20a\x20'+'non-zero\x20fee\x20prices\x20out\x20frivolous\x20cases\x20and\x20pays\x20for\x20review\x20work.','rationale':'On-chain:\x20only\x20the\x20filing\x20fee\x20is\x20escrowed\x20at\x20case\x20creation\x20and\x20returned\x20when\x20it\x20is\x20zero\x20—\x20'+'the\x20fee\x20is\x20the\x20venue\x27s\x20only\x20per-case\x20income\x20primitive.'},{'id':'V7-transparency','title':'Transparency\x20order','severity':'should','requirement':'Keep\x20the\x20venue\x20legible\x20to\x20the\x20market:\x20a\x20public\x20description\x20of\x20the\x20venue\x27s\x20jurisdiction\x20and\x20'+'fee,\x20rulings\x20with\x20written\x20feedback,\x20and\x20a\x20case\x20history\x20the\x20market\x20can\x20query\x20—\x20discovery\x20and\x20'+'due-diligence\x20tooling\x20rank\x20venues\x20by\x20exactly\x20this\x20record.','rationale':'On-chain:\x20case\x20lifecycle\x20states,\x20rulings\x20and\x20feedback\x20are\x20public\x20objects;\x20the\x20market\x20layer\x20'+'surfaces\x20venues\x20through\x20their\x20observable\x20history,\x20so\x20opacity\x20is\x20a\x20commercial\x20handicap,\x20not\x20'+'privacy.'}];export const ARBITRATION_VENUE_ORDER_VERSION='1.0.0';export function venueOperatingDoctrine(){return'OPEN\x20VENUE\x20OPERATING\x20ORDER\x20(kernel\x20default\x20—\x20how\x20an\x20open\x20arbitration\x20stays\x20commercially\x20'+'trustworthy):\x20'+'(1)\x20ACTIVATE\x20first\x20—\x20unpause,\x20issue\x20the\x20operator\x20grants,\x20then\x20open\x20for\x20disputes;\x20a\x20paused\x20or\x20'+'permissionless\x20venue\x20cannot\x20accept\x20a\x20case.\x20'+'(2)\x20REVIEW\x20EVIDENCE\x20BEFORE\x20VOTING\x20—\x20the\x20material-confirm\x20step\x20starts\x20the\x20vote,\x20so\x20treat\x20it\x20as\x20'+'the\x20fact-review\x20gate:\x20check\x20the\x20filer\x27s\x20materials\x20against\x20the\x20order\x27s\x20on-chain\x20record\x20(order\x20'+'terms,\x20progress\x20history,\x20allocation\x20payments\x20already\x20made)\x20and\x20the\x20pre-order\x20negotiation\x20thread\x20'+'(encrypted\x20messenger\x20evidence;\x20guard-verified\x20statements\x20carry\x20mainnet-grade\x20trust).\x20'+'(3)\x20LET\x20THE\x20VOTE\x20DECIDE\x20—\x20votes\x20are\x20weighted\x20by\x20the\x20venue\x27s\x20roster,\x20or\x20equal-weight\x20when\x20no\x20'+'roster\x20is\x20configured\x20(every\x20voter\x20still\x20needs\x20the\x20vote\x20grant);\x20set\x20a\x20voting\x20deadline\x20so\x20cases\x20'+'cannot\x20stall\x20open.\x20'+'(4)\x20RULE\x20IN\x20WRITING\x20—\x20the\x20ruling\x20records\x20the\x20verdict\x20and\x20feedback\x20on\x20the\x20case;\x20the\x20ORDER\x20then\x20'+'executes\x20the\x20compensation\x20through\x20its\x20own\x20escrow\x20rails\x20(the\x20venue\x20itself\x20moves\x20no\x20business\x20'+'funds);\x20respect\x20the\x20objection\x20window\x20before\x20closure.\x20'+'(5)\x20BUILD\x20THE\x20PUBLIC\x20RECORD\x20—\x20case\x20history,\x20written\x20feedback\x20and\x20the\x20fee\x20schedule\x20are\x20what\x20the\x20'+'market\x20sees;\x20venues\x20are\x20chosen\x20(and\x20ranked)\x20on\x20this\x20record,\x20so\x20neutrality\x20+\x20evidence\x20discipline\x20'+'+\x20transparency\x20are\x20the\x20venue\x27s\x20commercial\x20product.';}export function checkArbitrationVenueOrder(a){try{const b=[];for(const c of ARBITRATION_VENUE_ORDER){const d=violationFor(c,a);d&&b['push']({'order_id':c['id'],'severity':d['severity']??c['severity'],'title':c['title'],'message':d['message']});}return b;}catch{return[];}}function violationFor(a,b){switch(a['id']){case'V1-activation':if(b['unpaused_at_creation']===![])return{'message':'V1\x20ACTIVATION\x20(must):\x20the\x20venue\x20is\x20created\x20WITHOUT\x20pause:false\x20—\x20it\x20stays\x20PAUSED\x20and\x20'+'cannot\x20accept\x20disputes\x20until\x20{operation_type:\x27arbitration\x27,\x20data:{object:\x27<arb>\x27,\x20'+'pause:false}}\x20is\x20issued\x20(the\x20creator\x20passes\x20the\x20pause\x20check\x20as\x20the\x20new\x20Permission\x27s\x20'+'admin;\x20any\x20other\x20operator\x20needs\x20the\x20explicit\x20grant).\x20Then\x20issue\x20the\x20operator\x20grants\x20—\x20'+'a\x20fresh\x20venue\x27s\x20permission\x20table\x20is\x20EMPTY\x20and\x20every\x20operation\x20aborts\x20until\x20granted.'};return undefined;case'V2-voting':{if(b['voting_guard_count']===undefined)return undefined;if(b['voting_guard_count']===0x0)return{'message':'V2\x20VOTING\x20ORDER\x20(must):\x20no\x20voting\x20roster\x20configured\x20—\x20every\x20holder\x20of\x20the\x20vote\x20grant\x20'+'votes\x20with\x20EQUAL\x20weight\x20(open\x20vote\x20is\x20NOT\x20permissionless:\x20the\x20vote\x20permission\x20is\x20'+'asserted\x20unconditionally).\x20Grant\x20the\x20vote\x20permission\x20to\x20the\x20intended\x20voters,\x20and\x20'+'disclose\x20the\x201-person-1-vote\x20rule\x20to\x20the\x20market.'};if(b['max_weight_share']!==undefined&&b['max_weight_share']>0.5)return{'severity':'should','message':'V2\x20VOTING\x20ORDER\x20(should):\x20the\x20largest\x20single\x20voter\x20holds\x20more\x20than\x20half\x20of\x20the\x20total\x20'+'weight\x20—\x20one\x20party\x20can\x20rule\x20alone.\x20Rebalance\x20the\x20roster\x20weights\x20(or\x20add\x20voters)\x20so\x20no\x20'+'single\x20share\x20exceeds\x20half.'};return undefined;}case'V3-neutrality':return undefined;case'V4-evidence':case'V5-ruling':return undefined;case'V6-economics':{if(b['fee']===undefined)return undefined;const c=b['fee']===0x0||b['fee']==='0'||b['fee']==='0.0'||b['fee']==='0WOW';if(c)return{'message':'V6\x20ECONOMICS\x20(should):\x20the\x20venue\x20opens\x20with\x20a\x20ZERO\x20filing\x20fee\x20—\x20filers\x20pay\x20nothing\x20'+'(any\x20coin\x20sent\x20at\x20filing\x20is\x20returned)\x20and\x20the\x20venue\x20earns\x20no\x20per-case\x20income.\x20'+'Deliberate\x20free-dispute\x20models\x20are\x20legitimate;\x20disclose\x20it.\x20To\x20charge\x20per\x20case,\x20set\x20'+'the\x20fee\x20on\x20the\x20venue.'};return undefined;}case'V7-transparency':if(b['has_description']===![])return{'message':'V7\x20TRANSPARENCY\x20(should):\x20the\x20venue\x20has\x20no\x20public\x20description\x20—\x20the\x20market\x20cannot\x20see\x20'+'its\x20jurisdiction\x20or\x20rules,\x20and\x20discovery/due-diligence\x20ranking\x20reads\x20exactly\x20this\x20'+'record.\x20Add\x20a\x20description\x20stating\x20what\x20the\x20venue\x20covers\x20and\x20how\x20it\x20charges.'};return undefined;default:return undefined;}}
|
|
1
|
+
export const ARBITRATION_VENUE_ORDER=[{'id':'V1-activation','title':'Activation\x20order','severity':'must','requirement':'A\x20venue\x20is\x20born\x20PAUSED\x20with\x20an\x20empty\x20permission\x20table:\x20unpause\x20it\x20and\x20issue\x20the\x20operator\x20grants\x20BEFORE\x20'+'accepting\x20disputes\x20—\x20otherwise\x20filing\x20aborts\x20(paused)\x20and\x20every\x20NON-admin\x20operation\x20aborts\x20'+'(code\x205;\x20the\x20creator-admin\x20always\x20passes).','rationale':'On-chain:\x20a\x20new\x20Arbitration\x20starts\x20bPaused=true\x20and\x20its\x20Permission\x20table\x20starts\x20empty;\x20the\x20'+'pause\x20check\x20and\x20the\x20permission\x20assertion\x20run\x20on\x20EVERY\x20entry\x20point.'},{'id':'V2-voting','title':'Voting\x20order','severity':'must','requirement':'Decide\x20and\x20disclose\x20WHO\x20may\x20vote\x20and\x20with\x20what\x20weight:\x20an\x20empty\x20voting_guard\x20is\x20equal\x20weight\x20'+'(1\x20person\x201\x20vote)\x20but\x20still\x20requires\x20the\x20vote\x20grant\x20for\x20every\x20intended\x20voter;\x20a\x20configured\x20'+'roster\x20should\x20keep\x20the\x20largest\x20share\x20below\x20half\x20so\x20no\x20single\x20party\x20rules\x20alone.','rationale':'On-chain:\x20voting\x20always\x20asserts\x20the\x20vote\x20permission\x20(open\x20vote\x20is\x20NOT\x20permissionless);\x20a\x20'+'non-empty\x20roster\x20weighs\x20votes\x20by\x20the\x20guards\x27\x20declared\x20weights.'},{'id':'V3-neutrality','title':'Neutrality\x20order','severity':'must','requirement':'The\x20venue\x20must\x20be\x20controlled\x20independently\x20of\x20any\x20merchant\x20it\x20serves:\x20distinct\x20account,\x20'+'distinct\x20Permission\x20object,\x20no\x20shared\x20admin\x20—\x20a\x20merchant\x20must\x20never\x20be\x20able\x20to\x20vote\x20on\x20or\x20'+'rule\x20its\x20own\x20disputes.','rationale':'On-chain:\x20the\x20Service↔Arbitration\x20binding\x20enforces\x20distinct\x20Permission\x20OBJECTS\x20only;\x20WHO\x20'+'controls\x20them\x20is\x20not\x20checked\x20by\x20the\x20chain,\x20so\x20the\x20venue\x27s\x20neutrality\x20is\x20a\x20venue-duty.\x20The\x20'+'publish\x20gate\x20(same-controller\x20check)\x20backstops\x20this\x20at\x20Service\x20publish.'},{'id':'V4-evidence','title':'Evidence\x20order','severity':'must','requirement':'Confirm\x20materials\x20ONLY\x20after\x20checking\x20them\x20against\x20the\x20order\x27s\x20on-chain\x20record\x20—\x20the\x20'+'material-confirm\x20step\x20is\x20the\x20venue\x27s\x20fact-review\x20gate\x20and\x20it\x20STARTS\x20the\x20vote.\x20Collect:\x20the\x20'+'order\x20object\x20(service,\x20amounts,\x20parties),\x20the\x20progress\x20history\x20(who\x20advanced\x20which\x20node,\x20'+'when),\x20the\x20allocation\x20payments\x20(what\x20already\x20flowed\x20out),\x20and\x20pre-order\x20negotiation\x20evidence\x20'+'(encrypted\x20messenger\x20thread;\x20exportable\x20signed\x20evidence\x20files).\x20Network-tiered\x20trust:\x20'+'guard-verified\x20statements\x20count\x20on\x20mainnet\x20only;\x20anchor\x20evidence\x20to\x20the\x20chain\x20where\x20the\x20'+'commercial\x20record\x20lives.','rationale':'On-chain:\x20material\x20confirm\x20is\x20a\x20permissioned\x20venue\x20op\x20that\x20transitions\x20the\x20case\x20into\x20voting;\x20'+'everything\x20it\x20should\x20be\x20checked\x20against\x20(order/progress/allocation/messenger\x20proofs)\x20is\x20'+'chain-queryable\x20or\x20chain-anchored\x20—\x20the\x20fact\x20base\x20precedes\x20the\x20vote,\x20not\x20the\x20reverse.'},{'id':'V5-ruling','title':'Ruling\x20and\x20execution\x20order','severity':'must','requirement':'Rule\x20within\x20the\x20voting\x20deadline\x20and\x20remember\x20the\x20venue\x20moves\x20NO\x20funds:\x20a\x20ruling\x20writes\x20the\x20'+'verdict\x20(indemnity\x20+\x20feedback)\x20onto\x20the\x20case,\x20and\x20the\x20ORDER\x20executes\x20the\x20compensation\x20through\x20'+'its\x20own\x20escrow\x20rails.\x20Leave\x20the\x20objection\x20window\x20to\x20elapse\x20before\x20treating\x20the\x20case\x20as\x20final,\x20'+'and\x20withdraw\x20only\x20after\x20the\x20withdraw\x20lock.','rationale':'On-chain:\x20the\x20ruling\x20op\x20mutates\x20the\x20case\x20record\x20only;\x20compensation\x20runs\x20on\x20the\x20Order\x20(the\x20'+'bridge\x20object)\x20—\x20a\x20venue\x20that\x20promises\x20to\x20\x27pay\x20the\x20winner\x27\x20directly\x20is\x20promising\x20something\x20'+'the\x20primitive\x20does\x20not\x20do.\x20Terminal\x20states:\x20Objectionable\x20→\x20Finished;\x20withdrawal\x20gated\x20by\x20a\x20'+'fixed\x20duration.'},{'id':'V6-economics','title':'Economics\x20order','severity':'should','requirement':'Set\x20the\x20filing\x20fee\x20as\x20a\x20deliberate\x20commercial\x20signal\x20and\x20disclose\x20it:\x20a\x20zero\x20fee\x20is\x20a\x20free-'+'dispute\x20model\x20(the\x20filing\x20coin\x20returns\x20to\x20the\x20filer;\x20the\x20venue\x20earns\x20nothing\x20per\x20case),\x20a\x20'+'non-zero\x20fee\x20prices\x20out\x20frivolous\x20cases\x20and\x20pays\x20for\x20review\x20work.','rationale':'On-chain:\x20only\x20the\x20filing\x20fee\x20is\x20escrowed\x20at\x20case\x20creation\x20and\x20returned\x20when\x20it\x20is\x20zero\x20—\x20'+'the\x20fee\x20is\x20the\x20venue\x27s\x20only\x20per-case\x20income\x20primitive.'},{'id':'V7-transparency','title':'Transparency\x20order','severity':'should','requirement':'Keep\x20the\x20venue\x20legible\x20to\x20the\x20market:\x20a\x20public\x20description\x20of\x20the\x20venue\x27s\x20jurisdiction\x20and\x20'+'fee,\x20rulings\x20with\x20written\x20feedback,\x20and\x20a\x20case\x20history\x20the\x20market\x20can\x20query\x20—\x20discovery\x20and\x20'+'due-diligence\x20tooling\x20rank\x20venues\x20by\x20exactly\x20this\x20record.','rationale':'On-chain:\x20case\x20lifecycle\x20states,\x20rulings\x20and\x20feedback\x20are\x20public\x20objects;\x20the\x20market\x20layer\x20'+'surfaces\x20venues\x20through\x20their\x20observable\x20history,\x20so\x20opacity\x20is\x20a\x20commercial\x20handicap,\x20not\x20'+'privacy.'}];export const ARBITRATION_VENUE_ORDER_VERSION='1.0.0';export function venueOperatingDoctrine(){return'OPEN\x20VENUE\x20OPERATING\x20ORDER\x20(kernel\x20default\x20—\x20how\x20an\x20open\x20arbitration\x20stays\x20commercially\x20'+'trustworthy):\x20'+'(1)\x20ACTIVATE\x20first\x20—\x20unpause,\x20issue\x20the\x20operator\x20grants,\x20then\x20open\x20for\x20disputes;\x20a\x20paused\x20or\x20'+'permissionless\x20venue\x20cannot\x20accept\x20a\x20case.\x20'+'(2)\x20REVIEW\x20EVIDENCE\x20BEFORE\x20VOTING\x20—\x20the\x20material-confirm\x20step\x20starts\x20the\x20vote,\x20so\x20treat\x20it\x20as\x20'+'the\x20fact-review\x20gate:\x20check\x20the\x20filer\x27s\x20materials\x20against\x20the\x20order\x27s\x20on-chain\x20record\x20(order\x20'+'terms,\x20progress\x20history,\x20allocation\x20payments\x20already\x20made)\x20and\x20the\x20pre-order\x20negotiation\x20thread\x20'+'(encrypted\x20messenger\x20evidence;\x20guard-verified\x20statements\x20carry\x20mainnet-grade\x20trust).\x20'+'(3)\x20LET\x20THE\x20VOTE\x20DECIDE\x20—\x20votes\x20are\x20weighted\x20by\x20the\x20venue\x27s\x20roster,\x20or\x20equal-weight\x20when\x20no\x20'+'roster\x20is\x20configured\x20(every\x20voter\x20still\x20needs\x20the\x20vote\x20grant);\x20set\x20a\x20voting\x20deadline\x20so\x20cases\x20'+'cannot\x20stall\x20open.\x20'+'(4)\x20RULE\x20IN\x20WRITING\x20—\x20the\x20ruling\x20records\x20the\x20verdict\x20and\x20feedback\x20on\x20the\x20case;\x20the\x20ORDER\x20then\x20'+'executes\x20the\x20compensation\x20through\x20its\x20own\x20escrow\x20rails\x20(the\x20venue\x20itself\x20moves\x20no\x20business\x20'+'funds);\x20respect\x20the\x20objection\x20window\x20before\x20closure.\x20'+'(5)\x20BUILD\x20THE\x20PUBLIC\x20RECORD\x20—\x20case\x20history,\x20written\x20feedback\x20and\x20the\x20fee\x20schedule\x20are\x20what\x20the\x20'+'market\x20sees;\x20venues\x20are\x20chosen\x20(and\x20ranked)\x20on\x20this\x20record,\x20so\x20neutrality\x20+\x20evidence\x20discipline\x20'+'+\x20transparency\x20are\x20the\x20venue\x27s\x20commercial\x20product.';}export function checkArbitrationVenueOrder(a){try{const b=[];for(const c of ARBITRATION_VENUE_ORDER){const d=violationFor(c,a);d&&b['push']({'order_id':c['id'],'severity':d['severity']??c['severity'],'title':c['title'],'message':d['message']});}return b;}catch{return[];}}function violationFor(a,b){switch(a['id']){case'V1-activation':if(b['unpaused_at_creation']===![])return{'message':'V1\x20ACTIVATION\x20(must):\x20the\x20venue\x20is\x20created\x20WITHOUT\x20pause:false\x20—\x20it\x20stays\x20PAUSED\x20and\x20'+'cannot\x20accept\x20disputes\x20until\x20{operation_type:\x27arbitration\x27,\x20data:{object:\x27<arb>\x27,\x20'+'pause:false}}\x20is\x20issued\x20(the\x20creator\x20passes\x20the\x20pause\x20check\x20as\x20the\x20new\x20Permission\x27s\x20'+'admin;\x20any\x20other\x20operator\x20needs\x20the\x20explicit\x20grant).\x20Then\x20issue\x20the\x20operator\x20grants\x20—\x20'+'a\x20fresh\x20venue\x27s\x20permission\x20table\x20is\x20EMPTY\x20and\x20every\x20NON-admin\x20operation\x20aborts\x20until\x20'+'granted\x20(the\x20creator-admin\x20always\x20passes).'};return undefined;case'V2-voting':{if(b['voting_guard_count']===undefined)return undefined;if(b['voting_guard_count']===0x0)return{'message':'V2\x20VOTING\x20ORDER\x20(must):\x20no\x20voting\x20roster\x20configured\x20—\x20every\x20holder\x20of\x20the\x20vote\x20grant\x20'+'votes\x20with\x20EQUAL\x20weight\x20(open\x20vote\x20is\x20NOT\x20permissionless:\x20the\x20vote\x20permission\x20is\x20'+'asserted\x20unconditionally).\x20Grant\x20the\x20vote\x20permission\x20to\x20the\x20intended\x20voters,\x20and\x20'+'disclose\x20the\x201-person-1-vote\x20rule\x20to\x20the\x20market.'};if(b['max_weight_share']!==undefined&&b['max_weight_share']>0.5)return{'severity':'should','message':'V2\x20VOTING\x20ORDER\x20(should):\x20the\x20largest\x20single\x20voter\x20holds\x20more\x20than\x20half\x20of\x20the\x20total\x20'+'weight\x20—\x20one\x20party\x20can\x20rule\x20alone.\x20Rebalance\x20the\x20roster\x20weights\x20(or\x20add\x20voters)\x20so\x20no\x20'+'single\x20share\x20exceeds\x20half.'};return undefined;}case'V3-neutrality':return undefined;case'V4-evidence':case'V5-ruling':return undefined;case'V6-economics':{if(b['fee']===undefined)return undefined;const c=b['fee']===0x0||b['fee']==='0'||b['fee']==='0.0'||b['fee']==='0WOW';if(c)return{'message':'V6\x20ECONOMICS\x20(should):\x20the\x20venue\x20opens\x20with\x20a\x20ZERO\x20filing\x20fee\x20—\x20filers\x20pay\x20nothing\x20'+'(any\x20coin\x20sent\x20at\x20filing\x20is\x20returned)\x20and\x20the\x20venue\x20earns\x20no\x20per-case\x20income.\x20'+'Deliberate\x20free-dispute\x20models\x20are\x20legitimate;\x20disclose\x20it.\x20To\x20charge\x20per\x20case,\x20set\x20'+'the\x20fee\x20on\x20the\x20venue.'};return undefined;}case'V7-transparency':if(b['has_description']===![])return{'message':'V7\x20TRANSPARENCY\x20(should):\x20the\x20venue\x20has\x20no\x20public\x20description\x20—\x20the\x20market\x20cannot\x20see\x20'+'its\x20jurisdiction\x20or\x20rules,\x20and\x20discovery/due-diligence\x20ranking\x20reads\x20exactly\x20this\x20'+'record.\x20Add\x20a\x20description\x20stating\x20what\x20the\x20venue\x20covers\x20and\x20how\x20it\x20charges.'};return undefined;default:return undefined;}}
|
|
@@ -22,6 +22,7 @@ export interface AuditContext {
|
|
|
22
22
|
findDanglingDependencies: () => string[];
|
|
23
23
|
};
|
|
24
24
|
userConfirmed?: boolean;
|
|
25
|
+
network?: string;
|
|
25
26
|
}
|
|
26
27
|
export declare function salesItemsOf(d: any): any[];
|
|
27
28
|
export declare function allocatorCountOf(d: any): number;
|
|
@@ -45,10 +46,27 @@ export declare function computeTerminalReachability(nodes: unknown[]): {
|
|
|
45
46
|
terminals: string[];
|
|
46
47
|
unreachable: string[];
|
|
47
48
|
};
|
|
49
|
+
export declare const REVIEW_FAMILY_NODE_REGEX: RegExp;
|
|
50
|
+
export declare function lintReviewLockedTerminals(nodes: unknown[], guardPins: Map<string, string[]>): {
|
|
51
|
+
critical: string[];
|
|
52
|
+
warnings: string[];
|
|
53
|
+
};
|
|
54
|
+
export declare function arbitrationVotingLockDetail(votingGuard: unknown): string | null;
|
|
55
|
+
export declare function guardTimeProfileDetail(g: {
|
|
56
|
+
ref: string;
|
|
57
|
+
description?: unknown;
|
|
58
|
+
table?: unknown;
|
|
59
|
+
root?: unknown;
|
|
60
|
+
}): {
|
|
61
|
+
level: "critical" | "warning";
|
|
62
|
+
detail: string;
|
|
63
|
+
} | null;
|
|
64
|
+
export declare function rewardRefsOf(d: any): string[];
|
|
65
|
+
export declare function serviceRewardsUnfundedDetail(rewardObj: unknown): string | null;
|
|
48
66
|
export declare const AUDIT_RULES: AuditRule[];
|
|
49
67
|
export declare function auditService(data: any, context?: AuditContext): AuditFinding[];
|
|
50
68
|
export declare function hasBlockingErrors(findings: AuditFinding[]): boolean;
|
|
51
69
|
export declare function getErrors(findings: AuditFinding[]): AuditFinding[];
|
|
52
70
|
export declare function getWarnings(findings: AuditFinding[]): AuditFinding[];
|
|
53
71
|
export declare function summarizeFindings(findings: AuditFinding[]): string;
|
|
54
|
-
export declare const AUDIT_RULES_VERSION =
|
|
72
|
+
export declare const AUDIT_RULES_VERSION = 10;
|