@wowok/agent-mcp 3.3.3 → 3.3.5

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.
Files changed (66) hide show
  1. package/dist/composition/compile.d.ts +4 -1
  2. package/dist/composition/compile.js +1 -1
  3. package/dist/evaluation/node-game.d.ts +3 -0
  4. package/dist/evaluation/node-game.js +1 -1
  5. package/dist/harness/recover.js +1 -1
  6. package/dist/knowledge/builtin-templates.d.ts +1 -1
  7. package/dist/knowledge/builtin-templates.js +1 -1
  8. package/dist/knowledge/guard-templates.d.ts +1 -1
  9. package/dist/knowledge/guard-templates.js +1 -1
  10. package/dist/knowledge/recipient-constraint.d.ts +9 -0
  11. package/dist/knowledge/recipient-constraint.js +1 -1
  12. package/dist/knowledge/scenario-modes.d.ts +1 -0
  13. package/dist/knowledge/template-loader.d.ts +1 -0
  14. package/dist/knowledge/template-loader.js +1 -1
  15. package/dist/knowledge/template-scanner.js +1 -1
  16. package/dist/participation/node-action-advisor.js +1 -1
  17. package/dist/playbooks/service-build/service-quote.js +1 -1
  18. package/dist/playbooks/service-build/service-quote.spec.js +1 -1
  19. package/dist/schema/call/base.d.ts +25 -0
  20. package/dist/schema/call/base.js +1 -1
  21. package/dist/schema/call/bridge.d.ts +1 -0
  22. package/dist/schema/call/error-codes.d.ts +1 -1
  23. package/dist/schema/call/error-codes.js +1 -1
  24. package/dist/schema/call/handler.js +1 -1
  25. package/dist/schema/call/order.d.ts +12 -0
  26. package/dist/schema/call/order.js +1 -1
  27. package/dist/schema/call/progress.js +1 -1
  28. package/dist/schema/call/semantic.js +1 -1
  29. package/dist/schema/local/index.d.ts +10 -0
  30. package/dist/schema/operations.d.ts +4 -0
  31. package/dist/schema/query/bi.d.ts +4 -0
  32. package/dist/schema/query/bi.js +1 -1
  33. package/dist/schema/query/index.d.ts +147 -0
  34. package/dist/schema/query/index.js +1 -1
  35. package/dist/schemas/account_operation.output.json +2 -1
  36. package/dist/schemas/bridge_operation.output.json +2 -1
  37. package/dist/schemas/index.json +1 -1
  38. package/dist/schemas/keeper_operation.output.json +1 -1
  39. package/dist/schemas/local_cache_operation.output.json +2 -1
  40. package/dist/schemas/local_history_operation.output.json +2 -1
  41. package/dist/schemas/local_info_operation.output.json +2 -1
  42. package/dist/schemas/local_mark_operation.output.json +2 -1
  43. package/dist/schemas/messenger_operation.output.json +1 -1
  44. package/dist/schemas/monitor_events.output.json +1 -1
  45. package/dist/schemas/monitor_subscription.output.json +1 -1
  46. package/dist/schemas/onchain_events.output.json +1 -1
  47. package/dist/schemas/onchain_operations.output.json +35 -4
  48. package/dist/schemas/onchain_operations.schema.json +21 -3
  49. package/dist/schemas/onchain_operations_order.schema.json +19 -1
  50. package/dist/schemas/onchain_operations_progress.schema.json +2 -2
  51. package/dist/schemas/onchain_table_data.output.json +2 -2
  52. package/dist/schemas/query_toolkit.output.json +17 -1
  53. package/dist/schemas/query_toolkit.schema.json +1 -1
  54. package/dist/schemas/wowok_buildin_info.output.json +259 -0
  55. package/dist/schemas/wowok_buildin_info.schema.json +121 -0
  56. package/dist/tools/build-fingerprint.d.ts +28 -0
  57. package/dist/tools/build-fingerprint.js +1 -0
  58. package/dist/tools/handlers/config.js +1 -1
  59. package/dist/tools/handlers/onchain.d.ts +6 -0
  60. package/dist/tools/handlers/onchain.js +1 -1
  61. package/dist/tools/handlers/query.js +1 -1
  62. package/dist/tools/handlers/review-chain.d.ts +9 -13
  63. package/dist/tools/handlers/review-chain.js +1 -1
  64. package/dist/tools/upgrade-check.d.ts +1 -0
  65. package/dist/tools/upgrade-check.js +1 -1
  66. package/package.json +2 -2
@@ -14,7 +14,10 @@ export interface GuardSpec {
14
14
  id_from?: string;
15
15
  value_type?: string;
16
16
  write_once?: boolean;
17
+ id_from_submission?: number;
18
+ data_from_submission?: number;
17
19
  };
20
+ params?: Record<string, unknown>;
18
21
  step_id?: string;
19
22
  }
20
23
  export type GuardResolution = {
@@ -29,7 +32,7 @@ export type GuardResolution = {
29
32
  } | {
30
33
  kind: "omit";
31
34
  };
32
- export type CompileBlockerCode = "MACHINE_EDGES_MISSING" | "EDGE_UNKNOWN_PREV" | "GUARD_CYCLE" | "GUARD_KEY_UNKNOWN" | "GUARD_TEMPLATE_PARAMS" | "GUARD_PATTERN_UNKNOWN" | "GUARD_RESOLUTION_UNKNOWN" | "GUARD_OMIT_UNSUPPORTED" | "GUARD_SLOT_UNKNOWN" | "GUARD_FOREIGN_SERVICE" | "ALLOCATOR_VALUE_MISSING" | "ALLOCATOR_FIX_UNSUPPORTED" | "REVIEW_NODE_MISSING" | "REVIEW_REWARD_GUARD_MISSING" | "REVIEW_REWARD_UNFUNDED" | "REVIEW_REWARD_UNARMED" | "AFTER_SALES_RAIL_MISSING" | "ACCEPTANCE_JUDGE_NOT_INDEPENDENT" | "ACCEPTANCE_REVISION_UNBOUNDED" | "INSTALLMENT_FUNDING_UNGATED" | "INSTALLMENT_DEPOSIT_STRANDED" | "REPO_GUARD_POLICY_MISSING" | "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_POLARITY_COLLISION" | "RAIL_DEAD_LITERAL" | "FORWARD_GUARD_PINNED_TO_NON_PREV" | "FORWARD_GUARD_IDENTITY_PERM_CONFLICT" | "GUARD_IDENTITY_SLOT_NOT_TASKBOUND" | "PAIR_THRESHOLD_UNREACHABLE" | "PAIR_THRESHOLD_SINGLE_OPERATOR" | "AFFILIATE_RAIL_MISSING" | "AFFILIATE_CLAWBACK_UNDISCLOSED" | "CROWDFUNDING_THRESHOLD_GATE_MISSING" | "CROWDFUNDING_AGGREGATE_UNBOUND" | "CROWDFUNDING_DISCLOSURE_MISSING";
35
+ export type CompileBlockerCode = "MACHINE_EDGES_MISSING" | "EDGE_UNKNOWN_PREV" | "GUARD_CYCLE" | "GUARD_KEY_UNKNOWN" | "GUARD_TEMPLATE_PARAMS" | "GUARD_PATTERN_UNKNOWN" | "GUARD_RESOLUTION_UNKNOWN" | "GUARD_OMIT_UNSUPPORTED" | "GUARD_SLOT_UNKNOWN" | "GUARD_FOREIGN_SERVICE" | "ALLOCATOR_VALUE_MISSING" | "ALLOCATOR_FIX_UNSUPPORTED" | "REVIEW_NODE_MISSING" | "REVIEW_REWARD_GUARD_MISSING" | "REVIEW_REWARD_UNFUNDED" | "REVIEW_REWARD_UNARMED" | "AFTER_SALES_RAIL_MISSING" | "ACCEPTANCE_JUDGE_NOT_INDEPENDENT" | "ACCEPTANCE_REVISION_UNBOUNDED" | "INSTALLMENT_FUNDING_UNGATED" | "INSTALLMENT_DEPOSIT_STRANDED" | "REPO_GUARD_POLICY_MISSING" | "REPO_GUARD_SUBMISSION_ID_FORBIDDEN" | "REPO_GUARD_SUBMISSION_SLOT_UNKNOWN" | "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_POLARITY_COLLISION" | "RAIL_DEAD_LITERAL" | "FORWARD_GUARD_PINNED_TO_NON_PREV" | "FORWARD_GUARD_IDENTITY_PERM_CONFLICT" | "GUARD_IDENTITY_SLOT_NOT_TASKBOUND" | "PAIR_THRESHOLD_UNREACHABLE" | "PAIR_THRESHOLD_SINGLE_OPERATOR" | "AFFILIATE_RAIL_MISSING" | "AFFILIATE_CLAWBACK_UNDISCLOSED" | "CROWDFUNDING_THRESHOLD_GATE_MISSING" | "CROWDFUNDING_AGGREGATE_UNBOUND" | "CROWDFUNDING_DISCLOSURE_MISSING";
33
36
  export interface CompileBlocker {
34
37
  code: CompileBlockerCode;
35
38
  detail: string;
@@ -1 +1 @@
1
- import{fillGuardTemplate,getTemplateById}from'../knowledge/guard-templates.js';import{GUARD_DESIGN_PATTERNS}from'../knowledge/guard-design-patterns.js';import{SV2_UNARMED_PRESCRIPTION,TWO_TX_RENEW_RECIPE}from'../knowledge/protocol-facts.js';import{verifyAllocatorRails}from'../knowledge/allocator-rail-verifier.js';import{TASK_BINDING_SLOT}from'../knowledge/onchain-constants.js';import{rootHasRewardRecordGate,afterSalesRailRegex as a11a,afterSalesRailNodeMatches}from'../knowledge/template-scanner.js';import{refsOf}from'./plan.js';const P=a=>a;function offTaskSlotIdentityLegs(a){const b=new Set(['order.owner','order.agent\x20has']),c=new Set(),d=[],e=f=>{if(f===null||typeof f!=='object')return;const g=f;if(g['type']==='logic_equal'&&Array['isArray'](g['nodes'])){const i=g['nodes']['filter'](j=>j!==null&&typeof j==='object'&&j['type']==='identifier'&&typeof j['identifier']==='number');if(i['some'](j=>j['identifier']===TASK_BINDING_SLOT)){for(const j of i)c['add'](j['identifier']);}}const h=g['object'];if(typeof g['query']==='string'&&b['has'](g['query'])&&h!==null&&typeof h==='object'&&typeof h['identifier']==='number'){const l=h['identifier'];if(l!==TASK_BINDING_SLOT)d['push']({'query':g['query'],'identifier':l});}if(Array['isArray'](g['nodes'])){for(const m of g['nodes'])e(m);}if(g['node']!==undefined&&typeof g['node']==='object')e(g['node']);};return e(a),d['filter'](f=>!c['has'](f['identifier']));}function safeId(a){return a['replace'](/[^a-zA-Z0-9_]/g,'_');}function ref(a){return{'$ref':a};}const MODE_MAP={'amount':'Amount','rate':'Rate','surplus':'Surplus'};export function compileTemplate(a,b,d={}){const h=d['nameBase']??a['id']['replace'](/\//g,'_'),i=d['merchantPermissionIndex']??0x3e8,j=[],k=[],l=new Set();for(const al of a['conditional_guards']??[]){const am=b[al['param']]??a['fee_params'][al['param']];if(am!==al['emit_value'])l['add'](al['guard_key']);}const p=new Map();for(const an of a['conditional_guards']??[]){p['set'](an['param'],(p['get'](an['param'])??0x0)+0x1);}const q=new Set((a['conditional_guards']??[])['filter'](ao=>(p['get'](ao['param'])??0x0)>0x1)['map'](ao=>ao['guard_key'])),s=new Set([...l]['filter'](ao=>q['has'](ao))),t=s['size']>0x0?a['machine_shape']['map'](ao=>({...ao,'from':(ao['from']??[])['filter'](ap=>typeof ap==='string'||ap['guard_key']===undefined||!s['has'](ap['guard_key']))})):a['machine_shape'],u=s['size']>0x0?(a['allocator']['rows']??[])['filter'](ao=>ao['guard_key']===undefined||!s['has'](ao['guard_key'])):a['allocator']['rows']??[],v=[];for(const [ao,ap]of Object['entries'](d['guardResolutions']??{})){if(ap?.['kind']==='omit')v['push'](ao);}const w=new Set();if(v['length']>0x0){const aq=new Set(t['flatMap'](as=>(as['from']??[])['map'](at=>typeof at==='string'?undefined:at['guard_key'])['filter'](at=>typeof at==='string'))),ar=new Set(u['map'](as=>as['guard_key'])['filter'](as=>typeof as==='string'));for(const as of v){const at=a['guards']['find']((av,aw)=>(av['key']??av['template_id']+'#'+aw)===as);if(at===undefined)continue;const au=[];if(aq['has'](as))au['push']('a\x20machine\x20forward\x20edge\x20(guard_key)');if(ar['has'](as))au['push']('an\x20allocator\x20rail\x20row\x20(guard_key)');if(at['policy']!==undefined)au['push']('a\x20Repository\x20write-policy\x20credential\x20(policy)');if(at['host']==='service'&&as==='buy')au['push']('the\x20Service\x20buy\x20gate\x20(buy_guard)');au['length']>0x0?j['push']({'code':'GUARD_OMIT_UNSUPPORTED','detail':'guard_resolutions[\x27'+as+'\x27]\x20=\x20{kind:\x27omit\x27}\x20refused:\x20this\x20design\x20is\x20bound\x20to\x20'+au['join']('\x20and\x20')+'\x20—\x20'+'omitting\x20it\x20would\x20orphan\x20the\x20binding\x20(open\x20rail\x20/\x20open\x20write\x20/\x20ungated\x20purchase).\x20'+'Fold\x20the\x20design\x27s\x20intent\x20into\x20the\x20bound\x20site\x20instead,\x20or\x20keep\x20the\x20guard\x20resolved.'}):w['add'](as);}}const x=a['guards']['map']((av,aw)=>({'key':av['key']??av['template_id']+'#'+aw,'template_id':av['template_id'],'host':av['host'],'purpose':av['purpose'],'policy':av['policy']}))['filter'](av=>!l['has'](av['key'])&&!w['has'](av['key'])),y=new Map(x['map'](av=>[av['key'],av])),z=new Set(['wip_provenance','subscription_with_proof']),A=Array['isArray'](b['adopted_module_ids'])?b['adopted_module_ids']['filter'](av=>typeof av==='string'):[],B=x['some'](av=>av['host']==='repository'||av['template_id']==='pattern.repository_data_check'||av['template_id']==='pattern.repository_write_authorization')||A['some'](av=>z['has'](av)),C=new Map(),D=[],E=x['map'](av=>av['key']);for(const av of Object['keys'](d['guardResolutions']??{})){if(w['has'](av))continue;!y['has'](av)&&j['push']({'code':'GUARD_RESOLUTION_UNKNOWN','detail':'guard_resolutions\x20key\x20\x27'+av+'\x27\x20matches\x20no\x20guard\x20spec\x20key\x20declared\x20by\x20\x27'+h+'\x27.\x20'+('Legal\x20keys:\x20'+(E['length']>0x0?E['join'](',\x20'):'(none\x20—\x20this\x20template\x20declares\x20no\x20keyed\x20guards)')+'.\x20')+'An\x20unknown\x20key\x20was\x20previously\x20dropped\x20silently,\x20leaving\x20the\x20intended\x20guard\x20pending\x20while\x20the\x20build\x20looked\x20resolved.'});}for(const aw of x){const ax='guard_'+safeId(aw['key']),ay=d['guardResolutions']?.[aw['key']];let az=aw['purpose'],aA,aB;if(ay?.['kind']==='inline')aA=ay['table'],aB=ay['root'],az=ay['description']??aw['purpose'];else{const aC=ay?.['kind']==='template'?ay['template_id']:aw['template_id']['startsWith']('tpl_')?aw['template_id']:undefined;if(aC!==undefined){const aD={'service_name':h+'_service',...B?{'repository_name':h+'_evidence'}:{},...a['fee_params'],...b,...ay?.['kind']==='template'?ay['params']:{}},aE=fillGuardTemplate(aC,aD);!aE['ok']?j['push']({'code':'GUARD_TEMPLATE_PARAMS','detail':'guard\x20\x27'+aw['key']+'\x27\x20('+aC+'):\x20'+aE['error']}):(aA=aE['table'],aB=aE['root']);}}aA!==undefined?(C['set'](aw['key'],{'stepId':ax,'description':az,'table':aA,'root':aB}),aw['step_id']=ax):(!aw['template_id']['startsWith']('tpl_')&&getTemplateById(aw['template_id'])===undefined&&!GUARD_DESIGN_PATTERNS['some'](aF=>aF['id']===aw['template_id'])&&j['push']({'code':'GUARD_PATTERN_UNKNOWN','detail':'guard\x20\x27'+aw['key']+'\x27\x20of\x20\x27'+h+'\x27\x20references\x20design\x20\x27'+aw['template_id']+'\x27,\x20which\x20exists\x20in\x20neither\x20the\x20Guard\x20design-pattern\x20catalog\x20nor\x20the\x20guard-template\x20registry\x20—\x20'+'no\x20resolution\x20path\x20can\x20ever\x20fill\x20it\x20(guide\x20confirm,\x20guard_resolutions\x20and\x20module\x20plumbing\x20all\x20key\x20off\x20real\x20ids).\x20'+'Keeping\x20it\x20as\x20a\x20pending\x20design\x20would\x20leave\x20its\x20bound\x20path\x20UNGUARDED\x20behind\x20a\x20plausible\x20pending\x20label\x20'+'(bs-mn-261022\x20TPL-01:\x20nine\x20such\x20specs\x20compiled\x20into\x20a\x20machine\x20with\x20no\x20guards\x20on\x20the\x20grant-lifecycle\x20forwards).\x20'+'Correct\x20the\x20template\x27s\x20guard\x20spec\x20id\x20to\x20a\x20known\x20pattern,\x20or\x20resolve\x20this\x20spec\x20explicitly\x20(guard_resolutions\x20with\x20kind\x20\x27inline\x27).'}),D['push'](aw));}const F=new Set(t['flatMap'](aF=>(aF['from']??[])['map'](aG=>typeof aG==='string'?undefined:aG['guard_key'])['filter'](aG=>typeof aG==='string')));for(const aF of u){typeof aF['guard_key']==='string'&&aF['recipient']==='guard_identifier'&&aF['recipient_key']===String(TASK_BINDING_SLOT)&&F['add'](aF['guard_key']);}const G=new Set();for(const aG of x){if(!F['has'](aG['key']))continue;const aH=C['get'](aG['key']);if(aH===undefined)continue;const aI=aH['table']['some'](aJ=>aJ['identifier']===TASK_BINDING_SLOT);if(aI)continue;C['set'](aG['key'],{...aH,'table':[...aH['table'],{'identifier':TASK_BINDING_SLOT,'b_submission':!![],'value_type':'Address','name':'task_binding\x20order\x20anchor\x20(protocol\x20slot\x20254;\x20written\x20by\x20order\x20creation)'}]}),G['add'](aG['key']);}const H=aJ=>C['get'](aJ)!==undefined&&refsOf({'table':C['get'](aJ)['table'],'root':C['get'](aJ)['root']})['has']('service'),I=aJ=>{const aK=C['get'](aJ),aL=y['get'](aJ)?.['purpose'];return{'op':'create','id':aK['stepId'],'object':'guard','params':P({'description':aK['description'],'table':aK['table'],'root':aK['root']}),'notes':G['has'](aJ)?(aL??'Guard')+'\x20[kernel:\x20protocol\x20slot\x20254\x20(task\x20binding)\x20auto-declared]':aL};};k['push']({'op':'create','id':'permission','object':'permission','params':{'name':h+'_permission'}});const J=a['arbitration_mode']!==undefined&&a['arbitration_mode']!=='none';J&&k['push']({'op':'create','id':'permission_arb','object':'permission','params':{'name':h+'_arb_permission'},'notes':'MUST\x20be\x20created\x20by\x20a\x20different\x20account\x20than\x20the\x20service\x20permission\x20'+'(E_ARBITRATION_PERMISSION_CONFLICT=33):\x20dispute\x20neutrality.'});k['push']({'op':'create','id':'contact','object':'contact','params':{'name':h+'_contact'},'notes':'R8:\x20customer-service\x20channel;\x20mandatory\x20when\x20customer_required\x20is\x20set.'});const K=b['review_mode'],L=K==='review'||K==='review_reward'||K==='none'?K:undefined,M=L??a['review_mode']??'none',N=h+'_review_reward',O=b['after_sales_mode'],Q=O==='return'||O==='exchange'||O==='warranty'||O==='none'?O:undefined,R=Q??a['after_sales_mode']??'none',S=b['acceptance_mode'],T=S==='milestone'||S==='contest'||S==='bounty'||S==='agent'||S==='none'?S:undefined,U=T??a['acceptance_mode']??'none',V=U==='contest'||U==='bounty'||U==='agent',W=b['installment_mode'],X=W==='deposit_balance'||W==='milestone_n'||W==='none'?W:undefined,Y=X??a['installment_mode']??'none',Z=b['affiliate_mode'],a0=Z==='commission'||Z==='none'?Z:undefined,a1=a0??a['affiliate_mode']??'none',a2=b['crowdfunding_mode'],a3=a2==='threshold'||a2==='flexible'||a2==='none'?a2:undefined,a4=a3??a['crowdfunding_mode']??'none',a5=aJ=>{const aK=new Set(),aL=aM=>{if(Array['isArray'](aM)){for(const aO of aM)aL(aO);return;}if(typeof aM!=='object'||aM===null)return;const aN=aM;if(typeof aN['type']==='string'&&aN['type']['startsWith']('query_reward_record')){const aP=aN['object'];if(aP!==undefined&&typeof aP['identifier']==='number')aK['add'](aP['identifier']);}for(const aQ of Object['values'](aN))aL(aQ);};return aL(aJ),aK;},a6=M==='review_reward'?x['find'](aJ=>aJ['host']==='reward'):undefined;if(M==='review_reward'&&a6?.['step_id']!==undefined){const aJ=C['get'](a6['key']);if(aJ!==undefined){const aK=a5(aJ['root']);C['set'](a6['key'],{...aJ,'table':aJ['table']['map'](aL=>{const aM=aL;if(aM['b_submission']===!![]||!aK['has'](aM['identifier']))return aL;return{...aM,'value':{'$late':{'by':'local_name','mark':N}}};})});}k['push']({'op':'create','id':'reward_review','object':'reward','params':P({'name':N,'description':'Review\x20incentive\x20pool\x20(sale-time\x20planned;\x20terms\x20disclosed\x20at\x20quote/buy):\x20claim\x20gated\x20by\x20guard\x20\x27'+a6['key']+'\x27.'}),'notes':'REVIEW-COMPONENT:\x20the\x20funded\x20reward\x20must\x20be\x20perceivable\x20by\x20the\x20buyer\x20BEFORE\x20ordering\x20—\x20the\x20full\x20terms\x20ride\x20the\x20quote/buy\x20surface\x20(REVIEW-COMPONENT-PLAN\x20§四).\x20'+'[ZR-08:\x20created\x20BEFORE\x20its\x20claim\x20guard\x20—\x20the\x20guard\x27s\x20Reward-address\x20row\x20freezes\x20at\x20creation\x20and\x20binds\x20this\x20pool\x20by\x20local\x20name]'});}const a7=[];for(const [aL]of C){H(aL)?a7['push'](aL):k['push'](I(aL));}if(B){const aM=Array['isArray'](b['repository_policies'])?b['repository_policies']['filter'](aP=>typeof aP==='object'&&aP!==null):[],aN=[...aM],aO=new Set(aM['map'](aP=>aP['name']));for(const aP of x){if(aP['host']!=='repository'||aP['step_id']===undefined)continue;const aQ='host:\x22repository\x22\x20guard\x20\x27'+aP['key']+'\x27\x20(step\x20\x27'+aP['step_id']+'\x27)';if(aP['policy']===undefined){j['push']({'code':'REPO_GUARD_POLICY_MISSING','detail':aQ+'\x20declares\x20no\x20policy\x20on\x20the\x20guards[]\x20entry.\x20Its\x20Repository\x20policy\x20'+'(name\x20/\x20id_from\x20/\x20value_type)\x20is\x20business\x20data\x20the\x20kernel\x20must\x20not\x20fabricate,\x20'+'and\x20an\x20unbound\x20repository\x20guard\x20is\x20an\x20orphan\x20create\x20that\x20leaves\x20the\x20Repository\x20'+'open\x20to\x20any\x20writer.\x20Add\x20policy:{name,\x20id_from,\x20value_type}\x20to\x20the\x20spec,\x20or\x20bind\x20'+'the\x20guard\x20through\x20repository_policies\x20inputs\x20with\x20this\x20guard\x27s\x20own\x20write_guard\x20shape.'});continue;}if(H(aP['key'])){j['push']({'code':'REPO_GUARD_POLICY_MISSING','detail':aQ+'\x20refs\x20the\x20service,\x20so\x20it\x20is\x20created\x20AFTER\x20the\x20service\x20draft\x20—\x20but\x20the\x20'+'Repository\x20freezes\x20its\x20policies\x20at\x20creation,\x20which\x20happens\x20before.\x20Resolve\x20this\x20'+'guard\x20without\x20a\x20service\x20reference\x20(the\x20writers\x20are\x20asserted\x20by\x20identity,\x20not\x20by\x20'+'service\x20pin),\x20or\x20bind\x20the\x20policy\x20manually\x20via\x20repository_policies\x20inputs.'});continue;}const aR=aP['policy']['name']??aP['key'];if(aO['has'](aR))continue;aN['push']({'name':aR,'description':aP['policy']['description']??aP['purpose'],'write_guard':[{'guard':ref(aP['step_id'])}],'id_from':aP['policy']['id_from']??'signer','value_type':aP['policy']['value_type']??'String','write_once':aP['policy']['write_once']??![]});}k['push']({'op':'create','id':'repository','object':'repository','params':P({'name':h+'_evidence',...aN['length']>0x0?{'policies':aN}:{}}),'notes':'Evidence\x20rows\x20(tracking\x20hash,\x20receipts,\x20WTS\x20proofs).\x20[HOST-GRAPH-01:\x20created\x20after\x20wave-A\x20guards;\x20write_guard\x20policies\x20synthesized\x20from\x20resolved\x20host:\x22repository\x22\x20specs]'});}const a8=new Set(t['map'](aS=>aS['name'])),a9=[];for(const aS of t){if(aS['from']===undefined||aS['from']['length']===0x0){j['push']({'code':'MACHINE_EDGES_MISSING','detail':'machine_shape\x20node\x20\x27'+aS['name']+'\x27\x20declares\x20no\x20\x27from\x27\x20edges.\x20Edges\x20are\x20data\x20'+'(REPORT\x20#10\x20A-2:\x20a\x20missing\x20paid->closed_cancel\x20edge\x20bricks\x20the\x20shop\x20at\x20publish).\x20'+'Annotate\x20the\x20node\x20with\x20from:\x20[...]\x20(use\x20prev:\x20\x22\x22\x20for\x20the\x20entry\x20edge).'});continue;}const aT=[],aU=new Map(),aV=new Map();for(const aX of aS['from']){const aY=typeof aX==='string'?{'prev':aX}:aX;if(aY['prev']!==''&&!a8['has'](aY['prev'])){j['push']({'code':'EDGE_UNKNOWN_PREV','detail':'node\x20\x27'+aS['name']+'\x27\x20edge\x20prev\x20\x27'+aY['prev']+'\x27\x20is\x20not\x20a\x20machine_shape\x20node'});continue;}const aZ=aY['operator']??aS['operator']??(aY['prev']===''?'order_payer':'merchant'),b0={'name':aY['forward']??(aY['prev']===''?'enter_'+aS['name']:aY['prev']+'_to_'+aS['name']),'weight':0x1,...aZ==='order_payer'?{'namedOperator':''}:{'permissionIndex':aY['permission_index']??i}};if(aY['guard_key']!==undefined){const b4=y['get'](aY['guard_key']);if(b4===undefined)j['push']({'code':'GUARD_KEY_UNKNOWN','detail':'edge\x20\x27'+aY['prev']+'\x27->\x27'+aS['name']+'\x27\x20binds\x20unknown\x20guard_key\x20\x27'+aY['guard_key']+'\x27'});else{for(const b5 of b4['purpose']['matchAll'](/progress\.current\s*==\s*([a-z0-9_]+)/g)){const b6=b5[0x1];a8['has'](b6)&&b6!==aY['prev']&&j['push']({'code':'FORWARD_GUARD_PINNED_TO_NON_PREV','detail':'edge\x20\x27'+aY['prev']+'\x27->\x27'+aS['name']+'\x27\x20guard\x20\x27'+b4['key']+'\x27\x20pins\x20progress.current\x20==\x20\x27'+b6+'\x27,\x20but\x20a\x20'+('forward\x20guard\x20evaluates\x20BEFORE\x20the\x20advance\x20(progress.current\x20==\x20prev\x20\x27'+aY['prev']+'\x27),\x20so\x20the\x20pin\x20')+'can\x20never\x20pass\x20—\x20dead\x20rail\x20(bkng\x20F22).\x20Keep\x20the\x20pin\x20on\x20the\x20allocator\x20row\x20(evaluated\x20at\x20alloc,\x20'+'current\x20=\x20the\x20reached\x20node);\x20put\x20only\x20time/identity\x20legs\x20on\x20the\x20forward.'});}b4['template_id']==='pattern.identity_check_order_holder'&&aZ!=='order_payer'&&j['push']({'code':'FORWARD_GUARD_IDENTITY_PERM_CONFLICT','detail':'edge\x20\x27'+aY['prev']+'\x27->\x27'+aS['name']+'\x27\x20guard\x20\x27'+b4['key']+'\x27\x20is\x20an\x20order-holder\x20(buyer)\x20identity\x20'+'check\x20but\x20the\x20forward\x20rides\x20a\x20permissionIndex\x20rail\x20(merchant-side\x20slot).\x20The\x20identity\x20layer\x20'+'runs\x20BEFORE\x20the\x20guard,\x20and\x20the\x20two\x20signer\x20sets\x20are\x20disjoint\x20—\x20nobody\x20can\x20pass\x20both\x20(bkng\x20F23).\x20'+'Use\x20operator\x20\x27order_payer\x27\x20(namedOperator\x20\x22\x22\x20—\x20the\x20buyer\x20self-advance)\x20for\x20this\x20edge.'});{const b7=C['get'](b4['key']);if(b7!==undefined){const b8=b7['table']['some'](ba=>ba['identifier']===TASK_BINDING_SLOT),b9=offTaskSlotIdentityLegs(b7['root'])['filter'](ba=>{if(!b8)return![];const bb=b7['table']['find'](bc=>bc['identifier']===ba['identifier']);return bb!==undefined&&bb['b_submission']===!![];});for(const ba of b9){j['push']({'code':'GUARD_IDENTITY_SLOT_NOT_TASKBOUND','detail':'edge\x20\x27'+aY['prev']+'\x27->\x27'+aS['name']+'\x27\x20guard\x20\x27'+b4['key']+'\x27\x20reads\x20'+ba['query']+'\x20off\x20free\x20'+('submission\x20slot\x20'+ba['identifier']+'\x20—\x20hijackable\x20(rex-mn-261021\x20T10):\x20the\x20caller\x20fills\x20free\x20')+'slots,\x20so\x20an\x20attacker\x20submits\x20their\x20OWN\x20order\x20there\x20(signer\x20==\x20order.owner\x20passes\x20against\x20'+('their\x20own\x20order)\x20and\x20advances\x20the\x20VICTIM\x27s\x20order\x20carried\x20by\x20slot\x20'+TASK_BINDING_SLOT+';\x20with\x20')+'namedOperator\x20\x22\x22\x20the\x20permission\x20layer\x20passes\x20for\x20anyone\x20(progress.move:242-256),\x20so\x20this\x20'+('guard\x20is\x20the\x20only\x20identity\x20leg.\x20Anchor\x20the\x20'+ba['query']+'\x20query\x20on\x20identifier\x20')+(TASK_BINDING_SLOT+'\x20(the\x20task-binding\x20order\x20anchor\x20—\x20the\x20order\x20the\x20forward\x20actually\x20mutates).')});}}}b4['step_id']!==undefined&&(H(b4['key'])?j['push']({'code':'GUARD_CYCLE','detail':'edge\x20\x27'+aY['prev']+'\x27->\x27'+aS['name']+'\x27\x20binds\x20guard\x20\x27'+b4['key']+'\x27\x20which\x20itself\x20'+'refs\x20the\x20service\x20(created\x20after\x20the\x20machine)\x20—\x20an\x20F-05\x20cycle.\x20Rebind\x20or\x20split\x20the\x20guard.'}):b0['guard']=ref(b4['step_id']));}}const b1=aU['get'](aY['prev']);b1!==undefined?b1['push'](b0):aU['set'](aY['prev'],[b0]);const b2=aV['get'](aY['prev']),b3=aZ==='order_payer'?'namedOperator:':'permissionIndex:'+(aY['permission_index']??i);b2!==undefined?b2['add'](b3):aV['set'](aY['prev'],new Set([b3]));}const aW=aS['threshold']??0x0;for(const [bb,bc]of aU){aW>bc['length']&&j['push']({'code':'PAIR_THRESHOLD_UNREACHABLE','detail':'node\x20\x27'+aS['name']+'\x27\x20pair\x20from\x20\x27'+(bb===''?'(entry)':bb)+'\x27\x20declares\x20threshold\x20'+aW+'\x20'+('but\x20the\x20pair\x20merges\x20only\x20'+bc['length']+'\x20forward(s)\x20at\x20weight\x201\x20each\x20—\x20the\x20pair\x20can\x20never\x20')+'migrate\x20and\x20the\x20publish\x20aborts.\x20Add\x20one\x20distinct-operator\x20forward\x20per\x20required\x20signature,\x20or\x20'+'lower\x20the\x20threshold\x20to\x20the\x20forward\x20count.'});if(aW>=0x2){const bd=aV['get'](bb)?.['size']??0x0;bd<0x2&&j['push']({'code':'PAIR_THRESHOLD_SINGLE_OPERATOR','detail':'node\x20\x27'+aS['name']+'\x27\x20pair\x20from\x20\x27'+(bb===''?'(entry)':bb)+'\x27\x20declares\x20threshold\x20'+aW+'\x20'+'but\x20every\x20forward\x20rides\x20the\x20SAME\x20operator\x20rail\x20—\x20one\x20party\x20can\x20tap\x20all\x20of\x20them\x20and\x20the\x20'+'declared\x20dual\x20confirmation\x20silently\x20dissolves\x20(each\x20forward\x20locks\x20to\x20its\x20first\x20operator).\x20'+'Give\x20each\x20required\x20signature\x20its\x20own\x20rail\x20(e.g.\x20permission_index\x201001\x20+\x20operator\x20\x27order_payer\x27).'});}aT['push']({'prev_node':bb,'threshold':aW,'forwards':bc});}a9['push']({'name':aS['name'],...aS['semantic_role']!==undefined?{'role':aS['semantic_role']}:{},...aS['optional']===!![]?{'optional':!![]}:{},'pairs':aT});}k['push']({'op':'create','id':'machine','object':'machine','params':P({'name':h+'_machine','nodes':a9})}),k['push']({'op':'publish','id':'machine_publish','target':ref('machine'),'preflight':[{'check':'machine_publish','status':'pending'},{'check':'TASKBIND-01','status':'pending'}]});const aa=typeof b['currency']==='string'?b['currency']:'0x2::wow::WOW',ab=x['find'](be=>be['host']==='service'&&be['key']==='buy');k['push']({'op':'create','id':'service','object':'service','params':P({'name':h+'_service','type_parameter':aa,'permission':ref('permission'),'machine':ref('machine'),'um':ref('contact'),'description':a['id']+'\x20—\x20compiled\x20by\x20composition/compile',...B?{'repositories':[ref('repository')]}:{},...ab?.['step_id']!==undefined?{'buy_guard':ref(ab['step_id'])}:{},...Array['isArray'](b['customer_required'])?{'customer_required':b['customer_required']}:{}}),'notes':'Draft\x20only:\x20machine/order_allocators\x20are\x20L1-frozen\x20at\x20publish;\x20allocators\x20attach\x20in\x20the\x20configure\x20step.'});for(const be of a7)k['push'](I(be));const ac=u['length']>0x0?u:[{'track':'settlement','recipient':a['allocator']['recipient']==='fixed'?'entity':a['allocator']['recipient'],'recipient_key':a['allocator']['recipient_key'],'mode':a['allocator']['mode'],'value':a['allocator']['mode']==='rate'?0x2710:a['allocator']['mode']==='surplus'?'0':undefined}],ad=[],ae=new Map();for(const bf of ac){if(bf['guard_key']!==undefined){let bg=ae['get'](bf['guard_key']);bg===undefined&&(bg={'key':bf['guard_key'],'rows':[]},ae['set'](bf['guard_key'],bg),ad['push'](bg)),bg['rows']['push'](bf);}else ad['push']({'rows':[bf]});}const af=[];for(const bh of ad){const bi=[];let bj;for(const bl of bh['rows']){let bm=bl['value'];bm===undefined&&bl['value_from']!==undefined&&(bm=b[bl['value_from']]??a['fee_params'][bl['value_from']]);if(bm===undefined&&bl['mode']!=='surplus'){j['push']({'code':'ALLOCATOR_VALUE_MISSING','detail':'allocator\x20row\x20('+bl['track']+'/'+bl['recipient']+')\x20has\x20neither\x20value\x20nor\x20a\x20resolvable\x20value_from'});continue;}(bl['fix']!==undefined||bl['fix_from']!==undefined)&&j['push']({'code':'ALLOCATOR_FIX_UNSUPPORTED','detail':'allocator\x20row\x20('+bl['track']+'/'+bl['recipient']+')\x20declares\x20fix/fix_from\x20—\x20the\x20chain\x20has\x20no\x20holdback\x20'+'parameter:\x20fix\x20is\x20computed\x20on-chain\x20as\x20the\x20sum\x20of\x20the\x20Amount\x20legs\x20and\x20those\x20legs\x20are\x20PAID\x20'+'(allocation.move:399,540),\x20and\x20the\x20allocator-registration\x20call\x20surface\x20(guard,\x20sharing,\x20max)\x20has\x20no\x20fix\x20'+'argument,\x20so\x20this\x20value\x20never\x20reaches\x20the\x20chain.\x20To\x20keep\x20funds\x20in\x20the\x20pool,\x20do\x20not\x20distribute\x20them\x20'+'(a\x20separate\x20Allocation\x20object,\x20or\x20a\x20later\x20guard-gated\x20allocator);\x20to\x20combine\x20fixed\x20fees\x20with\x20a\x20'+'proportional\x20split,\x20use\x20explicit\x20Amount\x20legs\x20plus\x20Rate\x20legs\x20summing\x2010000.'});bj??=bl['note'];let bn;if(bl['recipient']==='entity')bn={'Entity':{'$late':{'by':'local_name','mark':bl['recipient_key']??'merchant'}}};else{if(bl['recipient']==='guard_identifier'){const bo=Number(bl['recipient_key']??0x0);bn={'GuardIdentifier':bo};const bp=bh['key']!==undefined?C['get'](bh['key']):undefined;if(bp!==undefined){const bq=bp['table']['find'](br=>br['identifier']===bo);(bq===undefined||bq['b_submission']!==!![]||bq['value_type']!=='Address')&&j['push']({'code':'GUARD_SLOT_UNKNOWN','detail':'allocator\x20leg\x20{GuardIdentifier:\x20'+bo+'}\x20on\x20guard\x20\x27'+bh['key']+'\x27\x20of\x20\x27'+h+'\x27:\x20the\x20bound\x20'+('Guard\x20table\x20has\x20no\x20slot\x20'+bo+'\x20Address\x20submission\x20row\x20(b_submission:\x20true).\x20On\x20chain\x20the\x20leg\x20')+('reads\x20slot\x20'+bo+'\x20as\x20its\x20payee\x20and\x20asserts\x20it\x20equals\x20the\x20paying\x20order\x20')+'(payment_info.for_object)\x20—\x20an\x20undeclared\x20or\x20STATIC\x20slot\x20aborts\x20at\x20alloc\x20time\x20with\x20code\x2015\x20'+'(ERECIPIENT_NOT_FOR_OBJECT,\x20allocation.move:500-520)\x20and\x20the\x20leg\x27s\x20funds\x20stranded\x20'+'(az3/abnb7\x20mainnet\x20261013:\x20static\x20GuardIdentifier\x20legs\x20bricked\x20every\x20refund\x20rail).\x20'+'Guard/allocators/forwards\x20are\x20all\x20publish-frozen.\x20Declare\x20'+('{identifier:\x20'+bo+',\x20b_submission:\x20true,\x20value_type:\x20\x22Address\x22}\x20in\x20the\x20Guard\x20table\x20')+'(templates\x20anchor\x20refund\x20rails\x20on\x20user\x20slot\x200\x20and\x20submit\x20the\x20Order\x20address\x20there).\x20Protocol\x20'+'slot\x20254\x20is\x20the\x20task-binding/once\x20slot:\x20naming\x20it\x20as\x20the\x20payee\x20arms\x20once-per-order,\x20so\x20a\x20'+'second\x20fire\x20aborts\x20E_ONCE_TRIGGERED\x20(16).'});}}else bn='Signer';}bi['push']({'who':bn,'sharing':String(bm??'0'),'mode':MODE_MAP[bl['mode']]});}if(bi['length']===0x0)continue;const bk=bh['key']!==undefined?y['get'](bh['key'])?.['step_id']:undefined;bh['key']!==undefined&&!y['has'](bh['key'])&&j['push']({'code':'GUARD_KEY_UNKNOWN','detail':'allocator\x20row\x20('+bh['rows'][0x0]['track']+')\x20binds\x20unknown\x20guard_key\x20\x27'+bh['key']+'\x27'}),af['push']({...bk!==undefined?{'guard':ref(bk)}:{},...bh['key']!==undefined?{'guard_key':bh['key']}:{},'track':bh['rows'][0x0]['track'],'sharing':bi,...bj!==undefined?{'note':bj}:{}});}const ag=ad['map'](br=>{if(br['key']===undefined)return undefined;const bs=C['get'](br['key']);return{'key':br['key'],'track':br['rows'][0x0]['track'],'table':bs?.['table']??[],'root':bs?.['root']};})['filter'](br=>br!==undefined);if(ag['length']>0x0){const br=verifyAllocatorRails(ag,t['map'](bu=>({'name':bu['name'],'semanticRole':bu['semantic_role']}))),bs=ad['map'](bu=>bu['key'])['filter'](bu=>bu!==undefined&&!C['has'](bu)),bt=bs['length']>0x0?'\x20UNRESOLVED\x20ALLOCATOR\x20GUARD\x20REFS\x20(likely\x20the\x20real\x20cause\x20—\x20these\x20guard_keys\x20match\x20no\x20resolved\x20guard,\x20e.g.\x20a\x20name\x20typo):\x20'+bs['join'](',\x20')+'.':'';for(const bu of br){j['push']({'code':bu['code'],'detail':bu['detail']+bt});}}k['push']({'op':'configure','id':'service_allocators','target':ref('service'),'method':'order_allocators','params':P({'description':a['allocator']['description'],'threshold':Number(a['fee_params']['threshold']??a['fee_params']['monthly_rent_amount']??0x0)||0x0,'allocators':af}),'requires':['machine_publish']});Array['isArray'](b['sales'])&&b['sales']['length']>0x0&&k['push']({'op':'configure','id':'service_sales','target':ref('service'),'method':'sales','params':{'op':'add','sales':b['sales']}});if(R!=='none'){const bv=a11a(R),bw=t['some'](bx=>afterSalesRailNodeMatches(R,bx['name']));!bw&&j['push']({'code':'AFTER_SALES_RAIL_MISSING','detail':'after_sales_mode\x20\x27'+R+'\x27\x20declares\x20a\x20buyer\x20after-sales\x20remedy,\x20but\x20machine_shape\x20has\x20no\x20'+('backing\x20rail\x20(no\x20node\x20matching\x20'+bv+').\x20Add\x20the\x20'+R+'\x20node\x20family\x20')+'(e.g.\x20return_requested\x20->\x20returned\x20for\x20\x27return\x27)\x20with\x20its\x20claimed_by\x20polarity\x20pair\x20—\x20refund\x20leg\x20'+'some==false,\x20merchant-recovery\x20leg\x20some==true\x20(INV-C1)\x20—\x20anchored\x20on\x20the\x20delivered\x20ENTRY\x20time\x20'+'(INV-C2,\x20TIME-ANCHOR-01),\x20and\x20de-conflicted\x20against\x20the\x20settlement\x20rail\x20so\x20the\x20two\x20never\x20both\x20pay\x20'+'(INV-C3,\x20DUAL-RAIL-01).\x20Or\x20set\x20after_sales_mode\x20\x27none\x27\x20if\x20this\x20shop\x20ships\x20no\x20such\x20remedy.'});}if(U!=='none'){V&&a['arbitration_mode']!=='third_party'&&j['push']({'code':'ACCEPTANCE_JUDGE_NOT_INDEPENDENT','detail':'acceptance_mode\x20\x27'+U+'\x27\x20is\x20a\x20judge-decided\x20acceptance\x20(a\x20third\x20party\x20rules\x20on\x20'+('release),\x20but\x20arbitration_mode\x20is\x20\x27'+(a['arbitration_mode']??'none')+'\x27,\x20not\x20\x27third_party\x27.\x20')+'The\x20party\x20owing\x20the\x20payout\x20must\x20not\x20also\x20decide\x20whether\x20it\x20is\x20owed\x20(merchant\x20self-adjudication,\x20'+'INV-A3).\x20Set\x20arbitration_mode\x20\x27third_party\x27\x20so\x20an\x20independent\x20venue/judge\x20Permission\x20rules\x20'+'(R2;\x20enforced\x20at\x20publish\x20by\x20controller-disjointness),\x20or\x20use\x20acceptance_mode\x20\x27milestone\x27\x20if\x20the\x20'+'buyer\x20genuinely\x20self-adjudicates.'});const bx=a['fee_params']['revision_rounds_max'],by=typeof bx==='number'||typeof bx==='string'&&bx['trim']()!==''&&/^\d+$/['test'](bx['trim']());if(by){const bz=x['some'](bA=>bA['host']==='repository'||/repository/i['test'](bA['template_id']));!bz&&j['push']({'code':'ACCEPTANCE_REVISION_UNBOUNDED','detail':'acceptance_mode\x20\x27'+U+'\x27\x20declares\x20a\x20bounded\x20revision\x20loop\x20'+('(fee_params.revision_rounds_max\x20=\x20'+String(bx)+'),\x20but\x20no\x20counter-backed\x20Repository\x20')+'guard\x20exists.\x20progress.move\x20caps\x20EDGE\x20count\x20(MAX_FORWARD\x20/\x20MAX_NODE_PAIR),\x20never\x20VISIT\x20count,\x20'+'so\x20a\x20finite\x20cap\x20in\x20fee_params\x20alone\x20is\x20a\x20promise\x20the\x20chain\x20cannot\x20keep\x20(INV-A1).\x20Either\x20declare\x20'+'revision_rounds_max\x20\x27unlimited\x27\x20(the\x20honest\x20form\x20—\x20the\x20revision\x20loop\x20is\x20then\x20genuinely\x20'+'unbounded)\x20or\x20mount\x20a\x20counter-backed\x20Repository\x20guard\x20(pattern.repository_data_check\x20reading\x20a\x20'+'per-order\x20revision\x20tally\x20written\x20via\x20pattern.repository_write_authorization)\x20that\x20gates\x20the\x20'+'redelivery\x20forward\x20once\x20the\x20tally\x20reaches\x20the\x20cap.'});}}if(Y!=='none'){const bA=/(due|owed|owing|unpaid|awaiting|pending)/i,bB=/(paid|captured|funded|settled)/i,bC=/(deposit|down_?pay|balance_due|balance_owed|awaiting|installment|milestone)/i,bD=/(refund|cancel|exit|forfeit|kill|void|abandon|release|expire|lapse)/i,bE=[];for(const bH of t){const bI=bH['name'];for(const bJ of bH['from']??[]){typeof bJ==='string'?bE['push']({'prev':bJ,'target':bI}):bE['push']({'prev':bJ['prev'],'target':bI,'guardKey':bJ['guard_key']});}}const bF=bE['filter'](bK=>bA['test'](bK['prev'])&&bB['test'](bK['target'])&&(bK['guardKey']===undefined||bK['guardKey']['trim']()===''));bF['length']>0x0&&j['push']({'code':'INSTALLMENT_FUNDING_UNGATED','detail':'installment_mode\x20\x27'+Y+'\x27\x20captures\x20a\x20later\x20payment,\x20but\x20the\x20funding\x20forward(s)\x20'+bF['map'](bK=>'\x27'+bK['prev']+'\x27\x20→\x20\x27'+bK['target']+'\x27')['join'](',\x20')+'\x20carry\x20NO\x20guard_key.\x20A\x20bare\x20advance\x20records\x20the\x20balance\x20as\x20paid\x20WITHOUT\x20the\x20capture\x20landing\x20in\x20the\x20'+'Allocation\x20—\x20a\x20zero-value\x20advance\x20(INV-B1,\x20H4).\x20Bind\x20a\x20fund-gate\x20Guard\x20on\x20each\x20capture\x20forward\x20'+'(constant\x20=\x20order\x20address,\x20convert_witness\x20OrderAllocation(109),\x20allocation.balance\x20query\x201051\x20>=\x20the\x20'+'capture\x20amount).\x20PRE-STATE\x20CONSTRAINT\x20(esound-mn-261021\x20B-1,\x20mainnet-verified):\x20guards\x20read\x20the\x20'+'COMMITTED\x20pre-transaction\x20balance\x20—\x20funding\x20that\x20lands\x20in\x20the\x20SAME\x20PTB\x20(the\x20one-PTB\x20order_renew\x20'+'payment\x20half)\x20is\x20INVISIBLE\x20to\x20the\x20forward\x27s\x20guard,\x20so\x20a\x20balance-gated\x20capture\x20advanced\x20by\x20'+('order_renew\x20ALWAYS\x20aborts.\x20'+TWO_TX_RENEW_RECIPE+'\x20Pair\x20the\x20balance\x20gate\x20with\x20the\x20once\x20slot\x20')+'(H5\x20—\x20the\x20fund\x20gate\x20is\x20a\x20STATE\x20READ,\x20not\x20a\x20once)\x20so\x20a\x20replay\x20cannot\x20re-capture.'});const bG=[];for(const bK of t){if(!bC['test'](bK['name']))continue;const bL=bE['filter'](bN=>bN['prev']===bK['name']),bM=bL['some'](bN=>bD['test'](bN['target']));if(!bM)bG['push'](bK['name']);}bG['length']>0x0&&j['push']({'code':'INSTALLMENT_DEPOSIT_STRANDED','detail':'installment_mode\x20\x27'+Y+'\x27\x20holds\x20a\x20buyer\x20payment\x20at\x20state(s)\x20'+bG['map'](bN=>'\x27'+bN+'\x27')['join'](',\x20')+'\x20with\x20NO\x20deposit-exit\x20rail\x20(no\x20outgoing\x20refund\x20/\x20cancel\x20/\x20forfeit\x20/\x20expire\x20edge).\x20There\x20is\x20no\x20on-chain\x20'+'obligation\x20to\x20pay\x20the\x20balance\x20(INV-B2,\x20H1),\x20so\x20a\x20buyer\x20who\x20walks\x20away\x20strands\x20the\x20already-paid\x20portion\x20'+'at\x20that\x20node\x20permanently\x20(Machine\x20+\x20Allocator\x20immutable,\x20IMMUT-001).\x20Add\x20a\x20deposit-exit\x20rail\x20from\x20each\x20'+'held\x20state\x20—\x20a\x20refund/cancel\x20forward\x20into\x20an\x20exit\x20node\x20whose\x20allocator\x20returns\x20the\x20held\x20funds\x20to\x20the\x20'+'order\x20payer\x20(GuardIdentifier(0))\x20or\x20applies\x20the\x20declared\x20deposit_exit_policy\x20(full\x20refund\x20vs\x20a\x20kill\x20fee\x20'+'compensating\x20the\x20merchant\x20for\x20the\x20reserved\x20capacity).'});}if(a1!=='none'){const bN=/(commission|affiliate|referr|attribut|partner_?payout)/i,bO=t['some'](bS=>bN['test'](bS['name'])),bP=ac['some'](bS=>bN['test'](bS['value_from']??'')||bN['test'](bS['recipient_key']??''));!bO&&!bP&&j['push']({'code':'AFFILIATE_RAIL_MISSING','detail':'affiliate_mode\x20\x27'+a1+'\x27\x20declares\x20a\x20referral/affiliate\x20commission\x20overlay,\x20but\x20machine_shape\x20has\x20no\x20'+'commission-family\x20node\x20and\x20the\x20allocator\x20has\x20no\x20commission\x20row\x20—\x20a\x20declared\x20partner\x20payout\x20with\x20no\x20rail\x20to\x20'+'walk\x20it\x20is\x20a\x20false\x20promise\x20at\x20quote\x20time\x20(INV-D3).\x20Add\x20an\x20INDEPENDENT\x20commission\x20leg:\x20a\x20Rate\x20row\x20off\x20a\x20'+'dedicated\x20commission\x20pool\x20(never\x20a\x20Surplus/Rate\x20drain\x20of\x20the\x20buyer\x27s\x20goods\x20escrow\x20—\x20防抢池)\x20to\x20an\x20explicit\x20'+'non-empty\x20partner\x20Entity,\x20gated\x20by\x20a\x20window-anchored\x20claim\x20guard\x20(INV-D1\x20rides\x20TIME-ANCHOR-01)\x20so\x20the\x20'+'commission\x20is\x20claimable\x20only\x20after\x20the\x20attribution/refund\x20window\x20closes.'});const bQ=/(post-?lock|锁后|clawback|不可追偿|不可撤销|unrecoverable|irrevocab|no\s*(?:revers|recov|clawback)|cannot be reversed|once released|released commission)/i,bR=(a['build_notes']??[])['some'](bS=>bQ['test'](bS));!bR&&j['push']({'code':'AFFILIATE_CLAWBACK_UNDISCLOSED','detail':'affiliate_mode\x20\x27'+a1+'\x27\x20declares\x20a\x20commission\x20but\x20no\x20build_note\x20discloses\x20the\x20post-lock\x20no-clawback\x20'+'truth\x20(INV-D2).\x20SOLE\x20TRUTH:\x20Allocation\x20distribute\x20is\x20a\x20ONE-WAY\x20outflow\x20(no\x20debit/clawback\x20primitive,\x20§11.0\x20G2),\x20'+'so\x20once\x20a\x20commission\x20is\x20RELEASED\x20it\x20CANNOT\x20be\x20reversed\x20on\x20chain\x20—\x20a\x20refund/chargeback\x20after\x20release\x20leaves\x20the\x20'+'affiliate\x20commission\x20unrecoverable.\x20Add\x20a\x20build_note\x20stating\x20this\x20honestly\x20(e.g.\x20\x22post-lock:\x20a\x20released\x20'+'affiliate\x20commission\x20is\x20unrecoverable\x20/\x20不可追偿\x20—\x20refunds\x20after\x20the\x20attribution\x20window\x20do\x20NOT\x20claw\x20back\x20the\x20'+'partner\x20payout\x22).\x20L-04/D-5:\x20never\x20imply\x20a\x20recovery\x20capability\x20the\x20chain\x20does\x20not\x20have.'});}if(a4!=='none'){const bS=/(releas|settle|funded|disburs|project)/i,bT=/(refund|missed|unmet|return|reimburse)/i,bU=t['some'](c7=>bS['test'](c7['name'])),bV=ac['some'](c7=>c7['track']==='settlement'&&(bS['test'](c7['guard_key']??'')||bS['test'](c7['recipient_key']??''))),bW=t['some'](c7=>bT['test'](c7['name'])),bX=ac['some'](c7=>c7['track']==='refund'||bT['test'](c7['guard_key']??''));!bU&&!bV&&j['push']({'code':'CROWDFUNDING_THRESHOLD_GATE_MISSING','detail':'crowdfunding_mode\x20\x27'+a4+'\x27\x20declares\x20a\x20campaign\x20but\x20machine_shape\x20has\x20no\x20release/settlement\x20'+'node\x20and\x20the\x20allocator\x20has\x20no\x20settlement\x20row\x20to\x20the\x20project\x20Entity\x20—\x20the\x20escrowed\x20contributions\x20would\x20'+'strand\x20at\x20the\x20deadline\x20with\x20no\x20exit\x20rail\x20(INV-E1).\x20Add\x20a\x20release\x20leg\x20(Rate\x2010000\x20to\x20a\x20NON-EMPTY\x20project\x20'+'Entity,\x20gated\x20at\x20the\x20campaign-deadline\x20settlement\x20terminal)\x20and,\x20for\x20a\x20threshold\x20campaign,\x20its\x20D-BUG-2\x20'+'refund\x20twin.'});a4==='threshold'&&!bW&&!bX&&j['push']({'code':'CROWDFUNDING_THRESHOLD_GATE_MISSING','detail':'crowdfunding_mode\x20\x27threshold\x27\x20declares\x20an\x20all-or-nothing\x20campaign\x20but\x20there\x20is\x20NO\x20refund-family\x20node/row\x20—\x20'+'a\x20missed\x20goal\x20would\x20strand\x20every\x20contribution\x20instead\x20of\x20returning\x20it\x20(INV-E1\x20/\x20D-BUG-2).\x20Add\x20the\x20refund\x20'+'leg\x20(per-contributor,\x20order-anchored\x20user\x20slot\x200\x20—\x20the\x20submitted\x20Order,\x20never\x20slot\x20254,\x20claimed_by\x20some==false)\x20as\x20the\x20mutually-exclusive\x20twin\x20of\x20the\x20'+'release\x20leg:\x20aggregate\x20>=\x20goal\x20→\x20release;\x20aggregate\x20<\x20goal\x20→\x20refund.'});if(a4==='threshold'){const c7=x['some'](c8=>(c8['host']==='repository'||/repository_write/i['test'](c8['template_id']))&&(c8['policy']?.['id_from']??'')['toLowerCase']()==='signer');!c7&&j['push']({'code':'CROWDFUNDING_AGGREGATE_UNBOUND','detail':'crowdfunding_mode\x20\x27threshold\x27\x20gates\x20release\x20on\x20an\x20aggregate\x20funding\x20total,\x20but\x20no\x20host:\x22repository\x22\x20'+'write\x20policy\x20is\x20writer-bound\x20(id_from\x20signer)\x20—\x20the\x20sum-where\x20(1174)\x20total\x20would\x20be\x20forgeable,\x20so\x20'+'anyone\x20could\x20inflate\x20the\x20aggregate\x20and\x20fake\x20a\x20\x27goal\x20met\x27\x20(INV-E2\x20/\x20R-X1-17:\x20existence-is-not-trust).\x20'+'Bind\x20the\x20contribution\x20Repository\x20write_guard\x20to\x20the\x20contributing\x20backer\x20'+'(pattern.repository_write_authorization,\x20id_from\x20signer,\x20an\x20identity\x20leaf\x20order.owner==Signer).'});}const bY=a['build_notes']??[],bZ=/(attest|keeper|aggregate trust|read-?only sum|not a chain-?verified|只读求和|聚合值|独立重算)/i,c0=/(not investment|non-?investment|不构成投资|收益承诺|no (?:investment )?return|never promise)/i,c1=/(kyc|aml|securities|money-?transmission|regulatory|跨境|合规)/i,c2=/(no-?refund|non-?refundable|keep-?it-?all|不退|不提供退款|不设达标)/i,c3=bY['some'](c8=>c0['test'](c8)),c4=bY['some'](c8=>c1['test'](c8)),c5=a4==='threshold'?bY['some'](c8=>bZ['test'](c8)):!![],c6=a4==='flexible'?bY['some'](c8=>c2['test'](c8)):!![];if(!c5||!c3||!c4||!c6){const c8=[!c5?'the\x20aggregate-trust\x20boundary\x20(the\x20funding\x20total\x20is\x20a\x20keeper-attested\x20Repository\x20sum,\x20NOT\x20a\x20chain-verified\x20money\x20oracle)':null,!c3?'the\x20L-01\x20non-investment\x20statement\x20(never\x20promise\x20returns\x20/\x20promote\x20coin\x20price;\x20不构成投资建议或收益承诺)':null,!c4?'the\x20L-05\x20KYC/AML\x20+\x20cross-border\x20regulatory\x20caution\x20(HIGH\x20intensity)':null,!c6?'the\x20flexible\x20keep-it-all\x20NO-REFUND\x20posture\x20(contributions\x20non-refundable\x20once\x20the\x20deadline\x20passes;\x20不提供退款)':null]['filter'](Boolean);j['push']({'code':'CROWDFUNDING_DISCLOSURE_MISSING','detail':'crowdfunding_mode\x20\x27'+a4+'\x27\x20declares\x20a\x20campaign\x20but\x20no\x20build_note\x20carries:\x20'+c8['join'](';\x20')+'\x20'+'(INV-E3\x20/\x20L-04\x20/\x20L-01\x20/\x20L-05).\x20Add\x20these\x20as\x20honest\x20build_notes\x20—\x20never\x20present\x20an\x20attested\x20aggregate\x20as\x20a\x20'+'chain-verified\x20custody\x20proof,\x20never\x20imply\x20investment\x20returns,\x20and\x20flag\x20the\x20compliance\x20surface.'});}}if(M!=='none'){const c9=t['some'](cf=>/review/i['test'](cf['name']));M==='review'&&!c9&&j['push']({'code':'REVIEW_NODE_MISSING','detail':'review_mode\x20\x27'+M+'\x27\x20declares\x20the\x20buyer\x20review\x20reputation\x20rail,\x20but\x20machine_shape\x20has\x20no\x20'+'\x27reviewed\x27\x20node.\x20Add\x20a\x20buyer-advanced\x20review\x20node\x20(operator\x20order_payer)\x20with\x20an\x20EXIT\x20edge\x20back\x20to\x20the\x20'+'settlement\x20rail\x20(R-DEAD-END:\x20a\x20zero-exit\x20review\x20node\x20strands\x20the\x20escrow),\x20or\x20anchor\x20the\x20claim\x20on\x20the\x20'+'delivered\x20terminal\x20via\x20a\x20host:\x22reward\x22\x20guard\x20(review_mode\x20\x22review_reward\x22\x20variant).'});const ca=x['find'](cf=>cf['host']==='reward'),cb=t['find'](cf=>/review/i['test'](cf['name']))?.['name'];let cc,cd;if(cb!==undefined){const cf=[];for(const ci of t){for(const cj of ci['from']??[]){const ck=typeof cj==='string'?{'prev':cj,'guard_key':undefined}:cj;cf['push']({'prev':ck['prev'],'guard_key':ck['guard_key'],'target':ci['name']});}}const cg=cf['find'](cl=>cl['target']===cb&&cl['guard_key']!==undefined)?.['guard_key']??cf['find'](cl=>cl['prev']===cb&&cl['guard_key']!==undefined)?.['guard_key'],ch=cg!==undefined?y['get'](cg):undefined;cc=ch?.['step_id'],cd=cg;}cc===undefined&&ca?.['step_id']!==undefined&&(cc=ca['step_id'],cd=ca['key']);const ce=M==='review_reward'&&ca?.['step_id']!==undefined&&cc!==undefined;ce&&k['push']({'op':'create','id':'guard_review_decision','object':'guard','params':P({'description':'Merchant\x20review-decision\x20write\x20credential:\x20only\x20the\x20service\x20provider\x20(permission\x20owner\x20or\x20admin)\x20may\x20write\x20U64\x20decision\x20rows\x20(row\x20id\x20=\x20order\x20address,\x20value\x20=\x20approved\x20payout)\x20under\x20the\x20review\x20repository\x27s\x20\x27review_decision\x27\x20policy.','table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'order_being_approved'},{'identifier':0x1,'b_submission':![],'value_type':'Address','value':ref('service'),'name':'this_service'},{'identifier':0x2,'b_submission':!![],'value_type':'Address','name':'service_permission'}],'root':{'type':'logic_and','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'order.service','object':{'identifier':0x0},'parameters':[]},{'type':'identifier','identifier':0x1}]},{'type':'logic_equal','nodes':[{'type':'query','query':'service.permission','object':{'identifier':0x1},'parameters':[]},{'type':'identifier','identifier':0x2}]},{'type':'logic_or','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'permission.owner','object':{'identifier':0x2},'parameters':[]},{'type':'context','context':'Signer'}]},{'type':'query','query':'permission.admin\x20has','object':{'identifier':0x2},'parameters':[{'type':'context','context':'Signer'}]}]}]}}),'notes':'REVIEW-DECISION\x20write\x20credential\x20(allocator\x20dynamic-permission\x20shape,\x20service\x20pinned\x20by\x20plan\x20ref\x20—\x20survives\x20permission\x20rotation).\x20The\x20decision\x20write\x20itself:\x20repository.data_add\x20'+'{name:\x27review_decision\x27,\x20items:[{write_guard:\x27<this\x20guard>\x27,\x20data:[{id:<order\x20address>,\x20data:<approved\x20payout\x20U64>}]}]}\x20with\x20a\x20passport\x20submission\x20carrying\x20the\x20order\x20and\x20the\x20permission.'});if(cc!==undefined){const cl=b['buyer_review_enabled']===!![];k['push']({'op':'create','id':'repository_review','object':'repository','params':P({'name':h+'_review','description':'Structured\x20buyer\x20reputation\x20rows\x20(AR-1:\x20emitted\x20by\x20the\x20build\x20plan\x20—\x20no\x20manual\x20setup).','policies':[{'name':'review','description':'One\x20immutable\x20row\x20per\x20buyer\x20(id_from=Signer;\x20write-once\x20—\x20a\x20rewrite\x20attempt\x20aborts\x20on-chain,\x20K3(a)).\x20Writes\x20require\x20the\x20review\x20credential\x20(guard\x20key\x20\x27'+cd+'\x27).\x20Payload:\x20JSON\x20text\x20{rating,\x20tags?,\x20orderRef?}.','write_guard':[{'guard':ref(cc)}],'id_from':'signer','value_type':'String','write_once':!![]},{'name':'rating','description':'Order-keyed\x20numeric\x20rating\x20(F-62):\x20one\x20U64\x20row\x20per\x20ORDER\x20(id_from=None;\x20row\x20id\x20=\x20the\x20order\x20address;\x20value\x20=\x20stars,\x20e.g.\x201..5;\x20write-once\x20—\x20a\x20rewrite\x20attempt\x20aborts\x20on-chain,\x20K3(a)).\x20Writes\x20require\x20the\x20same\x20review\x20credential\x20as\x20the\x20\x27review\x27\x20text\x20policy\x20—\x20a\x20verified\x20completed-order\x20buyer.\x20This\x20—\x20not\x20the\x20Signer-keyed\x20\x27review\x27\x20String\x20row\x20—\x20is\x20the\x20row\x20a\x20reward\x20good-review\x20leg\x20must\x20query\x20(query\x20repository.data:\x20the\x20policy-name\x20String\x20row\x20+\x20the\x20order-address\x20identifier\x20row,\x20compared\x20against\x20the\x20rating\x20floor).\x20The\x20text\x20row\x20is\x20display;\x20this\x20row\x20is\x20payout\x20authority.','write_guard':[{'guard':ref(cc)}],'id_from':'none','value_type':'U64','write_once':!![]},...cl?[{'name':'buyer_review','description':'Merchant-side\x20structured\x20feedback\x20on\x20the\x20order/buyer\x20(D-R7\x20bidirectional\x20reputation,\x20opt-in).\x20One\x20immutable\x20row\x20per\x20writer\x20(id_from=Signer;\x20write-once\x20—\x20a\x20rewrite\x20attempt\x20aborts\x20on-chain,\x20K3(a)).\x20NO\x20write\x20guard\x20by\x20design:\x20merchant\x20authority\x20is\x20verified\x20at\x20READ\x20time\x20(the\x20writer\x20must\x20control\x20the\x20order\x27s\x20service\x20—\x20graph\x20ControlIndex).\x20Payload:\x20JSON\x20text\x20{rating,\x20tags?,\x20orderRef?}.','id_from':'signer','value_type':'String','write_once':!![]}]:[],...ce?[{'name':'review_decision','description':'Merchant\x20approval\x20ledger\x20for\x20the\x20review\x20bounty\x20(professional\x20form):\x20one\x20U64\x20row\x20per\x20order\x20(id_from=None;\x20row\x20id\x20=\x20the\x20order\x20address;\x20value\x20=\x20approved\x20payout\x20in\x20smallest\x20units).\x20A\x20row\x20whose\x20value\x20>=\x20the\x20promised\x20payout\x20IS\x20the\x20approval\x20the\x20claim\x20guard\x27s\x20decision\x20leg\x20reads\x20(tpl_repository_review_decision_gate).\x20Writes\x20REQUIRE\x20the\x20merchant\x20decision\x20credential\x20(guard\x20step\x20\x27guard_review_decision\x27);\x20buyers\x20hold\x20no\x20write\x20path.','write_guard':[{'guard':ref('guard_review_decision')}],'id_from':'none','value_type':'U64'}]:[]]}),'notes':'REVIEW-COMPONENT\x20AR-1:\x20the\x20review\x20TEXT\x20still\x20rides\x20the\x20forward\x20message\x20(D-R1\x20dual\x20carrier);\x20this\x20repository\x20carries\x20ONLY\x20the\x20structured\x20row.\x20The\x20buyer\x20writes\x20BOTH\x20rows\x20at\x20review\x20time:\x20\x27review\x27\x20(text\x20JSON,\x20id\x20=\x20own\x20address)\x20AND\x20\x27rating\x27\x20(U64\x20stars,\x20id\x20=\x20the\x20ORDER\x20address\x20—\x20repository.data_add\x20{name:\x27rating\x27,\x20items:[{data:[{id:<order\x20address>,\x20data:<stars>}]}]},\x20same\x20passport\x20as\x20the\x20forward).\x20The\x20\x27rating\x27\x20row\x20is\x20what\x20a\x20reward\x20good-review\x20leg\x20reads\x20(F-62):\x20a\x20good-review\x20bounty\x20claim\x20guard\x20must\x20query\x20this\x20order-keyed\x20U64\x20row,\x20never\x20the\x20Signer-keyed\x20text\x20row.\x20Buyers\x20resolve\x20this\x20object\x20by\x20name\x20(workspace/onchain_objects)\x20—\x20never\x20guess\x20an\x20address.'+(ce?'\x20[review_decision\x20policy\x20frozen\x20AFTER\x20its\x20write\x20credential\x20—\x20the\x20guard\x20exists\x20before\x20this\x20create\x20(HOST-GRAPH-01\x20discipline).]':'')}),k['push']({'op':'configure','id':'service_review_repository','target':ref('service'),'method':'repositories','params':P({'op':'add','objects':[ref('repository_review')]}),'requires':['service','repository_review']});}if(M==='review_reward'){const cm=ca;if(cm===undefined||cm['step_id']===undefined)j['push']({'code':'REVIEW_REWARD_GUARD_MISSING','detail':'review_mode\x20\x27review_reward\x27\x20promises\x20a\x20claim\x20reward,\x20but\x20no\x20RESOLVED\x20host:\x22reward\x22\x20guard\x20spec\x20'+'exists\x20to\x20gate\x20the\x20claim.\x20Mount\x20a\x20reward\x20claim\x20guard\x20(e.g.\x20pattern.progress_state_check\x20anchored\x20'+'on\x20the\x20review\x20node\x20or\x20the\x20delivered\x20terminal\x20+\x20review\x20evidence\x20hash)\x20and\x20keep\x20it\x20resolvable\x20—\x20'+'an\x20unguarded\x20incentive\x20promise\x20must\x20not\x20publish\x20(INV-4).\x20The\x20root\x20must\x20also\x20carry\x20the\x20BKN-P2\x20'+'positive-amount\x20leg\x20(order.amount\x20>=\x201)\x20so\x20zero-total\x20orders\x20can\x20never\x20claim.'});else{const cn=b['reward_funding'],co=C['get'](cm['key']);co!==undefined&&!rootHasRewardRecordGate(co['root'])&&j['push']({'code':'REVIEW_REWARD_UNARMED','detail':'review_reward\x20claim\x20guard\x20\x27'+cm['key']+'\x27\x20carries\x20no\x20record-gate:\x20Reward.claim\x20has\x20no\x20order\x20binding\x20of\x20its\x20own\x20'+'(OFN-C1),\x20so\x20a\x20funded\x20pool\x20behind\x20this\x20guard\x20is\x20a\x20replay-drain\x20target.\x20'+SV2_UNARMED_PRESCRIPTION+'\x20—\x20wrapped\x20in\x20'+'logic_and\x20with\x20the\x20identity\x20leg\x20(Signer\x20==\x20order.owner),\x20the\x20BKN-P2\x20positive-amount\x20'+'leg\x20(order.amount\x20>=\x201\x20—\x20zero-total\x20orders\x20must\x20never\x20claim)\x20and\x20the\x20existing\x20checks\x20'+'(see\x20tpl_reward_one_time_claim\x20v55\x20notes;\x20guard-risk\x20R-X1-14\x20audits\x20the\x20built\x20guard).\x20'+'Professional\x20approval\x20form:\x20this\x20plan\x20already\x20emits\x20the\x20decision\x20channel\x20(guard\x20step\x20'+'\x27guard_review_decision\x27\x20+\x20the\x20repository\x27s\x20\x27review_decision\x27\x20policy)\x20—\x20compose\x20the\x20'+'decision\x20leg\x20from\x20tpl_repository_review_decision_gate\x20into\x20the\x20root\x20'+'(find_where\x20over\x20\x27review_decision\x27\x20with\x20vec_contains_address\x20pinning\x20the\x20submitted\x20'+'order)\x20so\x20the\x20bounty\x20pays\x20only\x20merchant-approved\x20orders.\x20'+'Until\x20armed,\x20do\x20not\x20fund\x20the\x20pool.'});let cp;if(co!==undefined&&rootHasRewardRecordGate(co['root']))for(const cq of co['table']){const cr=cq;if(cr['b_submission']===!![]&&String(cr['value_type']??'')['toLowerCase']()==='address'&&(String(cr['object_type']??'')==='Order'||/order/i['test'](String(cr['name']??'')))){cp=cr['identifier'];break;}}k['push']({'op':'configure','id':'reward_review_guard_add','target':ref('reward_review'),'method':'guard_add','params':P({'guard':ref(cm['step_id']),'recipient':{'Signer':'signer'},...cp!==undefined?{'store_from_id':cp}:{}}),'requires':['reward_review'],'notes':'RECIPIENT\x20(crs-mn-261015\x20F-12):\x20recipient\x20is\x20pinned\x20to\x20{Signer:\x27signer\x27}\x20—\x20the\x20claim\x20entry\x20'+'requires\x20recipient\x20==\x20the\x20transaction\x20sender\x20(E_CLAIM_RECIPIENT_NOT_SIGNER\x20otherwise);\x20a\x20GuardIdentifier\x20recipient\x20'+'resolves\x20to\x20the\x20submitted\x20Order\x20and\x20can\x20never\x20be\x20paid.\x20Fill\x20amount\x20=\x20the\x20per-claim\x20bounty\x20'+'(smallest\x20units)\x20when\x20executing.'+(cp!==undefined?'\x20SV-2\x20entry\x20stamp:\x20store_from_id\x20pins\x20the\x20per-order\x20stamp\x20slot\x20(the\x20submitted\x20Order\x20'+'address)\x20so\x20claim\x20records\x20key\x20per\x20order\x20—\x20once\x20per\x20buyer\x20per\x20order\x20(azx7-mn-261014\x20T8).':'')}),k['push']({'op':'configure','id':'service_rewards','target':ref('service'),'method':'rewards','params':P({'op':'add','objects':[ref('reward_review')]}),'requires':['service']}),typeof cn==='string'||typeof cn==='number'?k['push']({'op':'configure','id':'reward_review_coin_add','target':ref('reward_review'),'method':'coin_add','params':{'coin':String(cn)},'requires':['reward_review']}):j['push']({'code':'REVIEW_REWARD_UNFUNDED','detail':'review_mode\x20\x27review_reward\x27\x20without\x20a\x20\x27reward_funding\x27\x20input\x20(INV-4\x20R-REWARD-FUNDED):\x20the\x20incentive\x20'+'is\x20a\x20marketing\x20promise\x20that\x20must\x20be\x20FUNDED\x20when\x20the\x20Service\x20is\x20built\x20(sale-time\x20planning\x20—\x20pool\x20>=\x20'+'expected\x20orders\x20x\x20per-order\x20reward,\x20benchmark\x20fee_param\x20review_reward_pool).\x20Pass\x20reward_funding\x20'+'(smallest-unit\x20string)\x20to\x20fund\x20the\x20Reward\x20object,\x20or\x20drop\x20to\x20review_mode\x20\x22review\x22.'});}}}if(J){k['push']({'op':'create','id':'arbitration','object':'arbitration','params':P({'name':h+'_arbitration','permission':ref('permission_arb'),'type_parameter':aa}),'notes':'Independent\x20venue\x20(R2).\x20New\x20arbitrations\x20default\x20bPaused=true\x20—\x20unpause\x20is\x20a\x20separate\x20operator\x20step.'}),k['push']({'op':'configure','id':'service_arbitrations','target':ref('service'),'method':'arbitrations','params':P({'op':'add','objects':[ref('arbitration')]})});const cs=b['compensation_fund'];(typeof cs==='string'||typeof cs==='number')&&k['push']({'op':'configure','id':'service_compensation','target':ref('service'),'method':'compensation_fund_add','params':{'balance':String(cs)}});}k['push']({'op':'publish','id':'service_publish','target':ref('service'),'preflight':[{'check':'service_publish','status':'pending'},{'check':'FUND-EXIT-01','status':'pending'},{'check':'PLAN-ALLOC-01','status':'pending'},{'check':'TASKBIND-02','status':'pending'}]});const ah=new Set(u['map'](ct=>ct['guard_key'])['filter'](ct=>typeof ct==='string')),ai=/^0x[0-9a-fA-F]{20,64}$/,aj=ct=>{const cu=C['get'](ct);if(cu===undefined)return undefined;for(const cv of cu['table']){const cw=cv;if(cw['b_submission']===!![]||cw['value_type']!=='Address')continue;const cx=cw['value'];if(typeof cx==='string'&&ai['test'](cx))return String(cw['identifier']??'?');}return undefined;};for(const ct of C['keys']()){if(!F['has'](ct)&&!ah['has'](ct))continue;const cu=aj(ct);cu!==undefined&&j['push']({'code':'GUARD_FOREIGN_SERVICE','detail':'guard\x20\x27'+ct+'\x27\x20pins\x20an\x20on-chain\x20address\x20literal\x20(table\x20slot\x20'+cu+')\x20while\x20bound\x20into\x20this\x20build.\x20'+'The\x20plan\x27s\x20Service\x20is\x20created\x20BY\x20this\x20plan\x20and\x20cannot\x20equal\x20a\x20pre-existing\x20address,\x20so\x20the\x20pin\x20names\x20a\x20foreign\x20or\x20'+'stale\x20object:\x20each\x20object\x20is\x20well-formed\x20alone,\x20but\x20the\x20cross-object\x20identity\x20assert\x20aborts\x20every\x20guarded\x20forward\x20'+'(klook\x20B11\x20class),\x20and\x20Guard\x20+\x20machine\x20are\x20both\x20create/publish-frozen\x20—\x20unrepairable.\x20'+'Bind\x20by\x20plan\x20reference\x20({\x22$ref\x22:\x22service\x22})\x20or\x20by\x20the\x20P16\x20circular\x20service\x20NAME\x20instead.'});}const ak=D['flatMap'](cv=>{const cw=ah['has'](cv['key'])?'allocator':F['has'](cv['key'])?'machine_edge':cv['host']==='service'&&cv['key']==='buy'?'service_buy':undefined;return cw?[{'key':cv['key'],'template_id':cv['template_id'],'host':cv['host'],'site':cw,'purpose':cv['purpose']}]:[];});return{'plan':{'version':0x1,'intent':d['intent']??'compile\x20'+a['id'],'templateId':a['id'],'inputs':b,'steps':k,...ak['length']>0x0?{'pending_guards':ak}:{}},'guardSpecs':x,'unresolved':D,'blockers':j,'omitted':[...w]};}
1
+ import{fillGuardTemplate,getTemplateById}from'../knowledge/guard-templates.js';import{GUARD_DESIGN_PATTERNS}from'../knowledge/guard-design-patterns.js';import{SV2_UNARMED_PRESCRIPTION,TWO_TX_RENEW_RECIPE}from'../knowledge/protocol-facts.js';import{verifyAllocatorRails}from'../knowledge/allocator-rail-verifier.js';import{TASK_BINDING_SLOT}from'../knowledge/onchain-constants.js';import{rootHasRewardRecordGate,afterSalesRailRegex as a11a,afterSalesRailNodeMatches}from'../knowledge/template-scanner.js';import{refsOf}from'./plan.js';const P=a=>a;function offTaskSlotIdentityLegs(a){const b=new Set(['order.owner','order.agent\x20has']),c=new Set(),d=[],e=f=>{if(f===null||typeof f!=='object')return;const g=f;if(g['type']==='logic_equal'&&Array['isArray'](g['nodes'])){const i=g['nodes']['filter'](j=>j!==null&&typeof j==='object'&&j['type']==='identifier'&&typeof j['identifier']==='number');if(i['some'](j=>j['identifier']===TASK_BINDING_SLOT)){for(const j of i)c['add'](j['identifier']);}}const h=g['object'];if(typeof g['query']==='string'&&b['has'](g['query'])&&h!==null&&typeof h==='object'&&typeof h['identifier']==='number'){const l=h['identifier'];if(l!==TASK_BINDING_SLOT)d['push']({'query':g['query'],'identifier':l});}if(Array['isArray'](g['nodes'])){for(const m of g['nodes'])e(m);}if(g['node']!==undefined&&typeof g['node']==='object')e(g['node']);};return e(a),d['filter'](f=>!c['has'](f['identifier']));}function safeId(a){return a['replace'](/[^a-zA-Z0-9_]/g,'_');}function ref(a){return{'$ref':a};}const MODE_MAP={'amount':'Amount','rate':'Rate','surplus':'Surplus'};export function compileTemplate(a,b,d={}){const h=d['nameBase']??a['id']['replace'](/\//g,'_'),i=d['merchantPermissionIndex']??0x3e8,j=[],k=[],l=new Set();for(const am of a['conditional_guards']??[]){const an=b[am['param']]??a['fee_params'][am['param']];if(an!==am['emit_value'])l['add'](am['guard_key']);}const p=new Map();for(const ao of a['conditional_guards']??[]){p['set'](ao['param'],(p['get'](ao['param'])??0x0)+0x1);}const q=new Set((a['conditional_guards']??[])['filter'](ap=>(p['get'](ap['param'])??0x0)>0x1)['map'](ap=>ap['guard_key'])),s=new Set([...l]['filter'](ap=>q['has'](ap))),t=s['size']>0x0?a['machine_shape']['map'](ap=>({...ap,'from':(ap['from']??[])['filter'](aq=>typeof aq==='string'||aq['guard_key']===undefined||!s['has'](aq['guard_key']))})):a['machine_shape'],u=s['size']>0x0?(a['allocator']['rows']??[])['filter'](ap=>ap['guard_key']===undefined||!s['has'](ap['guard_key'])):a['allocator']['rows']??[],v=[];for(const [ap,aq]of Object['entries'](d['guardResolutions']??{})){if(aq?.['kind']==='omit')v['push'](ap);}const w=new Set();if(v['length']>0x0){const ar=new Set(t['flatMap'](at=>(at['from']??[])['map'](au=>typeof au==='string'?undefined:au['guard_key'])['filter'](au=>typeof au==='string'))),as=new Set(u['map'](at=>at['guard_key'])['filter'](at=>typeof at==='string'));for(const at of v){const au=a['guards']['find']((aw,ax)=>(aw['key']??aw['template_id']+'#'+ax)===at);if(au===undefined)continue;const av=[];if(ar['has'](at))av['push']('a\x20machine\x20forward\x20edge\x20(guard_key)');if(as['has'](at))av['push']('an\x20allocator\x20rail\x20row\x20(guard_key)');if(au['policy']!==undefined)av['push']('a\x20Repository\x20write-policy\x20credential\x20(policy)');if(au['host']==='service'&&at==='buy')av['push']('the\x20Service\x20buy\x20gate\x20(buy_guard)');av['length']>0x0?j['push']({'code':'GUARD_OMIT_UNSUPPORTED','detail':'guard_resolutions[\x27'+at+'\x27]\x20=\x20{kind:\x27omit\x27}\x20refused:\x20this\x20design\x20is\x20bound\x20to\x20'+av['join']('\x20and\x20')+'\x20—\x20'+'omitting\x20it\x20would\x20orphan\x20the\x20binding\x20(open\x20rail\x20/\x20open\x20write\x20/\x20ungated\x20purchase).\x20'+'Fold\x20the\x20design\x27s\x20intent\x20into\x20the\x20bound\x20site\x20instead,\x20or\x20keep\x20the\x20guard\x20resolved.'}):w['add'](at);}}const x=a['guards']['map']((aw,ax)=>({'key':aw['key']??aw['template_id']+'#'+ax,'template_id':aw['template_id'],'host':aw['host'],'purpose':aw['purpose'],'policy':aw['policy'],'params':aw['params']}))['filter'](aw=>!l['has'](aw['key'])&&!w['has'](aw['key'])),y=new Map();{const aw=new Set(x['map'](ax=>ax['key']));for(const ax of t){for(const ay of ax['from']??[]){const az=typeof ay==='string'?{'prev':ay}:ay,aA=az['operator']??ax['operator']??(az['prev']===''?'order_payer':'merchant');if(aA!=='order_payer'||az['guard_key']!==undefined)continue;const aB=az['forward']??(az['prev']===''?'enter_'+ax['name']:az['prev']+'_to_'+ax['name']);if(y['has'](aB))continue;let aC='order_holder_'+aB;while(aw['has'](aC))aC=aC+'_x';aw['add'](aC),y['set'](aB,aC),x['push']({'key':aC,'template_id':'tpl_forward_order_holder','host':'machine','purpose':'F05\x20kernel-injected\x20order-holder\x20identity\x20binding\x20for\x20the\x20buyer-exclusive\x20forward\x20'+('\x27'+aB+'\x27\x20(edge\x20\x27'+az['prev']+'\x27->\x27'+ax['name']+'\x27):\x20namedOperator\x20\x22\x22\x20passes\x20for\x20')+'anyone\x20at\x20the\x20permission\x20layer\x20(progress.move:242-256),\x20so\x20without\x20this\x20guard\x20the\x20'+'buyer\x20rail\x20is\x20advanceable\x20by\x20ANY\x20passport\x20holder\x20attached\x20to\x20the\x20order\x20—\x20takeover\x20'+'risk.\x20Declare\x20an\x20explicit\x20order-holder\x20guard_key\x20on\x20the\x20edge\x20to\x20replace\x20this\x20'+'auto\x20key\x20with\x20a\x20named\x20credential.'});}}}const z=new Map(x['map'](aD=>[aD['key'],aD])),A=new Set(['wip_provenance','subscription_with_proof']),B=Array['isArray'](b['adopted_module_ids'])?b['adopted_module_ids']['filter'](aD=>typeof aD==='string'):[],C=x['some'](aD=>aD['host']==='repository'||aD['template_id']==='pattern.repository_data_check'||aD['template_id']==='pattern.repository_write_authorization'||aD['template_id']==='tpl_repository_row_present'||aD['template_id']==='tpl_repository_row_equals_order_field')||B['some'](aD=>A['has'](aD)),D=new Map(),E=[],F=x['map'](aD=>aD['key']);for(const aD of Object['keys'](d['guardResolutions']??{})){if(w['has'](aD))continue;!z['has'](aD)&&j['push']({'code':'GUARD_RESOLUTION_UNKNOWN','detail':'guard_resolutions\x20key\x20\x27'+aD+'\x27\x20matches\x20no\x20guard\x20spec\x20key\x20declared\x20by\x20\x27'+h+'\x27.\x20'+('Legal\x20keys:\x20'+(F['length']>0x0?F['join'](',\x20'):'(none\x20—\x20this\x20template\x20declares\x20no\x20keyed\x20guards)')+'.\x20')+'An\x20unknown\x20key\x20was\x20previously\x20dropped\x20silently,\x20leaving\x20the\x20intended\x20guard\x20pending\x20while\x20the\x20build\x20looked\x20resolved.'});}for(const aE of x){const aF='guard_'+safeId(aE['key']),aG=d['guardResolutions']?.[aE['key']];let aH=aE['purpose'],aI,aJ;if(aG?.['kind']==='inline')aI=aG['table'],aJ=aG['root'],aH=aG['description']??aE['purpose'];else{const aK=aG?.['kind']==='template'?aG['template_id']:aE['template_id']['startsWith']('tpl_')?aE['template_id']:undefined;if(aK!==undefined){const aL={'service_name':h+'_service',...C?{'repository_name':h+'_evidence'}:{},...a['fee_params'],...b,...aE['params'],...aG?.['kind']==='template'?aG['params']:{}},aM=fillGuardTemplate(aK,aL);!aM['ok']?j['push']({'code':'GUARD_TEMPLATE_PARAMS','detail':'guard\x20\x27'+aE['key']+'\x27\x20('+aK+'):\x20'+aM['error']}):(aI=aM['table'],aJ=aM['root']);}}aI!==undefined?(D['set'](aE['key'],{'stepId':aF,'description':aH,'table':aI,'root':aJ}),aE['step_id']=aF):(!aE['template_id']['startsWith']('tpl_')&&getTemplateById(aE['template_id'])===undefined&&!GUARD_DESIGN_PATTERNS['some'](aN=>aN['id']===aE['template_id'])&&j['push']({'code':'GUARD_PATTERN_UNKNOWN','detail':'guard\x20\x27'+aE['key']+'\x27\x20of\x20\x27'+h+'\x27\x20references\x20design\x20\x27'+aE['template_id']+'\x27,\x20which\x20exists\x20in\x20neither\x20the\x20Guard\x20design-pattern\x20catalog\x20nor\x20the\x20guard-template\x20registry\x20—\x20'+'no\x20resolution\x20path\x20can\x20ever\x20fill\x20it\x20(guide\x20confirm,\x20guard_resolutions\x20and\x20module\x20plumbing\x20all\x20key\x20off\x20real\x20ids).\x20'+'Keeping\x20it\x20as\x20a\x20pending\x20design\x20would\x20leave\x20its\x20bound\x20path\x20UNGUARDED\x20behind\x20a\x20plausible\x20pending\x20label\x20'+'(bs-mn-261022\x20TPL-01:\x20nine\x20such\x20specs\x20compiled\x20into\x20a\x20machine\x20with\x20no\x20guards\x20on\x20the\x20grant-lifecycle\x20forwards).\x20'+'Correct\x20the\x20template\x27s\x20guard\x20spec\x20id\x20to\x20a\x20known\x20pattern,\x20or\x20resolve\x20this\x20spec\x20explicitly\x20(guard_resolutions\x20with\x20kind\x20\x27inline\x27).'}),E['push'](aE));}const G=new Set(t['flatMap'](aN=>(aN['from']??[])['map'](aO=>typeof aO==='string'?undefined:aO['guard_key'])['filter'](aO=>typeof aO==='string')));for(const aN of u){typeof aN['guard_key']==='string'&&aN['recipient']==='guard_identifier'&&aN['recipient_key']===String(TASK_BINDING_SLOT)&&G['add'](aN['guard_key']);}const H=new Set();for(const aO of x){if(!G['has'](aO['key']))continue;const aP=D['get'](aO['key']);if(aP===undefined)continue;const aQ=aP['table']['some'](aR=>aR['identifier']===TASK_BINDING_SLOT);if(aQ)continue;D['set'](aO['key'],{...aP,'table':[...aP['table'],{'identifier':TASK_BINDING_SLOT,'b_submission':!![],'value_type':'Address','name':'task_binding\x20order\x20anchor\x20(protocol\x20slot\x20254;\x20written\x20by\x20order\x20creation)'}]}),H['add'](aO['key']);}const I=aR=>D['get'](aR)!==undefined&&refsOf({'table':D['get'](aR)['table'],'root':D['get'](aR)['root']})['has']('service'),J=aR=>{const aS=D['get'](aR),aT=z['get'](aR)?.['purpose'];return{'op':'create','id':aS['stepId'],'object':'guard','params':P({'description':aS['description'],'table':aS['table'],'root':aS['root']}),'notes':H['has'](aR)?(aT??'Guard')+'\x20[kernel:\x20protocol\x20slot\x20254\x20(task\x20binding)\x20auto-declared]':aT};};k['push']({'op':'create','id':'permission','object':'permission','params':{'name':h+'_permission'}});const K=a['arbitration_mode']!==undefined&&a['arbitration_mode']!=='none';K&&k['push']({'op':'create','id':'permission_arb','object':'permission','params':{'name':h+'_arb_permission'},'notes':'MUST\x20be\x20created\x20by\x20a\x20different\x20account\x20than\x20the\x20service\x20permission\x20'+'(E_ARBITRATION_PERMISSION_CONFLICT=33):\x20dispute\x20neutrality.'});k['push']({'op':'create','id':'contact','object':'contact','params':{'name':h+'_contact'},'notes':'R8:\x20customer-service\x20channel;\x20mandatory\x20when\x20customer_required\x20is\x20set.'});const L=b['review_mode'],M=L==='review'||L==='review_reward'||L==='none'?L:undefined,N=M??a['review_mode']??'none',O=h+'_review_reward',Q=b['after_sales_mode'],R=Q==='return'||Q==='exchange'||Q==='warranty'||Q==='none'?Q:undefined,S=R??a['after_sales_mode']??'none',T=b['acceptance_mode'],U=T==='milestone'||T==='contest'||T==='bounty'||T==='agent'||T==='none'?T:undefined,V=U??a['acceptance_mode']??'none',W=V==='contest'||V==='bounty'||V==='agent',X=b['installment_mode'],Y=X==='deposit_balance'||X==='milestone_n'||X==='none'?X:undefined,Z=Y??a['installment_mode']??'none',a0=b['affiliate_mode'],a1=a0==='commission'||a0==='none'?a0:undefined,a2=a1??a['affiliate_mode']??'none',a3=b['crowdfunding_mode'],a4=a3==='threshold'||a3==='flexible'||a3==='none'?a3:undefined,a5=a4??a['crowdfunding_mode']??'none',a6=aR=>{const aS=new Set(),aT=aU=>{if(Array['isArray'](aU)){for(const aW of aU)aT(aW);return;}if(typeof aU!=='object'||aU===null)return;const aV=aU;if(typeof aV['type']==='string'&&aV['type']['startsWith']('query_reward_record')){const aX=aV['object'];if(aX!==undefined&&typeof aX['identifier']==='number')aS['add'](aX['identifier']);}for(const aY of Object['values'](aV))aT(aY);};return aT(aR),aS;},a7=N==='review_reward'?x['find'](aR=>aR['host']==='reward'):undefined;if(N==='review_reward'&&a7?.['step_id']!==undefined){const aR=D['get'](a7['key']);if(aR!==undefined){const aS=a6(aR['root']);D['set'](a7['key'],{...aR,'table':aR['table']['map'](aT=>{const aU=aT;if(aU['b_submission']===!![]||!aS['has'](aU['identifier']))return aT;return{...aU,'value':{'$late':{'by':'local_name','mark':O}}};})});}k['push']({'op':'create','id':'reward_review','object':'reward','params':P({'name':O,'description':'Review\x20incentive\x20pool\x20(sale-time\x20planned;\x20terms\x20disclosed\x20at\x20quote/buy):\x20claim\x20gated\x20by\x20guard\x20\x27'+a7['key']+'\x27.'}),'notes':'REVIEW-COMPONENT:\x20the\x20funded\x20reward\x20must\x20be\x20perceivable\x20by\x20the\x20buyer\x20BEFORE\x20ordering\x20—\x20the\x20full\x20terms\x20ride\x20the\x20quote/buy\x20surface\x20(REVIEW-COMPONENT-PLAN\x20§四).\x20'+'[ZR-08:\x20created\x20BEFORE\x20its\x20claim\x20guard\x20—\x20the\x20guard\x27s\x20Reward-address\x20row\x20freezes\x20at\x20creation\x20and\x20binds\x20this\x20pool\x20by\x20local\x20name]'});}const a8=[];for(const [aT]of D){I(aT)?a8['push'](aT):k['push'](J(aT));}if(C){const aU=Array['isArray'](b['repository_policies'])?b['repository_policies']['filter'](aX=>typeof aX==='object'&&aX!==null):[],aV=[...aU],aW=new Set(aU['map'](aX=>aX['name']));for(const aX of x){if(aX['host']!=='repository'||aX['step_id']===undefined)continue;const aY='host:\x22repository\x22\x20guard\x20\x27'+aX['key']+'\x27\x20(step\x20\x27'+aX['step_id']+'\x27)';if(aX['policy']===undefined){j['push']({'code':'REPO_GUARD_POLICY_MISSING','detail':aY+'\x20declares\x20no\x20policy\x20on\x20the\x20guards[]\x20entry.\x20Its\x20Repository\x20policy\x20'+'(name\x20/\x20id_from\x20/\x20value_type)\x20is\x20business\x20data\x20the\x20kernel\x20must\x20not\x20fabricate,\x20'+'and\x20an\x20unbound\x20repository\x20guard\x20is\x20an\x20orphan\x20create\x20that\x20leaves\x20the\x20Repository\x20'+'open\x20to\x20any\x20writer.\x20Add\x20policy:{name,\x20id_from,\x20value_type}\x20to\x20the\x20spec,\x20or\x20bind\x20'+'the\x20guard\x20through\x20repository_policies\x20inputs\x20with\x20this\x20guard\x27s\x20own\x20write_guard\x20shape.'});continue;}if(I(aX['key'])){j['push']({'code':'REPO_GUARD_POLICY_MISSING','detail':aY+'\x20refs\x20the\x20service,\x20so\x20it\x20is\x20created\x20AFTER\x20the\x20service\x20draft\x20—\x20but\x20the\x20'+'Repository\x20freezes\x20its\x20policies\x20at\x20creation,\x20which\x20happens\x20before.\x20Resolve\x20this\x20'+'guard\x20without\x20a\x20service\x20reference\x20(the\x20writers\x20are\x20asserted\x20by\x20identity,\x20not\x20by\x20'+'service\x20pin),\x20or\x20bind\x20the\x20policy\x20manually\x20via\x20repository_policies\x20inputs.'});continue;}const aZ=aX['policy']['name']??aX['key'],b0=(aX['policy']['id_from']??'signer')['toLowerCase'](),b1=aX['policy']['id_from_submission'],b2=aX['policy']['data_from_submission'];b1!==undefined&&(b0==='signer'||b0==='clock')&&j['push']({'code':'REPO_GUARD_SUBMISSION_ID_FORBIDDEN','detail':aY+'\x20declares\x20id_from_submission\x20'+b1+'\x20while\x20its\x20policy\x20id_from\x20is\x20'+('\x27'+b0+'\x27\x20—\x20the\x20row\x20id\x20is\x20AUTO-generated\x20from\x20the\x20'+b0+'\x20there,\x20and\x20a\x20')+'submission-derived\x20id\x20conflicts\x20with\x20that\x20routing\x20(the\x20chain\x20aborts\x20policy\x20creation\x20'+'with\x20E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN\x20=\x2023;\x20policies\x20freeze\x20at\x20Repository\x20'+'creation,\x20so\x20this\x20must\x20be\x20fixed\x20before\x20publish,\x20BK15-F13).\x20Drop\x20id_from_submission\x20'+'(keep\x20data_from_submission\x20—\x20the\x20value\x20leg\x20is\x20legal\x20under\x20signer\x20routing),\x20or\x20switch\x20'+'the\x20policy\x20to\x20id_from\x20\x22none\x22\x20(caller-supplied\x20row\x20key,\x20guarded\x20by\x20this\x20write_guard).'});{const b3=D['get'](aX['key']),b4=[['id_from_submission',b1],['data_from_submission',b2]];for(const [b5,b6]of b4){if(b6===undefined)continue;const b7=b3?.['table']['find'](b8=>b8['identifier']===b6);(b3===undefined||b7===undefined||b7['b_submission']!==!![])&&j['push']({'code':'REPO_GUARD_SUBMISSION_SLOT_UNKNOWN','detail':aY+'\x20declares\x20'+b5+'\x20'+b6+',\x20but\x20the\x20resolved\x20guard\x20table\x20has\x20'+'NO\x20b_submission=true\x20row\x20at\x20that\x20identifier\x20—\x20the\x20passport\x20builder\x20DROPS\x20'+'undeclared\x20slots,\x20so\x20this\x20pairing\x20leg\x20would\x20silently\x20derive\x20nothing\x20at\x20write\x20'+'time\x20(the\x20write\x20aborts\x20or\x20writes\x20caller-free\x20values,\x20BK15-F13).\x20Declare\x20a\x20'+('b_submission=true\x20table\x20row\x20at\x20identifier\x20'+b6+'\x20on\x20the\x20guard,\x20or\x20point\x20')+(b5+'\x20at\x20an\x20existing\x20submission\x20slot.')});}}if(aW['has'](aZ))continue;aV['push']({'name':aZ,'description':aX['policy']['description']??aX['purpose'],'write_guard':[{'guard':ref(aX['step_id']),...b1!==undefined?{'id_from_submission':b1}:{},...b2!==undefined?{'data_from_submission':b2}:{}}],'id_from':aX['policy']['id_from']??'signer','value_type':aX['policy']['value_type']??'String','write_once':aX['policy']['write_once']??![]});}k['push']({'op':'create','id':'repository','object':'repository','params':P({'name':h+'_evidence',...aV['length']>0x0?{'policies':aV}:{}}),'notes':'Evidence\x20rows\x20(tracking\x20hash,\x20receipts,\x20WTS\x20proofs).\x20[HOST-GRAPH-01:\x20created\x20after\x20wave-A\x20guards;\x20write_guard\x20policies\x20synthesized\x20from\x20resolved\x20host:\x22repository\x22\x20specs]'});}const a9=new Set(t['map'](b8=>b8['name'])),aa=[];for(const b8 of t){if(b8['from']===undefined||b8['from']['length']===0x0){j['push']({'code':'MACHINE_EDGES_MISSING','detail':'machine_shape\x20node\x20\x27'+b8['name']+'\x27\x20declares\x20no\x20\x27from\x27\x20edges.\x20Edges\x20are\x20data\x20'+'(REPORT\x20#10\x20A-2:\x20a\x20missing\x20paid->closed_cancel\x20edge\x20bricks\x20the\x20shop\x20at\x20publish).\x20'+'Annotate\x20the\x20node\x20with\x20from:\x20[...]\x20(use\x20prev:\x20\x22\x22\x20for\x20the\x20entry\x20edge).'});continue;}const b9=[],ba=new Map(),bb=new Map();for(const bd of b8['from']){const be=typeof bd==='string'?{'prev':bd}:bd;if(be['prev']!==''&&!a9['has'](be['prev'])){j['push']({'code':'EDGE_UNKNOWN_PREV','detail':'node\x20\x27'+b8['name']+'\x27\x20edge\x20prev\x20\x27'+be['prev']+'\x27\x20is\x20not\x20a\x20machine_shape\x20node'});continue;}const bf=be['operator']??b8['operator']??(be['prev']===''?'order_payer':'merchant'),bg=be['forward']??(be['prev']===''?'enter_'+b8['name']:be['prev']+'_to_'+b8['name']),bh={'name':bg,'weight':0x1,...bf==='order_payer'?{'namedOperator':''}:{'permissionIndex':be['permission_index']??i}};if(be['guard_key']!==undefined){const bl=z['get'](be['guard_key']);if(bl===undefined)j['push']({'code':'GUARD_KEY_UNKNOWN','detail':'edge\x20\x27'+be['prev']+'\x27->\x27'+b8['name']+'\x27\x20binds\x20unknown\x20guard_key\x20\x27'+be['guard_key']+'\x27'});else{for(const bm of bl['purpose']['matchAll'](/progress\.current\s*==\s*([a-z0-9_]+)/g)){const bn=bm[0x1];a9['has'](bn)&&bn!==be['prev']&&j['push']({'code':'FORWARD_GUARD_PINNED_TO_NON_PREV','detail':'edge\x20\x27'+be['prev']+'\x27->\x27'+b8['name']+'\x27\x20guard\x20\x27'+bl['key']+'\x27\x20pins\x20progress.current\x20==\x20\x27'+bn+'\x27,\x20but\x20a\x20'+('forward\x20guard\x20evaluates\x20BEFORE\x20the\x20advance\x20(progress.current\x20==\x20prev\x20\x27'+be['prev']+'\x27),\x20so\x20the\x20pin\x20')+'can\x20never\x20pass\x20—\x20dead\x20rail\x20(bkng\x20F22).\x20Keep\x20the\x20pin\x20on\x20the\x20allocator\x20row\x20(evaluated\x20at\x20alloc,\x20'+'current\x20=\x20the\x20reached\x20node);\x20put\x20only\x20time/identity\x20legs\x20on\x20the\x20forward.'});}(bl['template_id']==='pattern.identity_check_order_holder'||bl['template_id']==='tpl_forward_order_holder'||bl['template_id']==='tpl_forward_order_holder_or_time'||bl['template_id']==='tpl_time_window_upper_order_holder')&&bf!=='order_payer'&&j['push']({'code':'FORWARD_GUARD_IDENTITY_PERM_CONFLICT','detail':'edge\x20\x27'+be['prev']+'\x27->\x27'+b8['name']+'\x27\x20guard\x20\x27'+bl['key']+'\x27\x20is\x20an\x20order-holder\x20(buyer)\x20identity\x20'+'check\x20but\x20the\x20forward\x20rides\x20a\x20permissionIndex\x20rail\x20(merchant-side\x20slot).\x20The\x20identity\x20layer\x20'+'runs\x20BEFORE\x20the\x20guard,\x20and\x20the\x20two\x20signer\x20sets\x20are\x20disjoint\x20—\x20nobody\x20can\x20pass\x20both\x20(bkng\x20F23).\x20'+'Use\x20operator\x20\x27order_payer\x27\x20(namedOperator\x20\x22\x22\x20—\x20the\x20buyer\x20self-advance)\x20for\x20this\x20edge.'});{const bo=D['get'](bl['key']);if(bo!==undefined){const bp=bo['table']['some'](br=>br['identifier']===TASK_BINDING_SLOT),bq=offTaskSlotIdentityLegs(bo['root'])['filter'](br=>{if(!bp)return![];const bs=bo['table']['find'](bt=>bt['identifier']===br['identifier']);return bs!==undefined&&bs['b_submission']===!![];});for(const br of bq){j['push']({'code':'GUARD_IDENTITY_SLOT_NOT_TASKBOUND','detail':'edge\x20\x27'+be['prev']+'\x27->\x27'+b8['name']+'\x27\x20guard\x20\x27'+bl['key']+'\x27\x20reads\x20'+br['query']+'\x20off\x20free\x20'+('submission\x20slot\x20'+br['identifier']+'\x20—\x20hijackable\x20(rex-mn-261021\x20T10):\x20the\x20caller\x20fills\x20free\x20')+'slots,\x20so\x20an\x20attacker\x20submits\x20their\x20OWN\x20order\x20there\x20(signer\x20==\x20order.owner\x20passes\x20against\x20'+('their\x20own\x20order)\x20and\x20advances\x20the\x20VICTIM\x27s\x20order\x20carried\x20by\x20slot\x20'+TASK_BINDING_SLOT+';\x20with\x20')+'namedOperator\x20\x22\x22\x20the\x20permission\x20layer\x20passes\x20for\x20anyone\x20(progress.move:242-256),\x20so\x20this\x20'+('guard\x20is\x20the\x20only\x20identity\x20leg.\x20Anchor\x20the\x20'+br['query']+'\x20query\x20on\x20identifier\x20')+(TASK_BINDING_SLOT+'\x20(the\x20task-binding\x20order\x20anchor\x20—\x20the\x20order\x20the\x20forward\x20actually\x20mutates).')});}}}bl['step_id']!==undefined&&(I(bl['key'])?j['push']({'code':'GUARD_CYCLE','detail':'edge\x20\x27'+be['prev']+'\x27->\x27'+b8['name']+'\x27\x20binds\x20guard\x20\x27'+bl['key']+'\x27\x20which\x20itself\x20'+'refs\x20the\x20service\x20(created\x20after\x20the\x20machine)\x20—\x20an\x20F-05\x20cycle.\x20Rebind\x20or\x20split\x20the\x20guard.'}):bh['guard']=ref(bl['step_id']));}}else{const bs=y['get'](bg);if(bs!==undefined){const bt=z['get'](bs);bt?.['step_id']!==undefined&&(bh['guard']=ref(bt['step_id']));}}const bi=ba['get'](be['prev']);bi!==undefined?bi['push'](bh):ba['set'](be['prev'],[bh]);const bj=bb['get'](be['prev']),bk=bf==='order_payer'?'namedOperator:':'permissionIndex:'+(be['permission_index']??i);bj!==undefined?bj['add'](bk):bb['set'](be['prev'],new Set([bk]));}const bc=b8['threshold']??0x0;for(const [bu,bv]of ba){bc>bv['length']&&j['push']({'code':'PAIR_THRESHOLD_UNREACHABLE','detail':'node\x20\x27'+b8['name']+'\x27\x20pair\x20from\x20\x27'+(bu===''?'(entry)':bu)+'\x27\x20declares\x20threshold\x20'+bc+'\x20'+('but\x20the\x20pair\x20merges\x20only\x20'+bv['length']+'\x20forward(s)\x20at\x20weight\x201\x20each\x20—\x20the\x20pair\x20can\x20never\x20')+'migrate\x20and\x20the\x20publish\x20aborts.\x20Add\x20one\x20distinct-operator\x20forward\x20per\x20required\x20signature,\x20or\x20'+'lower\x20the\x20threshold\x20to\x20the\x20forward\x20count.'});if(bc>=0x2){const bw=bb['get'](bu)?.['size']??0x0;bw<0x2&&j['push']({'code':'PAIR_THRESHOLD_SINGLE_OPERATOR','detail':'node\x20\x27'+b8['name']+'\x27\x20pair\x20from\x20\x27'+(bu===''?'(entry)':bu)+'\x27\x20declares\x20threshold\x20'+bc+'\x20'+'but\x20every\x20forward\x20rides\x20the\x20SAME\x20operator\x20rail\x20—\x20one\x20party\x20can\x20tap\x20all\x20of\x20them\x20and\x20the\x20'+'declared\x20dual\x20confirmation\x20silently\x20dissolves\x20(each\x20forward\x20locks\x20to\x20its\x20first\x20operator).\x20'+'Give\x20each\x20required\x20signature\x20its\x20own\x20rail\x20(e.g.\x20permission_index\x201001\x20+\x20operator\x20\x27order_payer\x27).'});}b9['push']({'prev_node':bu,'threshold':bc,'forwards':bv});}aa['push']({'name':b8['name'],...b8['semantic_role']!==undefined?{'role':b8['semantic_role']}:{},...b8['optional']===!![]?{'optional':!![]}:{},'pairs':b9});}k['push']({'op':'create','id':'machine','object':'machine','params':P({'name':h+'_machine','nodes':aa})}),k['push']({'op':'publish','id':'machine_publish','target':ref('machine'),'preflight':[{'check':'machine_publish','status':'pending'},{'check':'TASKBIND-01','status':'pending'}]});const ab=typeof b['currency']==='string'?b['currency']:'0x2::wow::WOW',ac=x['find'](bx=>bx['host']==='service'&&bx['key']==='buy');k['push']({'op':'create','id':'service','object':'service','params':P({'name':h+'_service','type_parameter':ab,'permission':ref('permission'),'machine':ref('machine'),'um':ref('contact'),'description':a['id']+'\x20—\x20compiled\x20by\x20composition/compile',...C?{'repositories':[ref('repository')]}:{},...ac?.['step_id']!==undefined?{'buy_guard':ref(ac['step_id'])}:{},...Array['isArray'](b['customer_required'])?{'customer_required':b['customer_required']}:{}}),'notes':'Draft\x20only:\x20machine/order_allocators\x20are\x20L1-frozen\x20at\x20publish;\x20allocators\x20attach\x20in\x20the\x20configure\x20step.'});for(const bx of a8)k['push'](J(bx));const ad=u['length']>0x0?u:[{'track':'settlement','recipient':a['allocator']['recipient']==='fixed'?'entity':a['allocator']['recipient'],'recipient_key':a['allocator']['recipient_key'],'mode':a['allocator']['mode'],'value':a['allocator']['mode']==='rate'?0x2710:a['allocator']['mode']==='surplus'?'0':undefined}],ae=[],af=new Map();for(const by of ad){if(by['guard_key']!==undefined){let bz=af['get'](by['guard_key']);bz===undefined&&(bz={'key':by['guard_key'],'rows':[]},af['set'](by['guard_key'],bz),ae['push'](bz)),bz['rows']['push'](by);}else ae['push']({'rows':[by]});}const ag=[];for(const bA of ae){const bB=[];let bC;for(const bE of bA['rows']){let bF=bE['value'];bF===undefined&&bE['value_from']!==undefined&&(bF=b[bE['value_from']]??a['fee_params'][bE['value_from']]);if(bF===undefined&&bE['mode']!=='surplus'){j['push']({'code':'ALLOCATOR_VALUE_MISSING','detail':'allocator\x20row\x20('+bE['track']+'/'+bE['recipient']+')\x20has\x20neither\x20value\x20nor\x20a\x20resolvable\x20value_from'});continue;}(bE['fix']!==undefined||bE['fix_from']!==undefined)&&j['push']({'code':'ALLOCATOR_FIX_UNSUPPORTED','detail':'allocator\x20row\x20('+bE['track']+'/'+bE['recipient']+')\x20declares\x20fix/fix_from\x20—\x20the\x20chain\x20has\x20no\x20holdback\x20'+'parameter:\x20fix\x20is\x20computed\x20on-chain\x20as\x20the\x20sum\x20of\x20the\x20Amount\x20legs\x20and\x20those\x20legs\x20are\x20PAID\x20'+'(allocation.move:399,540),\x20and\x20the\x20allocator-registration\x20call\x20surface\x20(guard,\x20sharing,\x20max)\x20has\x20no\x20fix\x20'+'argument,\x20so\x20this\x20value\x20never\x20reaches\x20the\x20chain.\x20To\x20keep\x20funds\x20in\x20the\x20pool,\x20do\x20not\x20distribute\x20them\x20'+'(a\x20separate\x20Allocation\x20object,\x20or\x20a\x20later\x20guard-gated\x20allocator);\x20to\x20combine\x20fixed\x20fees\x20with\x20a\x20'+'proportional\x20split,\x20use\x20explicit\x20Amount\x20legs\x20plus\x20Rate\x20legs\x20summing\x2010000.'});bC??=bE['note'];let bG;if(bE['recipient']==='entity')bG={'Entity':{'$late':{'by':'local_name','mark':bE['recipient_key']??'merchant'}}};else{if(bE['recipient']==='guard_identifier'){const bH=Number(bE['recipient_key']??0x0);bG={'GuardIdentifier':bH};const bI=bA['key']!==undefined?D['get'](bA['key']):undefined;if(bI!==undefined){const bJ=bI['table']['find'](bK=>bK['identifier']===bH);(bJ===undefined||bJ['b_submission']!==!![]||bJ['value_type']!=='Address')&&j['push']({'code':'GUARD_SLOT_UNKNOWN','detail':'allocator\x20leg\x20{GuardIdentifier:\x20'+bH+'}\x20on\x20guard\x20\x27'+bA['key']+'\x27\x20of\x20\x27'+h+'\x27:\x20the\x20bound\x20'+('Guard\x20table\x20has\x20no\x20slot\x20'+bH+'\x20Address\x20submission\x20row\x20(b_submission:\x20true).\x20On\x20chain\x20the\x20leg\x20')+('reads\x20slot\x20'+bH+'\x20as\x20its\x20payee\x20and\x20asserts\x20it\x20equals\x20the\x20paying\x20order\x20')+'(payment_info.for_object)\x20—\x20an\x20undeclared\x20or\x20STATIC\x20slot\x20aborts\x20at\x20alloc\x20time\x20with\x20code\x2015\x20'+'(ERECIPIENT_NOT_FOR_OBJECT,\x20allocation.move:500-520)\x20and\x20the\x20leg\x27s\x20funds\x20stranded\x20'+'(az3/abnb7\x20mainnet\x20261013:\x20static\x20GuardIdentifier\x20legs\x20bricked\x20every\x20refund\x20rail).\x20'+'Guard/allocators/forwards\x20are\x20all\x20publish-frozen.\x20Declare\x20'+('{identifier:\x20'+bH+',\x20b_submission:\x20true,\x20value_type:\x20\x22Address\x22}\x20in\x20the\x20Guard\x20table\x20')+'(templates\x20anchor\x20refund\x20rails\x20on\x20user\x20slot\x200\x20and\x20submit\x20the\x20Order\x20address\x20there).\x20Protocol\x20'+'slot\x20254\x20is\x20the\x20task-binding/once\x20slot:\x20naming\x20it\x20as\x20the\x20payee\x20arms\x20once-per-order,\x20so\x20a\x20'+'second\x20fire\x20aborts\x20E_ONCE_TRIGGERED\x20(16).'});}}else bG='Signer';}bB['push']({'who':bG,'sharing':String(bF??'0'),'mode':MODE_MAP[bE['mode']]});}if(bB['length']===0x0)continue;const bD=bA['key']!==undefined?z['get'](bA['key'])?.['step_id']:undefined;bA['key']!==undefined&&!z['has'](bA['key'])&&j['push']({'code':'GUARD_KEY_UNKNOWN','detail':'allocator\x20row\x20('+bA['rows'][0x0]['track']+')\x20binds\x20unknown\x20guard_key\x20\x27'+bA['key']+'\x27'}),ag['push']({...bD!==undefined?{'guard':ref(bD)}:{},...bA['key']!==undefined?{'guard_key':bA['key']}:{},'track':bA['rows'][0x0]['track'],'sharing':bB,...bC!==undefined?{'note':bC}:{}});}const ah=ae['map'](bK=>{if(bK['key']===undefined)return undefined;const bL=D['get'](bK['key']);return{'key':bK['key'],'track':bK['rows'][0x0]['track'],'table':bL?.['table']??[],'root':bL?.['root']};})['filter'](bK=>bK!==undefined);if(ah['length']>0x0){const bK=verifyAllocatorRails(ah,t['map'](bN=>({'name':bN['name'],'semanticRole':bN['semantic_role']}))),bL=ae['map'](bN=>bN['key'])['filter'](bN=>bN!==undefined&&!D['has'](bN)),bM=bL['length']>0x0?'\x20UNRESOLVED\x20ALLOCATOR\x20GUARD\x20REFS\x20(likely\x20the\x20real\x20cause\x20—\x20these\x20guard_keys\x20match\x20no\x20resolved\x20guard,\x20e.g.\x20a\x20name\x20typo):\x20'+bL['join'](',\x20')+'.':'';for(const bN of bK){j['push']({'code':bN['code'],'detail':bN['detail']+bM});}}k['push']({'op':'configure','id':'service_allocators','target':ref('service'),'method':'order_allocators','params':P({'description':a['allocator']['description'],'threshold':Number(a['fee_params']['threshold']??a['fee_params']['monthly_rent_amount']??0x0)||0x0,'allocators':ag}),'requires':['machine_publish']});Array['isArray'](b['sales'])&&b['sales']['length']>0x0&&k['push']({'op':'configure','id':'service_sales','target':ref('service'),'method':'sales','params':{'op':'add','sales':b['sales']}});if(S!=='none'){const bO=a11a(S),bP=t['some'](bQ=>afterSalesRailNodeMatches(S,bQ['name']));!bP&&j['push']({'code':'AFTER_SALES_RAIL_MISSING','detail':'after_sales_mode\x20\x27'+S+'\x27\x20declares\x20a\x20buyer\x20after-sales\x20remedy,\x20but\x20machine_shape\x20has\x20no\x20'+('backing\x20rail\x20(no\x20node\x20matching\x20'+bO+').\x20Add\x20the\x20'+S+'\x20node\x20family\x20')+'(e.g.\x20return_requested\x20->\x20returned\x20for\x20\x27return\x27)\x20with\x20its\x20claimed_by\x20polarity\x20pair\x20—\x20refund\x20leg\x20'+'some==false,\x20merchant-recovery\x20leg\x20some==true\x20(INV-C1)\x20—\x20anchored\x20on\x20the\x20delivered\x20ENTRY\x20time\x20'+'(INV-C2,\x20TIME-ANCHOR-01),\x20and\x20de-conflicted\x20against\x20the\x20settlement\x20rail\x20so\x20the\x20two\x20never\x20both\x20pay\x20'+'(INV-C3,\x20DUAL-RAIL-01).\x20Or\x20set\x20after_sales_mode\x20\x27none\x27\x20if\x20this\x20shop\x20ships\x20no\x20such\x20remedy.'});}if(V!=='none'){W&&a['arbitration_mode']!=='third_party'&&j['push']({'code':'ACCEPTANCE_JUDGE_NOT_INDEPENDENT','detail':'acceptance_mode\x20\x27'+V+'\x27\x20is\x20a\x20judge-decided\x20acceptance\x20(a\x20third\x20party\x20rules\x20on\x20'+('release),\x20but\x20arbitration_mode\x20is\x20\x27'+(a['arbitration_mode']??'none')+'\x27,\x20not\x20\x27third_party\x27.\x20')+'The\x20party\x20owing\x20the\x20payout\x20must\x20not\x20also\x20decide\x20whether\x20it\x20is\x20owed\x20(merchant\x20self-adjudication,\x20'+'INV-A3).\x20Set\x20arbitration_mode\x20\x27third_party\x27\x20so\x20an\x20independent\x20venue/judge\x20Permission\x20rules\x20'+'(R2;\x20enforced\x20at\x20publish\x20by\x20controller-disjointness),\x20or\x20use\x20acceptance_mode\x20\x27milestone\x27\x20if\x20the\x20'+'buyer\x20genuinely\x20self-adjudicates.'});const bQ=a['fee_params']['revision_rounds_max'],bR=typeof bQ==='number'||typeof bQ==='string'&&bQ['trim']()!==''&&/^\d+$/['test'](bQ['trim']());if(bR){const bS=x['some'](bT=>bT['host']==='repository'||/repository/i['test'](bT['template_id']));!bS&&j['push']({'code':'ACCEPTANCE_REVISION_UNBOUNDED','detail':'acceptance_mode\x20\x27'+V+'\x27\x20declares\x20a\x20bounded\x20revision\x20loop\x20'+('(fee_params.revision_rounds_max\x20=\x20'+String(bQ)+'),\x20but\x20no\x20counter-backed\x20Repository\x20')+'guard\x20exists.\x20progress.move\x20caps\x20EDGE\x20count\x20(MAX_FORWARD\x20/\x20MAX_NODE_PAIR),\x20never\x20VISIT\x20count,\x20'+'so\x20a\x20finite\x20cap\x20in\x20fee_params\x20alone\x20is\x20a\x20promise\x20the\x20chain\x20cannot\x20keep\x20(INV-A1).\x20Either\x20declare\x20'+'revision_rounds_max\x20\x27unlimited\x27\x20(the\x20honest\x20form\x20—\x20the\x20revision\x20loop\x20is\x20then\x20genuinely\x20'+'unbounded)\x20or\x20mount\x20a\x20counter-backed\x20Repository\x20guard\x20(pattern.repository_data_check\x20reading\x20a\x20'+'per-order\x20revision\x20tally\x20written\x20via\x20pattern.repository_write_authorization)\x20that\x20gates\x20the\x20'+'redelivery\x20forward\x20once\x20the\x20tally\x20reaches\x20the\x20cap.'});}}if(Z!=='none'){const bT=/(due|owed|owing|unpaid|awaiting|pending)/i,bU=/(paid|captured|funded|settled)/i,bV=/(deposit|down_?pay|balance_due|balance_owed|awaiting|installment|milestone)/i,bW=/(refund|cancel|exit|forfeit|kill|void|abandon|release|expire|lapse)/i,bX=[];for(const c0 of t){const c1=c0['name'];for(const c2 of c0['from']??[]){typeof c2==='string'?bX['push']({'prev':c2,'target':c1}):bX['push']({'prev':c2['prev'],'target':c1,'guardKey':c2['guard_key']});}}const bY=bX['filter'](c3=>bT['test'](c3['prev'])&&bU['test'](c3['target'])&&(c3['guardKey']===undefined||c3['guardKey']['trim']()===''));bY['length']>0x0&&j['push']({'code':'INSTALLMENT_FUNDING_UNGATED','detail':'installment_mode\x20\x27'+Z+'\x27\x20captures\x20a\x20later\x20payment,\x20but\x20the\x20funding\x20forward(s)\x20'+bY['map'](c3=>'\x27'+c3['prev']+'\x27\x20→\x20\x27'+c3['target']+'\x27')['join'](',\x20')+'\x20carry\x20NO\x20guard_key.\x20A\x20bare\x20advance\x20records\x20the\x20balance\x20as\x20paid\x20WITHOUT\x20the\x20capture\x20landing\x20in\x20the\x20'+'Allocation\x20—\x20a\x20zero-value\x20advance\x20(INV-B1,\x20H4).\x20Bind\x20a\x20fund-gate\x20Guard\x20on\x20each\x20capture\x20forward\x20'+'(constant\x20=\x20order\x20address,\x20convert_witness\x20OrderAllocation(109),\x20allocation.balance\x20query\x201051\x20>=\x20the\x20'+'capture\x20amount).\x20PRE-STATE\x20CONSTRAINT\x20(esound-mn-261021\x20B-1,\x20mainnet-verified):\x20guards\x20read\x20the\x20'+'COMMITTED\x20pre-transaction\x20balance\x20—\x20funding\x20that\x20lands\x20in\x20the\x20SAME\x20PTB\x20(the\x20one-PTB\x20order_renew\x20'+'payment\x20half)\x20is\x20INVISIBLE\x20to\x20the\x20forward\x27s\x20guard,\x20so\x20a\x20balance-gated\x20capture\x20advanced\x20by\x20'+('order_renew\x20ALWAYS\x20aborts.\x20'+TWO_TX_RENEW_RECIPE+'\x20Pair\x20the\x20balance\x20gate\x20with\x20the\x20once\x20slot\x20')+'(H5\x20—\x20the\x20fund\x20gate\x20is\x20a\x20STATE\x20READ,\x20not\x20a\x20once)\x20so\x20a\x20replay\x20cannot\x20re-capture.'});const bZ=[];for(const c3 of t){if(!bV['test'](c3['name']))continue;const c4=bX['filter'](c6=>c6['prev']===c3['name']),c5=c4['some'](c6=>bW['test'](c6['target']));if(!c5)bZ['push'](c3['name']);}bZ['length']>0x0&&j['push']({'code':'INSTALLMENT_DEPOSIT_STRANDED','detail':'installment_mode\x20\x27'+Z+'\x27\x20holds\x20a\x20buyer\x20payment\x20at\x20state(s)\x20'+bZ['map'](c6=>'\x27'+c6+'\x27')['join'](',\x20')+'\x20with\x20NO\x20deposit-exit\x20rail\x20(no\x20outgoing\x20refund\x20/\x20cancel\x20/\x20forfeit\x20/\x20expire\x20edge).\x20There\x20is\x20no\x20on-chain\x20'+'obligation\x20to\x20pay\x20the\x20balance\x20(INV-B2,\x20H1),\x20so\x20a\x20buyer\x20who\x20walks\x20away\x20strands\x20the\x20already-paid\x20portion\x20'+'at\x20that\x20node\x20permanently\x20(Machine\x20+\x20Allocator\x20immutable,\x20IMMUT-001).\x20Add\x20a\x20deposit-exit\x20rail\x20from\x20each\x20'+'held\x20state\x20—\x20a\x20refund/cancel\x20forward\x20into\x20an\x20exit\x20node\x20whose\x20allocator\x20returns\x20the\x20held\x20funds\x20to\x20the\x20'+'order\x20payer\x20(GuardIdentifier(0))\x20or\x20applies\x20the\x20declared\x20deposit_exit_policy\x20(full\x20refund\x20vs\x20a\x20kill\x20fee\x20'+'compensating\x20the\x20merchant\x20for\x20the\x20reserved\x20capacity).'});}if(a2!=='none'){const c6=/(commission|affiliate|referr|attribut|partner_?payout)/i,c7=t['some'](cb=>c6['test'](cb['name'])),c8=ad['some'](cb=>c6['test'](cb['value_from']??'')||c6['test'](cb['recipient_key']??''));!c7&&!c8&&j['push']({'code':'AFFILIATE_RAIL_MISSING','detail':'affiliate_mode\x20\x27'+a2+'\x27\x20declares\x20a\x20referral/affiliate\x20commission\x20overlay,\x20but\x20machine_shape\x20has\x20no\x20'+'commission-family\x20node\x20and\x20the\x20allocator\x20has\x20no\x20commission\x20row\x20—\x20a\x20declared\x20partner\x20payout\x20with\x20no\x20rail\x20to\x20'+'walk\x20it\x20is\x20a\x20false\x20promise\x20at\x20quote\x20time\x20(INV-D3).\x20Add\x20an\x20INDEPENDENT\x20commission\x20leg:\x20a\x20Rate\x20row\x20off\x20a\x20'+'dedicated\x20commission\x20pool\x20(never\x20a\x20Surplus/Rate\x20drain\x20of\x20the\x20buyer\x27s\x20goods\x20escrow\x20—\x20防抢池)\x20to\x20an\x20explicit\x20'+'non-empty\x20partner\x20Entity,\x20gated\x20by\x20a\x20window-anchored\x20claim\x20guard\x20(INV-D1\x20rides\x20TIME-ANCHOR-01)\x20so\x20the\x20'+'commission\x20is\x20claimable\x20only\x20after\x20the\x20attribution/refund\x20window\x20closes.'});const c9=/(post-?lock|锁后|clawback|不可追偿|不可撤销|unrecoverable|irrevocab|no\s*(?:revers|recov|clawback)|cannot be reversed|once released|released commission)/i,ca=(a['build_notes']??[])['some'](cb=>c9['test'](cb));!ca&&j['push']({'code':'AFFILIATE_CLAWBACK_UNDISCLOSED','detail':'affiliate_mode\x20\x27'+a2+'\x27\x20declares\x20a\x20commission\x20but\x20no\x20build_note\x20discloses\x20the\x20post-lock\x20no-clawback\x20'+'truth\x20(INV-D2).\x20SOLE\x20TRUTH:\x20Allocation\x20distribute\x20is\x20a\x20ONE-WAY\x20outflow\x20(no\x20debit/clawback\x20primitive,\x20§11.0\x20G2),\x20'+'so\x20once\x20a\x20commission\x20is\x20RELEASED\x20it\x20CANNOT\x20be\x20reversed\x20on\x20chain\x20—\x20a\x20refund/chargeback\x20after\x20release\x20leaves\x20the\x20'+'affiliate\x20commission\x20unrecoverable.\x20Add\x20a\x20build_note\x20stating\x20this\x20honestly\x20(e.g.\x20\x22post-lock:\x20a\x20released\x20'+'affiliate\x20commission\x20is\x20unrecoverable\x20/\x20不可追偿\x20—\x20refunds\x20after\x20the\x20attribution\x20window\x20do\x20NOT\x20claw\x20back\x20the\x20'+'partner\x20payout\x22).\x20L-04/D-5:\x20never\x20imply\x20a\x20recovery\x20capability\x20the\x20chain\x20does\x20not\x20have.'});}if(a5!=='none'){const cb=/(releas|settle|funded|disburs|project)/i,cc=/(refund|missed|unmet|return|reimburse)/i,cd=t['some'](cq=>cb['test'](cq['name'])),ce=ad['some'](cq=>cq['track']==='settlement'&&(cb['test'](cq['guard_key']??'')||cb['test'](cq['recipient_key']??''))),cf=t['some'](cq=>cc['test'](cq['name'])),cg=ad['some'](cq=>cq['track']==='refund'||cc['test'](cq['guard_key']??''));!cd&&!ce&&j['push']({'code':'CROWDFUNDING_THRESHOLD_GATE_MISSING','detail':'crowdfunding_mode\x20\x27'+a5+'\x27\x20declares\x20a\x20campaign\x20but\x20machine_shape\x20has\x20no\x20release/settlement\x20'+'node\x20and\x20the\x20allocator\x20has\x20no\x20settlement\x20row\x20to\x20the\x20project\x20Entity\x20—\x20the\x20escrowed\x20contributions\x20would\x20'+'strand\x20at\x20the\x20deadline\x20with\x20no\x20exit\x20rail\x20(INV-E1).\x20Add\x20a\x20release\x20leg\x20(Rate\x2010000\x20to\x20a\x20NON-EMPTY\x20project\x20'+'Entity,\x20gated\x20at\x20the\x20campaign-deadline\x20settlement\x20terminal)\x20and,\x20for\x20a\x20threshold\x20campaign,\x20its\x20D-BUG-2\x20'+'refund\x20twin.'});a5==='threshold'&&!cf&&!cg&&j['push']({'code':'CROWDFUNDING_THRESHOLD_GATE_MISSING','detail':'crowdfunding_mode\x20\x27threshold\x27\x20declares\x20an\x20all-or-nothing\x20campaign\x20but\x20there\x20is\x20NO\x20refund-family\x20node/row\x20—\x20'+'a\x20missed\x20goal\x20would\x20strand\x20every\x20contribution\x20instead\x20of\x20returning\x20it\x20(INV-E1\x20/\x20D-BUG-2).\x20Add\x20the\x20refund\x20'+'leg\x20(per-contributor,\x20order-anchored\x20user\x20slot\x200\x20—\x20the\x20submitted\x20Order,\x20never\x20slot\x20254,\x20claimed_by\x20some==false)\x20as\x20the\x20mutually-exclusive\x20twin\x20of\x20the\x20'+'release\x20leg:\x20aggregate\x20>=\x20goal\x20→\x20release;\x20aggregate\x20<\x20goal\x20→\x20refund.'});if(a5==='threshold'){const cq=x['some'](cr=>(cr['host']==='repository'||/repository_write/i['test'](cr['template_id']))&&(cr['policy']?.['id_from']??'')['toLowerCase']()==='signer');!cq&&j['push']({'code':'CROWDFUNDING_AGGREGATE_UNBOUND','detail':'crowdfunding_mode\x20\x27threshold\x27\x20gates\x20release\x20on\x20an\x20aggregate\x20funding\x20total,\x20but\x20no\x20host:\x22repository\x22\x20'+'write\x20policy\x20is\x20writer-bound\x20(id_from\x20signer)\x20—\x20the\x20sum-where\x20(1174)\x20total\x20would\x20be\x20forgeable,\x20so\x20'+'anyone\x20could\x20inflate\x20the\x20aggregate\x20and\x20fake\x20a\x20\x27goal\x20met\x27\x20(INV-E2\x20/\x20R-X1-17:\x20existence-is-not-trust).\x20'+'Bind\x20the\x20contribution\x20Repository\x20write_guard\x20to\x20the\x20contributing\x20backer\x20'+'(pattern.repository_write_authorization,\x20id_from\x20signer,\x20an\x20identity\x20leaf\x20order.owner==Signer).'});}const ch=a['build_notes']??[],ci=/(attest|keeper|aggregate trust|read-?only sum|not a chain-?verified|只读求和|聚合值|独立重算)/i,cj=/(not investment|non-?investment|不构成投资|收益承诺|no (?:investment )?return|never promise)/i,ck=/(kyc|aml|securities|money-?transmission|regulatory|跨境|合规)/i,cl=/(no-?refund|non-?refundable|keep-?it-?all|不退|不提供退款|不设达标)/i,cm=ch['some'](cr=>cj['test'](cr)),cn=ch['some'](cr=>ck['test'](cr)),co=a5==='threshold'?ch['some'](cr=>ci['test'](cr)):!![],cp=a5==='flexible'?ch['some'](cr=>cl['test'](cr)):!![];if(!co||!cm||!cn||!cp){const cr=[!co?'the\x20aggregate-trust\x20boundary\x20(the\x20funding\x20total\x20is\x20a\x20keeper-attested\x20Repository\x20sum,\x20NOT\x20a\x20chain-verified\x20money\x20oracle)':null,!cm?'the\x20L-01\x20non-investment\x20statement\x20(never\x20promise\x20returns\x20/\x20promote\x20coin\x20price;\x20不构成投资建议或收益承诺)':null,!cn?'the\x20L-05\x20KYC/AML\x20+\x20cross-border\x20regulatory\x20caution\x20(HIGH\x20intensity)':null,!cp?'the\x20flexible\x20keep-it-all\x20NO-REFUND\x20posture\x20(contributions\x20non-refundable\x20once\x20the\x20deadline\x20passes;\x20不提供退款)':null]['filter'](Boolean);j['push']({'code':'CROWDFUNDING_DISCLOSURE_MISSING','detail':'crowdfunding_mode\x20\x27'+a5+'\x27\x20declares\x20a\x20campaign\x20but\x20no\x20build_note\x20carries:\x20'+cr['join'](';\x20')+'\x20'+'(INV-E3\x20/\x20L-04\x20/\x20L-01\x20/\x20L-05).\x20Add\x20these\x20as\x20honest\x20build_notes\x20—\x20never\x20present\x20an\x20attested\x20aggregate\x20as\x20a\x20'+'chain-verified\x20custody\x20proof,\x20never\x20imply\x20investment\x20returns,\x20and\x20flag\x20the\x20compliance\x20surface.'});}}if(N!=='none'){const cs=t['some'](cy=>/review/i['test'](cy['name']));N==='review'&&!cs&&j['push']({'code':'REVIEW_NODE_MISSING','detail':'review_mode\x20\x27'+N+'\x27\x20declares\x20the\x20buyer\x20review\x20reputation\x20rail,\x20but\x20machine_shape\x20has\x20no\x20'+'\x27reviewed\x27\x20node.\x20Add\x20a\x20buyer-advanced\x20review\x20node\x20(operator\x20order_payer)\x20with\x20an\x20EXIT\x20edge\x20back\x20to\x20the\x20'+'settlement\x20rail\x20(R-DEAD-END:\x20a\x20zero-exit\x20review\x20node\x20strands\x20the\x20escrow),\x20or\x20anchor\x20the\x20claim\x20on\x20the\x20'+'delivered\x20terminal\x20via\x20a\x20host:\x22reward\x22\x20guard\x20(review_mode\x20\x22review_reward\x22\x20variant).'});const ct=x['find'](cy=>cy['host']==='reward'),cu=t['find'](cy=>/review/i['test'](cy['name']))?.['name'];let cv,cw;if(cu!==undefined){const cy=[];for(const cB of t){for(const cC of cB['from']??[]){const cD=typeof cC==='string'?{'prev':cC,'guard_key':undefined}:cC;cy['push']({'prev':cD['prev'],'guard_key':cD['guard_key'],'target':cB['name']});}}const cz=cy['find'](cE=>cE['target']===cu&&cE['guard_key']!==undefined)?.['guard_key']??cy['find'](cE=>cE['prev']===cu&&cE['guard_key']!==undefined)?.['guard_key'],cA=cz!==undefined?z['get'](cz):undefined;cv=cA?.['step_id'],cw=cz;}cv===undefined&&ct?.['step_id']!==undefined&&(cv=ct['step_id'],cw=ct['key']);const cx=b['review_decision_enabled']===!![]&&N==='review_reward'&&ct?.['step_id']!==undefined&&cv!==undefined;cx&&k['push']({'op':'create','id':'guard_review_decision','object':'guard','params':P({'description':'Merchant\x20review-decision\x20write\x20credential:\x20only\x20the\x20service\x20provider\x20(permission\x20owner\x20or\x20admin)\x20may\x20write\x20U64\x20decision\x20rows\x20(row\x20id\x20=\x20order\x20address,\x20value\x20=\x20approved\x20payout)\x20under\x20the\x20review\x20repository\x27s\x20\x27review_decision\x27\x20policy.','table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'order_being_approved'},{'identifier':0x1,'b_submission':![],'value_type':'Address','value':ref('service'),'name':'this_service'},{'identifier':0x2,'b_submission':!![],'value_type':'Address','name':'service_permission'}],'root':{'type':'logic_and','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'order.service','object':{'identifier':0x0},'parameters':[]},{'type':'identifier','identifier':0x1}]},{'type':'logic_equal','nodes':[{'type':'query','query':'service.permission','object':{'identifier':0x1},'parameters':[]},{'type':'identifier','identifier':0x2}]},{'type':'logic_or','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'permission.owner','object':{'identifier':0x2},'parameters':[]},{'type':'context','context':'Signer'}]},{'type':'query','query':'permission.admin\x20has','object':{'identifier':0x2},'parameters':[{'type':'context','context':'Signer'}]}]}]}}),'notes':'REVIEW-DECISION\x20write\x20credential\x20(allocator\x20dynamic-permission\x20shape,\x20service\x20pinned\x20by\x20plan\x20ref\x20—\x20survives\x20permission\x20rotation).\x20The\x20decision\x20write\x20itself:\x20repository.data_add\x20'+'{name:\x27review_decision\x27,\x20items:[{write_guard:\x27<this\x20guard>\x27,\x20data:[{id:<order\x20address>,\x20data:<approved\x20payout\x20U64>}]}]}\x20with\x20a\x20passport\x20submission\x20carrying\x20the\x20order\x20and\x20the\x20permission.'});if(cv!==undefined){const cE=b['buyer_review_enabled']===!![];k['push']({'op':'create','id':'repository_review','object':'repository','params':P({'name':h+'_review','description':'Structured\x20buyer\x20reputation\x20rows\x20(AR-1:\x20emitted\x20by\x20the\x20build\x20plan\x20—\x20no\x20manual\x20setup).','policies':[{'name':'review','description':'One\x20immutable\x20row\x20per\x20ORDER\x20(id_from=None;\x20row\x20id\x20=\x20the\x20order\x20address\x20—\x20F09\x20yfd-ln-261024:\x20a\x20repeat\x20buyer\x20must\x20be\x20able\x20to\x20review\x20every\x20order;\x20the\x20old\x20Signer-keyed\x20row\x20made\x20order\x20#2\x20unwritable).\x20Write-once\x20—\x20a\x20rewrite\x20attempt\x20aborts\x20on-chain,\x20K3(a).\x20Writes\x20require\x20the\x20review\x20credential\x20(guard\x20key\x20\x27'+cw+'\x27).\x20Payload:\x20JSON\x20text\x20{rating,\x20tags?,\x20orderRef?}.','write_guard':[{'guard':ref(cv)}],'id_from':'none','value_type':'String','write_once':!![]},{'name':'rating','description':'Order-keyed\x20numeric\x20rating\x20(F-62):\x20one\x20U64\x20row\x20per\x20ORDER\x20(id_from=None;\x20row\x20id\x20=\x20the\x20order\x20address;\x20value\x20=\x20stars,\x20e.g.\x201..5;\x20write-once\x20—\x20a\x20rewrite\x20attempt\x20aborts\x20on-chain,\x20K3(a)).\x20Writes\x20require\x20the\x20same\x20review\x20credential\x20as\x20the\x20\x27review\x27\x20text\x20policy\x20—\x20a\x20verified\x20completed-order\x20buyer.\x20This\x20—\x20not\x20the\x20\x27review\x27\x20text\x20row\x20(same\x20order\x20key,\x20String\x20payload)\x20—\x20is\x20the\x20row\x20a\x20reward\x20good-review\x20leg\x20must\x20query\x20(query\x20repository.data:\x20the\x20policy-name\x20row\x20+\x20the\x20order-address\x20identifier\x20row,\x20compared\x20against\x20the\x20rating\x20floor).\x20The\x20text\x20row\x20is\x20display;\x20this\x20row\x20is\x20payout\x20authority.','write_guard':[{'guard':ref(cv)}],'id_from':'none','value_type':'U64','write_once':!![]},...cE?[{'name':'buyer_review','description':'Merchant-side\x20structured\x20feedback\x20on\x20the\x20order/buyer\x20(D-R7\x20bidirectional\x20reputation,\x20opt-in).\x20One\x20immutable\x20row\x20per\x20writer\x20(id_from=Signer;\x20write-once\x20—\x20a\x20rewrite\x20attempt\x20aborts\x20on-chain,\x20K3(a)).\x20NO\x20write\x20guard\x20by\x20design:\x20merchant\x20authority\x20is\x20verified\x20at\x20READ\x20time\x20(the\x20writer\x20must\x20control\x20the\x20order\x27s\x20service\x20—\x20graph\x20ControlIndex).\x20Payload:\x20JSON\x20text\x20{rating,\x20tags?,\x20orderRef?}.','id_from':'signer','value_type':'String','write_once':!![]}]:[],...cx?[{'name':'review_decision','description':'Merchant\x20approval\x20ledger\x20for\x20the\x20review\x20bounty\x20(professional\x20form):\x20one\x20U64\x20row\x20per\x20order\x20(id_from=None;\x20row\x20id\x20=\x20the\x20order\x20address;\x20value\x20=\x20approved\x20payout\x20in\x20smallest\x20units).\x20A\x20row\x20whose\x20value\x20>=\x20the\x20promised\x20payout\x20IS\x20the\x20approval\x20the\x20claim\x20guard\x27s\x20decision\x20leg\x20reads\x20(tpl_repository_review_decision_gate).\x20Writes\x20REQUIRE\x20the\x20merchant\x20decision\x20credential\x20(guard\x20step\x20\x27guard_review_decision\x27);\x20buyers\x20hold\x20no\x20write\x20path.','write_guard':[{'guard':ref('guard_review_decision')}],'id_from':'none','value_type':'U64'}]:[]]}),'notes':'REVIEW-COMPONENT\x20AR-1:\x20the\x20review\x20TEXT\x20still\x20rides\x20the\x20forward\x20message\x20(D-R1\x20dual\x20carrier);\x20this\x20repository\x20carries\x20ONLY\x20the\x20structured\x20row.\x20The\x20buyer\x20writes\x20BOTH\x20rows\x20at\x20review\x20time,\x20both\x20ORDER-KEYED\x20(F09):\x20\x27review\x27\x20(text\x20JSON,\x20id\x20=\x20the\x20ORDER\x20address)\x20AND\x20\x27rating\x27\x20(U64\x20stars,\x20id\x20=\x20the\x20ORDER\x20address\x20—\x20repository.data_add\x20{name:\x27rating\x27,\x20items:[{data:[{id:<order\x20address>,\x20data:<stars>}]}]},\x20same\x20passport\x20as\x20the\x20forward).\x20The\x20\x27rating\x27\x20row\x20is\x20what\x20a\x20reward\x20good-review\x20leg\x20reads\x20(F-62):\x20a\x20good-review\x20bounty\x20claim\x20guard\x20must\x20query\x20this\x20order-keyed\x20U64\x20row,\x20never\x20the\x20text\x20row.\x20Buyers\x20resolve\x20this\x20object\x20by\x20name\x20(workspace/onchain_objects)\x20—\x20never\x20guess\x20an\x20address.'+(cx?'\x20[review_decision\x20policy\x20frozen\x20AFTER\x20its\x20write\x20credential\x20—\x20the\x20guard\x20exists\x20before\x20this\x20create\x20(HOST-GRAPH-01\x20discipline).]':'')}),k['push']({'op':'configure','id':'service_review_repository','target':ref('service'),'method':'repositories','params':P({'op':'add','objects':[ref('repository_review')]}),'requires':['service','repository_review']});}if(N==='review_reward'){const cF=ct;if(cF===undefined||cF['step_id']===undefined)j['push']({'code':'REVIEW_REWARD_GUARD_MISSING','detail':'review_mode\x20\x27review_reward\x27\x20promises\x20a\x20claim\x20reward,\x20but\x20no\x20RESOLVED\x20host:\x22reward\x22\x20guard\x20spec\x20'+'exists\x20to\x20gate\x20the\x20claim.\x20Mount\x20a\x20reward\x20claim\x20guard\x20(e.g.\x20pattern.progress_state_check\x20anchored\x20'+'on\x20the\x20review\x20node\x20or\x20the\x20delivered\x20terminal\x20+\x20review\x20evidence\x20hash)\x20and\x20keep\x20it\x20resolvable\x20—\x20'+'an\x20unguarded\x20incentive\x20promise\x20must\x20not\x20publish\x20(INV-4).\x20The\x20root\x20must\x20also\x20carry\x20the\x20BKN-P2\x20'+'positive-amount\x20leg\x20(order.amount\x20>=\x201)\x20so\x20zero-total\x20orders\x20can\x20never\x20claim.'});else{const cG=b['reward_funding'],cH=D['get'](cF['key']);cH!==undefined&&!rootHasRewardRecordGate(cH['root'])&&j['push']({'code':'REVIEW_REWARD_UNARMED','detail':'review_reward\x20claim\x20guard\x20\x27'+cF['key']+'\x27\x20carries\x20no\x20record-gate:\x20Reward.claim\x20has\x20no\x20order\x20binding\x20of\x20its\x20own\x20'+'(OFN-C1),\x20so\x20a\x20funded\x20pool\x20behind\x20this\x20guard\x20is\x20a\x20replay-drain\x20target.\x20'+SV2_UNARMED_PRESCRIPTION+'\x20—\x20wrapped\x20in\x20'+'logic_and\x20with\x20the\x20identity\x20leg\x20(Signer\x20==\x20order.owner),\x20the\x20BKN-P2\x20positive-amount\x20'+'leg\x20(order.amount\x20>=\x201\x20—\x20zero-total\x20orders\x20must\x20never\x20claim)\x20and\x20the\x20existing\x20checks\x20'+'(see\x20tpl_reward_one_time_claim\x20v55\x20notes;\x20guard-risk\x20R-X1-14\x20audits\x20the\x20built\x20guard).\x20'+'Professional\x20approval\x20form\x20(F10\x20opt-in):\x20set\x20review_decision_enabled=true\x20to\x20have\x20this\x20'+'plan\x20emit\x20the\x20decision\x20channel\x20(guard\x20step\x20\x27guard_review_decision\x27\x20+\x20the\x20repository\x27s\x20'+'\x27review_decision\x27\x20policy),\x20then\x20compose\x20the\x20decision\x20leg\x20from\x20'+'tpl_repository_review_decision_gate\x20into\x20the\x20root\x20(find_where\x20over\x20\x27review_decision\x27\x20'+'with\x20vec_contains_address\x20pinning\x20the\x20submitted\x20order)\x20so\x20the\x20bounty\x20pays\x20only\x20'+'merchant-approved\x20orders.\x20'+'Until\x20armed,\x20do\x20not\x20fund\x20the\x20pool.'});let cI;if(cH!==undefined&&rootHasRewardRecordGate(cH['root']))for(const cJ of cH['table']){const cK=cJ;if(cK['b_submission']===!![]&&String(cK['value_type']??'')['toLowerCase']()==='address'&&(String(cK['object_type']??'')==='Order'||/order/i['test'](String(cK['name']??'')))){cI=cK['identifier'];break;}}k['push']({'op':'configure','id':'reward_review_guard_add','target':ref('reward_review'),'method':'guard_add','params':P({'guard':ref(cF['step_id']),'recipient':{'Signer':'signer'},...cI!==undefined?{'store_from_id':cI}:{}}),'requires':['reward_review'],'notes':'RECIPIENT\x20(crs-mn-261015\x20F-12):\x20recipient\x20is\x20pinned\x20to\x20{Signer:\x27signer\x27}\x20—\x20the\x20claim\x20entry\x20'+'requires\x20recipient\x20==\x20the\x20transaction\x20sender\x20(E_CLAIM_RECIPIENT_NOT_SIGNER\x20otherwise);\x20a\x20GuardIdentifier\x20recipient\x20'+'resolves\x20to\x20the\x20submitted\x20Order\x20and\x20can\x20never\x20be\x20paid.\x20Fill\x20amount\x20=\x20the\x20per-claim\x20bounty\x20'+'(smallest\x20units)\x20when\x20executing.'+(cI!==undefined?'\x20SV-2\x20entry\x20stamp:\x20store_from_id\x20pins\x20the\x20per-order\x20stamp\x20slot\x20(the\x20submitted\x20Order\x20'+'address)\x20so\x20claim\x20records\x20key\x20per\x20order\x20—\x20once\x20per\x20buyer\x20per\x20order\x20(azx7-mn-261014\x20T8).':'')}),k['push']({'op':'configure','id':'service_rewards','target':ref('service'),'method':'rewards','params':P({'op':'add','objects':[ref('reward_review')]}),'requires':['service']}),typeof cG==='string'||typeof cG==='number'?k['push']({'op':'configure','id':'reward_review_coin_add','target':ref('reward_review'),'method':'coin_add','params':{'coin':String(cG)},'requires':['reward_review']}):j['push']({'code':'REVIEW_REWARD_UNFUNDED','detail':'review_mode\x20\x27review_reward\x27\x20without\x20a\x20\x27reward_funding\x27\x20input\x20(INV-4\x20R-REWARD-FUNDED):\x20the\x20incentive\x20'+'is\x20a\x20marketing\x20promise\x20that\x20must\x20be\x20FUNDED\x20when\x20the\x20Service\x20is\x20built\x20(sale-time\x20planning\x20—\x20pool\x20>=\x20'+'expected\x20orders\x20x\x20per-order\x20reward,\x20benchmark\x20fee_param\x20review_reward_pool).\x20Pass\x20reward_funding\x20'+'(smallest-unit\x20string)\x20to\x20fund\x20the\x20Reward\x20object,\x20or\x20drop\x20to\x20review_mode\x20\x22review\x22.'});}}}if(K){k['push']({'op':'create','id':'arbitration','object':'arbitration','params':P({'name':h+'_arbitration','permission':ref('permission_arb'),'type_parameter':ab}),'notes':'Independent\x20venue\x20(R2).\x20New\x20arbitrations\x20default\x20bPaused=true\x20—\x20unpause\x20is\x20a\x20separate\x20operator\x20step.'}),k['push']({'op':'configure','id':'service_arbitrations','target':ref('service'),'method':'arbitrations','params':P({'op':'add','objects':[ref('arbitration')]})});const cL=b['compensation_fund'];(typeof cL==='string'||typeof cL==='number')&&k['push']({'op':'configure','id':'service_compensation','target':ref('service'),'method':'compensation_fund_add','params':{'balance':String(cL)}});}k['push']({'op':'publish','id':'service_publish','target':ref('service'),'preflight':[{'check':'service_publish','status':'pending'},{'check':'FUND-EXIT-01','status':'pending'},{'check':'PLAN-ALLOC-01','status':'pending'},{'check':'TASKBIND-02','status':'pending'}]});const ai=new Set(u['map'](cM=>cM['guard_key'])['filter'](cM=>typeof cM==='string')),aj=/^0x[0-9a-fA-F]{20,64}$/,ak=cM=>{const cN=D['get'](cM);if(cN===undefined)return undefined;for(const cO of cN['table']){const cP=cO;if(cP['b_submission']===!![]||cP['value_type']!=='Address')continue;const cQ=cP['value'];if(typeof cQ==='string'&&aj['test'](cQ))return String(cP['identifier']??'?');}return undefined;};for(const cM of D['keys']()){if(!G['has'](cM)&&!ai['has'](cM))continue;const cN=ak(cM);cN!==undefined&&j['push']({'code':'GUARD_FOREIGN_SERVICE','detail':'guard\x20\x27'+cM+'\x27\x20pins\x20an\x20on-chain\x20address\x20literal\x20(table\x20slot\x20'+cN+')\x20while\x20bound\x20into\x20this\x20build.\x20'+'The\x20plan\x27s\x20Service\x20is\x20created\x20BY\x20this\x20plan\x20and\x20cannot\x20equal\x20a\x20pre-existing\x20address,\x20so\x20the\x20pin\x20names\x20a\x20foreign\x20or\x20'+'stale\x20object:\x20each\x20object\x20is\x20well-formed\x20alone,\x20but\x20the\x20cross-object\x20identity\x20assert\x20aborts\x20every\x20guarded\x20forward\x20'+'(klook\x20B11\x20class),\x20and\x20Guard\x20+\x20machine\x20are\x20both\x20create/publish-frozen\x20—\x20unrepairable.\x20'+'Bind\x20by\x20plan\x20reference\x20({\x22$ref\x22:\x22service\x22})\x20or\x20by\x20the\x20P16\x20circular\x20service\x20NAME\x20instead.'});}const al=E['flatMap'](cO=>{const cP=ai['has'](cO['key'])?'allocator':G['has'](cO['key'])?'machine_edge':cO['host']==='service'&&cO['key']==='buy'?'service_buy':undefined;return cP?[{'key':cO['key'],'template_id':cO['template_id'],'host':cO['host'],'site':cP,'purpose':cO['purpose']}]:[];});return{'plan':{'version':0x1,'intent':d['intent']??'compile\x20'+a['id'],'templateId':a['id'],'inputs':b,'steps':k,...al['length']>0x0?{'pending_guards':al}:{}},'guardSpecs':x,'unresolved':E,'blockers':j,'omitted':[...w]};}
@@ -25,6 +25,9 @@ export interface NodeGameInput {
25
25
  requirements?: string[];
26
26
  order_amount?: string;
27
27
  compensation_fund?: string;
28
+ claimable_rewards?: Array<{
29
+ description?: string;
30
+ }>;
28
31
  operable: NodeForwardInput[];
29
32
  waiting_on: Array<{
30
33
  role: string;
@@ -1 +1 @@
1
- import{classifyOutcome,evaluateOutcome}from'./game-strategy.js';export function evaluateNodeGame(a){const b=a['operable']['map'](c=>{const d=scoreForward(c,a['perspective'],{'risk_appetite':a['appetite'],'requirements':a['requirements']},a['order_amount']);return{'forward':c['name'],'to_node':c['to_node'],'execution_path':c['execution_path'],'guard':c['guard'],'favorability':d['favorability'],'gain_score':d['gain_score'],'risk_score':d['risk_score'],'gain_effects':d['gain_effects'],'risk_effects':d['risk_effects'],'is_optimal':![],'payoff_note':d['payoff'],'risk':d['risk']};});return b['sort']((c,d)=>d['favorability']-c['favorability']),b['length']>0x0&&(b[0x0]['is_optimal']=!![]),{'current_node':a['current_node'],'perspective':a['perspective'],'actions':b,'cooperation':evaluateCooperation(a),'value_at_stake':a['order_amount'],'risk_exposure':a['compensation_fund'],'summary':buildSummary(a,b)};}function evaluateCooperation(a){if(!a['threshold']||a['threshold']<=0x1)return undefined;const b=a['operable']['reduce']((g,h)=>g+(h['weight']??0x1),0x0),c=a['threshold']-b,d=c>0x0?a['waiting_on']['map'](f=>f['role']):[],e=a['allocation'];return{'threshold':a['threshold'],'my_weight':b,'needed_from_others':Math['max'](0x0,c),'collaborators':d,'allocation':e,'allocation_note':e?describeAllocation(e):undefined};}function describeAllocation(b){const c=['settlement\x20splits\x20across\x20'+b['recipient_slots']+'\x20recipient\x20slot(s)'];if(b['direct_to_me_slots']>0x0)c['push'](b['direct_to_me_slots']+'\x20pay\x20directly\x20to\x20you');if(b['guard_gated_slots']>0x0)c['push'](b['guard_gated_slots']+'\x20are\x20guard-resolved\x20(may\x20pay\x20a\x20cooperating\x20party)');if(b['to_payer_slots']>0x0)c['push'](b['to_payer_slots']+'\x20route\x20back\x20to\x20the\x20payer\x20(refund-oriented)');return c['join'](';\x20')+'.';}function scoreForward(a,b,c,d){const e=classifyOutcome(a['consequence']),g=evaluateOutcome(e,b,c);return{'favorability':g['net_score'],'gain_score':g['gain_score'],'risk_score':g['risk_score'],'gain_effects':g['gains'],'risk_effects':g['risks'],'payoff':payoffNote(e,b,d),'risk':riskLabel(g['risk_score'])};}function amountSuffix(a){return a!=null?'\x20('+a+'\x20raw\x20units)':'';}function riskLabel(a){if(a<=0x0)return'low';if(a>=0x32)return'high';return'medium';}function payoffNote(a,b,c){if(b==='customer'||b==='prospect'||b==='demander')switch(a){case'refund':return'funds\x20return\x20to\x20you'+amountSuffix(c)+'\x20(refund/cancel\x20path)';case'completion':return'releases\x20escrowed\x20funds'+amountSuffix(c)+'\x20to\x20the\x20merchant\x20—\x20only\x20confirm\x20if\x20the\x20deliverable\x20matches\x20the\x20agreement';case'advance':return'advances\x20the\x20order\x20to\x20the\x20next\x20node\x20(funds'+amountSuffix(c)+'\x20stay\x20escrowed)';}if(b==='merchant'||b==='collaborator'||b==='supplier')switch(a){case'completion':return'settlement'+amountSuffix(c)+'\x20released\x20to\x20you\x20+\x20shorter\x20fund-settlement\x20cycle';case'refund':return'refund'+amountSuffix(c)+'\x20—\x20downside,\x20recorded\x20on-chain\x20(arb-loss/stall\x20stats)';case'advance':return'advance\x20the\x20workflow\x20to\x20shorten\x20settlement'+amountSuffix(c);}return'neutral\x20for\x20'+b;}function buildSummary(a,b){if(b['length']===0x0)return a['waiting_on']['length']>0x0?'Waiting\x20on\x20'+a['waiting_on']['map'](e=>e['role'])['join'](',\x20'):'No\x20operable\x20actions\x20at\x20node\x20\x27'+(a['current_node']||'(entry)')+'\x27';const c=b[0x0];let d='Optimal\x20for\x20'+a['perspective']+':\x20\x27'+c['forward']+'\x27\x20→\x20\x27'+c['to_node']+'\x27\x20('+c['payoff_note']+')';return b['length']>0x1&&(d+='\x20—\x20choosing\x20this\x20closes\x20the\x20other\x20'+(b['length']-0x1)+'\x20option(s)\x20(opportunity\x20competition:\x20your\x20gain\x20may\x20be\x20another\x20role\x27s\x20lost\x20chance).'),d;}export function actionAssessment(b,c){const d=c?.['cooperation']&&c['cooperation']['needed_from_others']>0x0;return{'consistency':b['favorability'],'net':b['favorability'],'gains':[...b['gain_effects']],'risks':[...b['risk_effects']],...d?{'cost_of_delay':'advancing\x20requires\x20'+c['cooperation']['needed_from_others']+'\x20more\x20weight\x20from\x20other\x20role(s)'}:{},...c?.['value_at_stake']!==undefined?{'commercial_stake':c['value_at_stake']}:{}};}
1
+ import{classifyOutcome,evaluateOutcome}from'./game-strategy.js';export function evaluateNodeGame(a){const b=a['perspective']==='customer'||a['perspective']==='prospect'||a['perspective']==='demander',c=b&&(a['claimable_rewards']??[])['length']>0x0,d=a['operable']['map'](e=>{const g=scoreForward(e,a['perspective'],{'risk_appetite':a['appetite'],'requirements':a['requirements']},a['order_amount']),h=/review/i['test'](e['to_node']),i=c&&h?0xa:0x0,j=i>0x0?[...g['gain_effects'],'merchant-funded\x20review\x20incentive\x20attached\x20to\x20this\x20order'+incentiveLabel(a['claimable_rewards'])+'\x20—\x20'+'the\x20claim\x20rides\x20the\x20SAME\x20passport\x20as\x20this\x20forward\x20(guard/window\x20conditions\x20apply;\x20see\x20pending\x20claims)']:g['gain_effects'],k=b&&classifyOutcome(e['consequence'])==='refund',l=k?[...g['risk_effects'],'no\x20on-chain\x20quality\x20evidence\x20backs\x20a\x20refund\x20claim\x20—\x20it\x20is\x20YOUR\x20judgment\x20call\x20to\x20justify,\x20never\x20a\x20default\x20recommendation\x20(F31)']:g['risk_effects'];return{'forward':e['name'],'to_node':e['to_node'],'execution_path':e['execution_path'],'guard':e['guard'],'favorability':g['favorability']+i,'gain_score':g['gain_score']+i,'risk_score':g['risk_score'],'gain_effects':j,'risk_effects':l,'is_optimal':![],'payoff_note':k?'BUYER-INTEREST\x20move\x20(opposes\x20the\x20merchant\x27s\x20settled\x20interest):\x20'+g['payoff']:g['payoff'],'risk':g['risk']};});return d['sort']((e,f)=>f['favorability']-e['favorability']),d['length']>0x0&&(d[0x0]['is_optimal']=!![]),{'current_node':a['current_node'],'perspective':a['perspective'],'actions':d,'cooperation':evaluateCooperation(a),'value_at_stake':a['order_amount'],'risk_exposure':a['compensation_fund'],'summary':buildSummary(a,d)};}function incentiveLabel(a){const b=a?.['find'](c=>c['description']);return b?.['description']?'\x20(\x27'+b['description']+'\x27)':'';}function evaluateCooperation(a){if(!a['threshold']||a['threshold']<=0x1)return undefined;const b=a['operable']['reduce']((g,h)=>g+(h['weight']??0x1),0x0),c=a['threshold']-b,d=c>0x0?a['waiting_on']['map'](f=>f['role']):[],e=a['allocation'];return{'threshold':a['threshold'],'my_weight':b,'needed_from_others':Math['max'](0x0,c),'collaborators':d,'allocation':e,'allocation_note':e?describeAllocation(e):undefined};}function describeAllocation(b){const c=['settlement\x20splits\x20across\x20'+b['recipient_slots']+'\x20recipient\x20slot(s)'];if(b['direct_to_me_slots']>0x0)c['push'](b['direct_to_me_slots']+'\x20pay\x20directly\x20to\x20you');if(b['guard_gated_slots']>0x0)c['push'](b['guard_gated_slots']+'\x20are\x20guard-resolved\x20(may\x20pay\x20a\x20cooperating\x20party)');if(b['to_payer_slots']>0x0)c['push'](b['to_payer_slots']+'\x20route\x20back\x20to\x20the\x20payer\x20(refund-oriented)');return c['join'](';\x20')+'.';}function scoreForward(a,b,c,d){const e=classifyOutcome(a['consequence']),g=evaluateOutcome(e,b,c);return{'favorability':g['net_score'],'gain_score':g['gain_score'],'risk_score':g['risk_score'],'gain_effects':g['gains'],'risk_effects':g['risks'],'payoff':payoffNote(e,b,d),'risk':riskLabel(g['risk_score'])};}function amountSuffix(a){return a!=null?'\x20('+a+'\x20raw\x20units)':'';}function riskLabel(a){if(a<=0x0)return'low';if(a>=0x32)return'high';return'medium';}function payoffNote(a,b,c){if(b==='customer'||b==='prospect'||b==='demander')switch(a){case'refund':return'funds\x20return\x20to\x20you'+amountSuffix(c)+'\x20(refund/cancel\x20path)';case'completion':return'releases\x20escrowed\x20funds'+amountSuffix(c)+'\x20to\x20the\x20merchant\x20—\x20only\x20confirm\x20if\x20the\x20deliverable\x20matches\x20the\x20agreement';case'advance':return'advances\x20the\x20order\x20to\x20the\x20next\x20node\x20(funds'+amountSuffix(c)+'\x20stay\x20escrowed)';}if(b==='merchant'||b==='collaborator'||b==='supplier')switch(a){case'completion':return'settlement'+amountSuffix(c)+'\x20released\x20to\x20you\x20+\x20shorter\x20fund-settlement\x20cycle';case'refund':return'refund'+amountSuffix(c)+'\x20—\x20downside,\x20recorded\x20on-chain\x20(arb-loss/stall\x20stats)';case'advance':return'advance\x20the\x20workflow\x20to\x20shorten\x20settlement'+amountSuffix(c);}return'neutral\x20for\x20'+b;}function buildSummary(a,b){if(b['length']===0x0)return a['waiting_on']['length']>0x0?'Waiting\x20on\x20'+a['waiting_on']['map'](e=>e['role'])['join'](',\x20'):'No\x20operable\x20actions\x20at\x20node\x20\x27'+(a['current_node']||'(entry)')+'\x27';const c=b[0x0];let d='Optimal\x20for\x20'+a['perspective']+':\x20\x27'+c['forward']+'\x27\x20→\x20\x27'+c['to_node']+'\x27\x20('+c['payoff_note']+')';return(a['perspective']==='customer'||a['perspective']==='prospect'||a['perspective']==='demander')&&classifyOutcome(a['operable']['find'](e=>e['name']===c['forward'])?.['consequence'])==='refund'&&(d+='\x20NOTE:\x20this\x20ranks\x20first\x20only\x20because\x20refund\x20reads\x20as\x20your\x20immediate\x20fund\x20interest\x20—\x20no\x20on-chain\x20quality\x20evidence\x20supports\x20it;\x20weigh\x20the\x20delivered\x20value\x20before\x20filing.'),b['length']>0x1&&(d+='\x20—\x20choosing\x20this\x20closes\x20the\x20other\x20'+(b['length']-0x1)+'\x20option(s)\x20(opportunity\x20competition:\x20your\x20gain\x20may\x20be\x20another\x20role\x27s\x20lost\x20chance).'),d;}export function actionAssessment(b,c){const d=c?.['cooperation']&&c['cooperation']['needed_from_others']>0x0;return{'consistency':b['favorability'],'net':b['favorability'],'gains':[...b['gain_effects']],'risks':[...b['risk_effects']],...d?{'cost_of_delay':'advancing\x20requires\x20'+c['cooperation']['needed_from_others']+'\x20more\x20weight\x20from\x20other\x20role(s)'}:{},...c?.['value_at_stake']!==undefined?{'commercial_stake':c['value_at_stake']}:{}};}
@@ -1 +1 @@
1
- export const RECOVERY_RULES={'insufficient_balance':{'error_code':'insufficient_balance','strategy':'claim_faucet','max_attempts':0x3,'automation':'semi','detail':'1.\x20Testnet:\x20claim\x20WOW\x20from\x20the\x20faucet\x202.\x20Mainnet:\x20transfer\x20ETH/USDT/USDC/WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge\x20(query\x20active\x20EVM\x20account\x20→\x20top\x20up\x20from\x20external\x20wallet\x20→\x20confirm\x20→\x20cross-chain)\x203.\x20Point\x20the\x20user\x20to\x20the\x20live\x20airdrop\x20page\x20(https://wowok.net/airdrop.html)\x20for\x20the\x20current\x20round\x204.\x20Retry\x20original\x20operation.\x20NOTE:\x20this\x20rule\x20is\x20for\x20the\x20SIGNING\x20ACCOUNT\x27s\x20wallet/gas\x20only\x20—\x20an\x20on-chain\x20POOL\x20shortage\x20(reward/allocation)\x20classifies\x20as\x20pool_shortage,\x20never\x20here','user_prompt':'Insufficient\x20balance\x20for\x20gas\x20or\x20operation.\x20How\x20to\x20obtain\x20WOW\x20tokens:\x20(1)\x20Testnet\x20—\x20claim\x20WOW\x20from\x20the\x20faucet\x20(https://faucet.testnet.wowok.net);\x20all\x20merchant\x20and\x20order\x20testing\x20can\x20use\x20WOW\x20as\x20the\x20payment\x20token.\x20(2)\x20Mainnet\x20—\x20transfer\x20ETH\x20/\x20USDT\x20/\x20USDC\x20/\x20WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge:\x20first\x20query\x20the\x20active\x20EVM\x20account\x20(bridge_operation\x20query_active_evm_account,\x20auto-generated\x20on\x20first\x20use),\x20then\x20transfer\x20from\x20an\x20external\x20wallet\x20(e.g.\x20MetaMask)\x20to\x20that\x20address,\x20confirm\x20the\x20balance\x20arrived,\x20and\x20cross-chain\x20to\x20WOW\x20mainnet\x20(bridge_operation\x20cross_chain_evm_to_wow).\x20(3)\x20WOW\x20airdrop:\x20current\x20round\x20status,\x20pool\x20and\x20eligibility\x20are\x20published\x20live\x20at\x20https://wowok.net/airdrop.html\x20(referral:\x20https://wowok.net/refer.html)\x20—\x20open\x20that\x20page\x20rather\x20than\x20assuming\x20a\x20round\x20is\x20live\x20or\x20closed.\x20Query\x20wowok_buildin_info\x20with\x20info=\x27funding\x20guidance\x27\x20for\x20the\x20canonical\x20funding\x20guidance.'},'pool_shortage':{'error_code':'pool_shortage','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'An\x20on-chain\x20POOL\x20cannot\x20cover\x20the\x20operation\x20(reward.move:243\x20abort\x206\x20/\x20'+'allocation.move:509\x20abort\x207)\x20—\x20a\x20pool\x20funding\x20problem,\x20NOT\x20the\x20caller\x27s\x20wallet;\x20a\x20faucet\x20claim\x20will\x20NOT\x20help\x20and\x20re-sending\x20the\x20rail\x20unchanged\x20changes\x20nothing.\x201.\x20Reward\x20pool:\x20the\x20reward\x20ISSUER\x20tops\x20it\x20up\x20with\x20reward\x20coin_add\x20(permission\x20153)\x20—\x20the\x20claim\x20key\x20slot\x20is\x20written\x20BEFORE\x20the\x20balance\x20assert\x20and\x20the\x20abort\x20rolls\x20it\x20back,\x20so\x20NOTHING\x20was\x20consumed;\x20the\x20identical\x20claim\x20succeeds\x20after\x20the\x20top-up\x20(mainnet-proven,\x20T14).\x202.\x20Allocation\x20pool:\x20the\x20payer\x20side\x20funds\x20the\x20order/allocation\x20first\x20(order\x20renew,\x20payment\x20create\x20into\x20the\x20allocation),\x20then\x20re-runs\x20the\x20rail;\x20if\x20the\x20pool\x20is\x20drained\x20because\x20the\x20rail\x20ALREADY\x20paid\x20(balance\x200,\x20once-slot\x20consumed),\x20verify\x20via\x20the\x20Payment\x20record\x20instead\x20of\x20retrying.\x203.\x20As\x20the\x20BUYER:\x20report\x20the\x20shortage\x20to\x20the\x20merchant\x20—\x20never\x20fund\x20a\x20pool\x20you\x20do\x20not\x20own','user_prompt':'The\x20on-chain\x20pool\x20backing\x20this\x20operation\x20is\x20short\x20of\x20funds.\x20The\x20pool\x27s\x20owner\x20must\x20top\x20it\x20up\x20(reward\x20coin_add\x20/\x20allocation\x20funding)\x20—\x20a\x20faucet\x20claim\x20will\x20not\x20help.\x20As\x20the\x20buyer,\x20ask\x20the\x20merchant\x20to\x20fund\x20the\x20pool.'},'stock_exhausted':{'error_code':'stock_exhausted','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Merchant-side\x20inventory\x20shortfall\x20(Move\x20service:16\x20E_STOCK_NOT_ENOUGH)\x20—\x20NOT\x20a\x20buyer\x20balance\x20problem,\x20so\x20a\x20faucet\x20claim\x20will\x20NOT\x20help.\x201.\x20Reduce\x20the\x20purchase\x20quantity\x20to\x20the\x20item\x27s\x20remaining\x20stock\x202.\x20Pick\x20another\x20sale\x20item\x203.\x20Ask\x20the\x20merchant\x20to\x20restock,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x27s\x20stock\x20is\x20exhausted\x20for\x20the\x20requested\x20quantity.\x20Reduce\x20the\x20quantity,\x20choose\x20another\x20item,\x20or\x20ask\x20the\x20merchant\x20to\x20restock.'},'sale_suspended':{'error_code':'sale_suspended','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20merchant\x20suspended\x20this\x20sale\x20item\x20(Move\x20service:34\x20E_SALE_SUSPENDED).\x201.\x20Pick\x20another\x20(non-suspended)\x20item\x202.\x20Contact\x20the\x20merchant\x20to\x20resume\x20the\x20sale,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x20is\x20suspended\x20by\x20the\x20merchant.\x20Please\x20choose\x20another\x20item\x20or\x20contact\x20the\x20merchant.'},'discount_invalid':{'error_code':'discount_invalid','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20discount\x20is\x20outside\x20its\x20[time_start,\x20time_end]\x20validity\x20window\x20(Move\x20service:35\x20E_DISCOUNT_TIME_INVALID).\x201.\x20Retry\x20without\x20the\x20discount\x202.\x20Ask\x20the\x20merchant\x20for\x20a\x20fresh\x20discount,\x20then\x20retry','user_prompt':'The\x20discount\x20is\x20not\x20valid\x20at\x20the\x20current\x20time\x20(outside\x20its\x20validity\x20window).\x20Buy\x20without\x20the\x20discount\x20or\x20ask\x20the\x20merchant\x20for\x20a\x20new\x20one.'},'rate_limit':{'error_code':'rate_limit','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Rate\x20limit\x20hit\x20(HTTP\x20429).\x20Exponential\x20backoff\x20retry:\x202s\x20/\x204s\x20/\x208s\x20/\x2016s\x20/\x2032s.\x20Avoid\x20parallel\x20calls\x20while\x20the\x20limit\x20window\x20is\x20active.'},'gas_exceeded':{'error_code':'gas_exceeded','strategy':'adjust_params','max_attempts':0x3,'automation':'semi','detail':'Gas\x20budget\x20exceeded.\x201.\x20Increase\x20the\x20gas_budget\x20parameter\x202.\x20Reduce\x20the\x20operation\x20size\x20(fewer\x20objects\x20per\x20transaction)\x203.\x20Retry\x20the\x20original\x20operation','user_prompt':'Gas\x20budget\x20exceeded.\x20Increase\x20the\x20gas\x20budget\x20or\x20reduce\x20the\x20operation\x20size,\x20then\x20retry.'},'insufficient_gas':{'error_code':'insufficient_gas','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Gas\x20exhausted\x20—\x20the\x20transaction\x20failed\x20deterministically\x20and\x20did\x20NOT\x20commit\x20on-chain\x20(no\x20state\x20changed;\x20commit-state\x20verification\x20is\x20NOT\x20needed).\x201.\x20Raise\x20the\x20gas_budget\x20parameter\x20above\x20the\x20failed\x20transaction\x27s\x20gas_used\x202.\x20If\x20the\x20account\x20balance\x20cannot\x20cover\x20any\x20budget,\x20fund\x20the\x20signing\x20account\x20with\x20gas\x20tokens\x20first\x203.\x20Resubmit\x20as\x20a\x20FRESH\x20call\x20—\x20do\x20NOT\x20replay\x20the\x20same\x20transaction','user_prompt':'The\x20transaction\x20ran\x20out\x20of\x20gas\x20and\x20did\x20not\x20commit\x20on-chain.\x20Increase\x20the\x20gas\x20budget\x20(or\x20fund\x20the\x20account\x20with\x20gas)\x20and\x20submit\x20a\x20fresh\x20transaction\x20—\x20retrying\x20unchanged\x20will\x20fail\x20the\x20same\x20way.'},'bcs_error':{'error_code':'bcs_error','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'BCS\x20serialization/deserialization\x20error\x20—\x20a\x20parameter\x20does\x20not\x20match\x20the\x20expected\x20type/structure.\x201.\x20Query\x20the\x20operation\x20schema\x20(schema_query)\x202.\x20Fix\x20the\x20offending\x20parameter\x20type\x20(e.g.\x20BigInt\x20vs\x20number,\x20vector\x20element\x20type)\x203.\x20Retry','user_prompt':'A\x20parameter\x20failed\x20serialization.\x20Check\x20the\x20parameter\x20types\x20against\x20the\x20schema\x20and\x20retry.'},'signature_error':{'error_code':'signature_error','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'Signature\x20verification\x20failed.\x201.\x20Verify\x20the\x20account\x20is\x20not\x20suspended\x202.\x20Check\x20the\x20network\x20matches\x20the\x20account\x27s\x203.\x20Switch\x20to\x20a\x20healthy\x20account\x20and\x20retry','user_prompt':'Signature\x20verification\x20failed.\x20The\x20account\x20may\x20be\x20suspended\x20or\x20misconfigured.\x20Switch\x20accounts\x20or\x20check\x20the\x20configuration\x20and\x20retry.'},'config_error':{'error_code':'config_error','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'Local\x20configuration\x20error\x20(network\x20not\x20specified,\x20persistent\x20storage\x20not\x20set).\x201.\x20Show\x20the\x20user\x20which\x20configuration\x20is\x20missing\x202.\x20Guide\x20the\x20user\x20through\x20the\x20account_operation/config\x20setup\x203.\x20Retry\x20after\x20the\x20user\x20fixes\x20it','user_prompt':'Local\x20configuration\x20is\x20incomplete.\x20Please\x20finish\x20the\x20account/network\x20setup\x20and\x20retry.'},'wip_verification_failed':{'error_code':'wip_verification_failed','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'WIP\x20file\x20not\x20publicly\x20reachable\x20/\x20hash\x20mismatch.\x201.\x20Upload\x20via\x20the\x20wip\x20storage\x20service\x20(wip_file\x20type=\x27upload\x27\x20—\x20official\x20free\x20store\x20or\x20storage=\x27custom\x27)\x202.\x20Or\x20deploy\x20to\x20a\x20public\x20URL\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20own\x20site)\x203.\x20Update\x20the\x20sale\x27s\x20wip\x20URL\x204.\x20Re-run\x20the\x20operation','user_prompt':'The\x20WIP\x20file\x20could\x20not\x20be\x20verified\x20from\x20a\x20public\x20URL.\x20Upload\x20it\x20with\x20wip_file\x20type=\x27upload\x27\x20(official\x20free\x20store\x20or\x20your\x20own\x20service)\x20or\x20deploy\x20it\x20(GitHub\x20Pages\x20/\x20IPFS),\x20update\x20the\x20sale\x27s\x20WIP\x20URL,\x20and\x20retry.'},'wip_storage_unavailable':{'error_code':'wip_storage_unavailable','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'Transient\x20wip\x20storage\x20transport\x20failure.\x201.\x20Retry\x20the\x20same\x20request\x20with\x20bounded\x20backoff\x202.\x20Large\x20WIP\x20files\x20are\x20network-sensitive:\x20compress\x20images\x20before\x20generate\x20(each\x20image\x20<=\x202MB,\x20total\x20<=\x2010MB)\x203.\x20Check\x20connectivity\x20to\x20the\x20storage\x20base\x20URL\x20if\x20retries\x20keep\x20failing','user_prompt':'The\x20wip\x20storage\x20request\x20failed\x20due\x20to\x20a\x20network\x20problem.\x20Retry\x20the\x20upload;\x20if\x20it\x20keeps\x20failing,\x20reduce\x20the\x20file\x20size\x20or\x20check\x20connectivity.'},'wip_storage_rejected':{'error_code':'wip_storage_rejected','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'WIP\x20storage\x20service\x20rejected\x20the\x20request\x20(HTTP\x204xx\x20—\x20deterministic\x20client-side\x20fault,\x20retrying\x20unchanged\x20fails\x20identically).\x20400:\x20malformed\x20body\x20or\x20failed\x20WIP\x20validation\x20—\x20re-generate\x20via\x20wip_file\x20type=\x27generate\x27\x20401:\x20re-sign\x20with\x20a\x20fresh\x20nonce\x20inside\x20the\x20timestamp\x20window\x20403:\x20check\x20storage\x20service\x20configuration\x20404:\x20file\x20does\x20not\x20exist\x20—\x20re-upload\x20409:\x20quota\x20—\x20delete\x20old\x20files\x20via\x20wip_file\x20type=\x27list\x27\x20then\x20delete\x20413:\x20compress\x20images\x20(each\x20<=\x202MB,\x20total\x20<=\x2010MB)\x20and\x20regenerate','user_prompt':'The\x20WIP\x20storage\x20service\x20rejected\x20the\x20request\x20(HTTP\x204xx).\x20Fix\x20the\x20specific\x20fault\x20(re-generate/re-sign/re-upload\x20per\x20the\x20status\x20code)\x20and\x20retry\x20—\x20do\x20not\x20retry\x20unchanged.'},'network_error':{'error_code':'network_error','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Transport\x20failure\x20(timeout\x20/\x20connection\x20reset\x20/\x20RPC\x20unreachable\x20/\x20HTTP\x205xx\x20gateway\x20error).\x20Exponential\x20backoff\x20retry:\x201s\x20/\x202s\x20/\x204s\x20/\x208s\x20/\x2016s.\x20Switch\x20RPC\x20node\x20if\x20available.\x20READS:\x20a\x20plain\x20retry\x20is\x20safe.\x20FUND-MOVING\x20WRITES:\x20before\x20any\x20resubmission,\x20verify\x20whether\x20the\x20previous\x20attempt\x20landed\x20(query\x20the\x20reported\x20digest\x20directly,\x20or\x20the\x20expected\x20object\x20via\x20the\x20sender\x27s\x20recent\x20on-chain\x20objects\x20/\x20onchain_events)\x20—\x20if\x20it\x20landed,\x20ADOPT\x20it\x20and\x20stop;\x20a\x20blind\x20backoff\x20retry\x20of\x20a\x20landed\x20write\x20moves\x20the\x20funds\x20a\x20second\x20time.'},'submission_unknown':{'error_code':'submission_unknown','strategy':'query_and_retry','max_attempts':0x2,'automation':'semi','detail':'Transport-level\x20failure\x20after\x20the\x20request\x20left\x20the\x20client\x20—\x20the\x20submission\x20state\x20is\x20UNKNOWN\x20and\x20the\x20transaction\x20may\x20already\x20be\x20committed.\x20NEVER\x20auto-retry\x20a\x20write\x20here.\x201.\x20Verify\x20commit\x20state\x20on-chain:\x20query_toolkit\x20for\x20the\x20object\x20this\x20call\x20would\x20create/modify\x20(resolve\x20the\x20reference\x20from\x20the\x20call\x27s\x20own\x20arguments),\x20or\x20onchain_events\x20for\x20the\x20sender\x27s\x20recent\x20transactions.\x202.\x20If\x20the\x20expected\x20object\x20EXISTS,\x20adopt\x20it\x20and\x20continue\x20the\x20workflow\x20(the\x20operation\x20succeeded\x20despite\x20the\x20transport\x20error).\x203.\x20If\x20confirmed\x20ABSENT,\x20resubmit\x20the\x20SAME\x20call\x20once\x20—\x20for\x20a\x20FIRST-EVER\x20transaction\x20on\x20a\x20fresh\x20account\x20make\x20that\x20resubmission\x20with\x20env.no_auto_register=true\x20and\x20SAY\x20SO\x20(the\x20SDK\x20silently\x20appends\x20an\x20entity\x20registration\x20to\x20a\x20first\x20business\x20call;\x20if\x20that\x20appended\x20leg\x20was\x20the\x20failing\x20leg\x20the\x20skip\x20lets\x20the\x20call\x20through\x20—\x20ziroom-mn-261013\x20live\x20case;\x20if\x20the\x20resubmission\x20aborts,\x20the\x20envelope\x20now\x20names\x20the\x20abort\x20—\x20re-enable\x20auto\x20registration\x20and\x20retry).\x204.\x20If\x20the\x20reported\x20digest\x20does\x20not\x20resolve\x20or\x20the\x20failure\x20repeats,\x20STOP\x20looping\x20on\x20digest\x20checks\x20and\x20re-run\x20the\x20SAME\x20call\x20with\x20env.dry_run=true\x20—\x20the\x20simulation\x20surfaces\x20the\x20real\x20failure\x20(exact\x20Move\x20abort)\x20without\x20gas\x20or\x20duplicate\x20risk.\x205.\x20Reads\x20are\x20idempotent\x20—\x20retry\x20immediately.\x206.\x20M-K2\x20replay\x20discipline:\x20a\x20FAILED\x20receipt\x20is\x20final\x20—\x20its\x20digest\x20is\x20consumed\x20and\x20replaying\x20the\x20same\x20bytes\x20returns\x20the\x20same\x20failure\x20forever;\x20fix\x20the\x20cause\x20(usually\x20funding)\x20and\x20build\x20a\x20FRESH\x20transaction.\x20Live\x20mainnet\x20incident\x20behind\x20this\x20rule:\x20an\x20order_new\x20-32603\x20\x27did\x20not\x20complete\x27\x20had\x20committed;\x20the\x20blind\x20retry\x20created\x20a\x20second\x20order\x20with\x20a\x20second\x20full\x20escrow\x20and\x20a\x20second\x20stock\x20decrement','user_prompt':'The\x20request\x20failed\x20at\x20transport\x20level\x20but\x20may\x20have\x20already\x20been\x20committed\x20on-chain.\x20Verify\x20whether\x20the\x20expected\x20object\x20exists\x20(query\x20it)\x20before\x20any\x20retry\x20—\x20a\x20blind\x20retry\x20can\x20duplicate\x20the\x20operation\x20(double\x20escrow).\x20For\x20read\x20operations,\x20a\x20plain\x20retry\x20is\x20safe.'},'transaction_expired':{'error_code':'transaction_expired','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'The\x20transaction\x20expired\x20before\x20execution\x20(epoch\x20boundary\x20or\x20validator/gateway\x20outage)\x20—\x20it\x20did\x20NOT\x20land\x20and\x20nothing\x20was\x20committed.\x20Bounded\x20backoff\x20retry:\x2010s\x20/\x2030s\x20/\x2060s,\x20resubmit\x20the\x20SAME\x20call\x20unchanged.\x20If\x20a\x20dry_run\x20passes\x20while\x20the\x20real\x20call\x20keeps\x20failing,\x20the\x20fault\x20is\x20chain-side\x20—\x20wait\x20it\x20out.\x20Verify\x20with\x20onchain_events\x20if\x20unsure.'},'guard_rejected':{'error_code':'guard_rejected','strategy':'fill_submission','max_attempts':0x2,'automation':'semi','detail':'1.\x20Parse\x20Guard\x20table\x20structure\x202.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20them\x20and\x20resubmit\x20with\x20call_with_submission\x203.\x20If\x20it\x20defines\x20none,\x20the\x20rule\x20evaluated\x20false\x20—\x20typical\x20causes:\x20a\x20TIME\x20WINDOW\x20(Clock\x20deadline/opening\x20comparison\x20—\x20this\x20call\x20may\x20sit\x20outside\x20the\x20window,\x20and\x20a\x20mis-oriented\x20comparison\x20inverts\x20it:\x20everything\x20inside\x20rejected,\x20everything\x20after\x20admitted)\x20or\x20an\x20IDENTITY\x20condition\x20(signer/state\x20checks\x20—\x20the\x20caller\x20may\x20not\x20be\x20the\x20address\x20the\x20rule\x20expects);\x20adjust\x20the\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20(docs#40)\x204.\x20When\x20the\x20failure\x20is\x20passport\x20E_VERIFY_FAILED\x20and\x20a\x20submission\x20was\x20supplied,\x20the\x20response\x20appends\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line\x20naming\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20fix\x20that\x20guard\x20first\x205.\x20A\x20TIME-window\x20rejection\x20may\x20simply\x20be\x20EARLY:\x20re-run\x20the\x20SAME\x20call\x20with\x20env.dry_run=true\x20to\x20probe\x20the\x20window\x20for\x20free\x20(guard\x20rejections\x20do\x20NOT\x20consume\x20the\x20total\x20retry\x20budget;\x20only\x20the\x20per-code\x20cap\x20of\x202\x20applies)','user_prompt':'Guard\x20verification\x20rejected.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20in\x20the\x20required\x20submission\x20data\x20and\x20resubmit;\x20if\x20it\x20defines\x20none,\x20the\x20Guard\x20rule\x20evaluated\x20false\x20—\x20the\x20usual\x20causes\x20are\x20a\x20time\x20window\x20(this\x20call\x20may\x20be\x20outside\x20the\x20Clock\x20deadline/opening\x20window)\x20or\x20an\x20identity\x20condition\x20(the\x20caller\x20is\x20not\x20the\x20address\x20the\x20rule\x20expects);\x20adjust\x20this\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20rule.\x20When\x20the\x20response\x20includes\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line,\x20it\x20names\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20address\x20that\x20guard\x20first.\x20A\x20time-window\x20rejection\x20may\x20simply\x20be\x20early:\x20probe\x20the\x20window\x20with\x20env.dry_run=true\x20(free\x20—\x20guard\x20rejections\x20do\x20not\x20consume\x20the\x20total\x20retry\x20budget).'},'time_lock_not_elapsed':{'error_code':'time_lock_not_elapsed','strategy':'wait_and_retry','max_attempts':0x1,'automation':'semi','detail':'1.\x20Verify\x20Service\x20is\x20paused\x20(bPaused=true).\x20If\x20not,\x20submit\x20pause=true\x20first.\x202.\x20Wait\x20until\x20paused_time\x20+\x20setting_lock_duration\x20<=\x20current\x20clock.\x203.\x20Retry\x20the\x20original\x20operation.\x20Do\x20NOT\x20recreate\x20the\x20object.','user_prompt':'Service\x20setting_lock_duration\x20has\x20not\x20elapsed\x20since\x20the\x20Service\x20was\x20paused.\x20Please\x20pause\x20the\x20Service\x20if\x20it\x20is\x20not\x20already\x20paused,\x20wait\x20for\x20the\x20lock\x20duration\x20to\x20elapse,\x20then\x20retry.'},'immutable_violation':{'error_code':'immutable_violation','strategy':'recreate','max_attempts':0x1,'automation':'semi','detail':'1.\x20Stop\x20modification\x20attempt\x202.\x20Evaluate\x20creating\x20a\x20new\x20object\x20as\x20replacement\x203.\x20Re-plan\x20affected\x20phases','user_prompt':'Cannot\x20modify\x20an\x20immutable\x20object.\x20A\x20new\x20object\x20must\x20be\x20created\x20as\x20a\x20replacement.\x20Confirm\x20to\x20proceed\x20with\x20recreation.'},'permission_denied':{'error_code':'permission_denied','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20object\x27s\x20permission_guard\x202.\x20List\x20accounts\x20with\x20permission\x203.\x20Switch\x20account\x20or\x20prompt\x20user\x20to\x20add\x20permission','user_prompt':'Current\x20account\x20lacks\x20permission\x20for\x20this\x20operation.\x20Switch\x20to\x20an\x20authorized\x20account\x20or\x20update\x20the\x20Permission\x20object.'},'object_not_found':{'error_code':'object_not_found','strategy':'query_and_retry','max_attempts':0x3,'automation':'semi','detail':'1.\x20Verify\x20the\x20referenced\x20name/ID\x20spelling\x20(local_mark_list)\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network\x202.\x20If\x20recently\x20created,\x20re-query\x20the\x20object\x20(may\x20be\x20sync\x20delay)\x203.\x20If\x20truly\x20absent,\x20search\x20for\x20similar\x20objects\x204.\x20Prompt\x20user\x20to\x20reselect','user_prompt':'Referenced\x20object\x20not\x20found.\x20First\x20verify\x20the\x20name/ID\x20spelling\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network;\x20if\x20it\x20was\x20created\x20recently,\x20this\x20may\x20be\x20a\x20synchronization\x20delay\x20—\x20retry.\x20If\x20the\x20issue\x20persists,\x20please\x20select\x20a\x20valid\x20object.'},'state_conflict':{'error_code':'state_conflict','strategy':'adjust_params','max_attempts':0x2,'automation':'full','detail':'1.\x20Query\x20object\x27s\x20current\x20true\x20state\x202.\x20Update\x20ODG\x20status\x20annotations\x203.\x20Adjust\x20subsequent\x20operations\x20(e.g.,\x20skip\x20completed\x20steps)'},'invalid_parameter':{'error_code':'invalid_parameter','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20the\x20relevant\x20schema\x202.\x20Auto-fix\x20obvious\x20errors\x20(e.g.,\x20BigInt\x20vs\x20string)\x203.\x20If\x20unfixable,\x20prompt\x20user','user_prompt':'Parameter\x20validation\x20failed.\x20Please\x20check\x20the\x20parameter\x20types\x20and\x20values\x20against\x20the\x20schema\x20and\x20retry.'},'move_abort_unmapped':{'error_code':'move_abort_unmapped','strategy':'stop','max_attempts':0x1,'automation':'manual','detail':'The\x20chain\x27s\x20business\x20logic\x20aborted\x20and\x20the\x20(module,\x20abort\x20code)\x20pair\x20has\x20no\x20local\x20mapping.\x20Read\x20the\x20module\x20and\x20abort\x20code\x20from\x20move_abort_info\x20/\x20the\x20message\x20(rendered\x20as\x20\x27abort\x20(N)\x27),\x20resolve\x20their\x20meaning\x20from\x20the\x20module\x27s\x20documentation\x20or\x20the\x20wowok-tools\x20Skill,\x20fix\x20the\x20business\x20cause,\x20and\x20issue\x20a\x20NEW\x20call.\x20Do\x20NOT\x20restart\x20the\x20server\x20and\x20do\x20NOT\x20retry\x20the\x20identical\x20call\x20—\x20it\x20aborts\x20deterministically.','user_prompt':'The\x20operation\x20was\x20rejected\x20by\x20the\x20chain\x27s\x20business\x20logic\x20and\x20its\x20abort\x20code\x20is\x20not\x20mapped\x20locally.\x20The\x20module\x20name\x20and\x20abort\x20code\x20in\x20the\x20error\x20are\x20authoritative\x20—\x20review\x20them\x20(and\x20the\x20object\x20state\x20via\x20query_toolkit)\x20before\x20adjusting\x20anything.'},'missing_data':{'error_code':'missing_data','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'A\x20guard\x20rule\x20read\x20a\x20keyed\x20table\x20row\x20that\x20does\x20NOT\x20exist\x20(repository.data\x20/\x20oracle\x20entry)\x20and\x20the\x20verifier\x20surfaced\x20it\x20as\x20a\x20location-only\x20fault\x20inside\x20the\x20passport\x20module\x20—\x20no\x20abort\x20code,\x20because\x20the\x20framework\x20cannot\x20express\x20\x27row\x20absent\x27\x20as\x20an\x20abort.\x20This\x20is\x20a\x20DATA\x20problem:\x201.\x20Identify\x20the\x20repository\x20and\x20key\x20the\x20guard\x20rule\x20reads\x20(guard2file\x20/\x20analyze_guard_semantics\x20on\x20the\x20guard\x20source)\x202.\x20Have\x20the\x20row\x27s\x20producer\x20write\x20it\x20(e.g.\x20an\x20oracle\x20timestamp\x20like\x20checkin_ts),\x20or\x20add\x20it\x20with\x20repository\x20data_add\x20(data_add.name\x20must\x20match\x20a\x20policy\x20rule\x20name)\x203.\x20Retry\x20the\x20SAME\x20call\x20unchanged\x20—\x20a\x20dry_run\x20that\x20turns\x20clean\x20after\x20the\x20row\x20exists\x20confirms\x20the\x20diagnosis','user_prompt':'A\x20guard\x20rule\x20references\x20a\x20data\x20row\x20that\x20has\x20not\x20been\x20written\x20yet\x20(location-only\x20fault\x20inside\x20the\x20passport\x20module\x20—\x20NOT\x20a\x20network\x20problem).\x20Identify\x20the\x20repository\x20row\x20the\x20guard\x20expects\x20(guard2file\x20/\x20analyze_guard_semantics),\x20write\x20it\x20with\x20repository\x20data_add\x20(or\x20let\x20its\x20producer\x20write\x20it),\x20then\x20retry.'},'unknown':{'error_code':'unknown','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'1.\x20Report\x20full\x20error\x20context\x20to\x20the\x20user\x202.\x20Escalate\x20to\x20human\x20intervention\x203.\x20Flag\x20for\x20error-classification\x20rule\x20addition','user_prompt':'An\x20unclassified\x20error\x20occurred.\x20Please\x20review\x20the\x20error\x20details\x20and\x20contact\x20support\x20if\x20needed.'}};const operationAttempts=new Map();function getAttemptCount(a,b){const c=operationAttempts['get'](a);if(!c)return 0x0;return c['get'](b)??0x0;}function incrementAttempt(a,b){!operationAttempts['has'](a)&&operationAttempts['set'](a,new Map());const c=operationAttempts['get'](a),d=(c['get'](b)??0x0)+0x1;return c['set'](b,d),d;}const BUDGET_EXEMPT_CODES=new Set(['guard_rejected']);function getBudgetAttempts(a){const b=operationAttempts['get'](a);if(!b)return 0x0;let c=0x0;for(const [d,e]of b){if(!BUDGET_EXEMPT_CODES['has'](d))c+=e;}return c;}export function resetAttempts(a){operationAttempts['delete'](a);}export function recover(a,b,c){const d=RECOVERY_RULES[a]??RECOVERY_RULES['unknown'],e=0x5,f=getBudgetAttempts(b),g=getAttemptCount(b,a);if(d['max_attempts']<=0x1||d['strategy']==='stop')return{'strategy':d['strategy'],'should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};if(f>=e)return{'strategy':'stop','should_retry':![],'max_attempts':e,'current_attempt':f,'detail':'Total\x20retry\x20limit\x20('+e+')\x20reached\x20for\x20operation\x20'+b+'.\x20Escalating\x20to\x20human\x20intervention.\x20Attempts\x20recorded\x20for\x20this\x20operation\x20id:\x20'+([...(operationAttempts['get'](b)??new Map())['entries']()]['map'](([j,k])=>j+':'+k)['join'](',\x20')||'none')+'.','user_prompt':'Maximum\x20retry\x20attempts\x20reached.\x20Manual\x20intervention\x20required.'};if(g>=d['max_attempts'])return{'strategy':'escalate_human','should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'detail':'Per-error-code\x20retry\x20limit\x20('+d['max_attempts']+')\x20reached\x20for\x20'+a+'.\x20Escalating\x20to\x20human.','user_prompt':'Recovery\x20attempts\x20for\x20'+a+'\x20exhausted.\x20Manual\x20intervention\x20required.'};const h=incrementAttempt(b,a),i={'strategy':d['strategy'],'should_retry':d['automation']==='full'||h<d['max_attempts'],'max_attempts':d['max_attempts'],'current_attempt':h,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};return i['should_retry']&&c?.['retryable']===![]&&a!=='guard_rejected'&&d['strategy']!=='fill_submission'&&d['strategy']!=='query_and_retry'&&(i['should_retry']=![],i['detail']+='\x20NON-RETRYABLE\x20CLASSIFICATION:\x20retrying\x20the\x20IDENTICAL\x20call\x20fails\x20identically\x20—\x20apply\x20the\x20strategy\x20above\x20to\x20fix\x20the\x20cause,\x20then\x20submit\x20a\x20FRESH\x20call.'),i;}export function getBackoffDelay(a){return Math['pow'](0x2,a-0x1)*0x3e8;}
1
+ export const RECOVERY_RULES={'insufficient_balance':{'error_code':'insufficient_balance','strategy':'claim_faucet','max_attempts':0x3,'automation':'semi','detail':'1.\x20Testnet:\x20claim\x20WOW\x20from\x20the\x20faucet\x202.\x20Mainnet:\x20transfer\x20ETH/USDT/USDC/WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge\x20(query\x20active\x20EVM\x20account\x20→\x20top\x20up\x20from\x20external\x20wallet\x20→\x20confirm\x20→\x20cross-chain)\x203.\x20Point\x20the\x20user\x20to\x20the\x20live\x20airdrop\x20page\x20(https://wowok.net/airdrop.html)\x20for\x20the\x20current\x20round\x204.\x20Retry\x20original\x20operation.\x20NOTE:\x20this\x20rule\x20is\x20for\x20the\x20SIGNING\x20ACCOUNT\x27s\x20wallet/gas\x20only\x20—\x20an\x20on-chain\x20POOL\x20shortage\x20(reward/allocation)\x20classifies\x20as\x20pool_shortage,\x20never\x20here','user_prompt':'Insufficient\x20balance\x20for\x20gas\x20or\x20operation.\x20How\x20to\x20obtain\x20WOW\x20tokens:\x20(1)\x20Testnet\x20—\x20claim\x20WOW\x20from\x20the\x20faucet\x20(https://faucet.testnet.wowok.net);\x20all\x20merchant\x20and\x20order\x20testing\x20can\x20use\x20WOW\x20as\x20the\x20payment\x20token.\x20(2)\x20Mainnet\x20—\x20transfer\x20ETH\x20/\x20USDT\x20/\x20USDC\x20/\x20WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge:\x20first\x20query\x20the\x20active\x20EVM\x20account\x20(bridge_operation\x20query_active_evm_account,\x20auto-generated\x20on\x20first\x20use),\x20then\x20transfer\x20from\x20an\x20external\x20wallet\x20(e.g.\x20MetaMask)\x20to\x20that\x20address,\x20confirm\x20the\x20balance\x20arrived,\x20and\x20cross-chain\x20to\x20WOW\x20mainnet\x20(bridge_operation\x20cross_chain_evm_to_wow).\x20(3)\x20WOW\x20airdrop:\x20current\x20round\x20status,\x20pool\x20and\x20eligibility\x20are\x20published\x20live\x20at\x20https://wowok.net/airdrop.html\x20(referral:\x20https://wowok.net/refer.html)\x20—\x20open\x20that\x20page\x20rather\x20than\x20assuming\x20a\x20round\x20is\x20live\x20or\x20closed.\x20Query\x20wowok_buildin_info\x20with\x20info=\x27funding\x20guidance\x27\x20for\x20the\x20canonical\x20funding\x20guidance.'},'pool_shortage':{'error_code':'pool_shortage','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'An\x20on-chain\x20POOL\x20cannot\x20cover\x20the\x20operation\x20(reward.move:243\x20abort\x206\x20/\x20'+'allocation.move:509\x20abort\x207)\x20—\x20a\x20pool\x20funding\x20problem,\x20NOT\x20the\x20caller\x27s\x20wallet;\x20a\x20faucet\x20claim\x20will\x20NOT\x20help\x20and\x20re-sending\x20the\x20rail\x20unchanged\x20changes\x20nothing.\x201.\x20Reward\x20pool:\x20the\x20reward\x20ISSUER\x20tops\x20it\x20up\x20with\x20reward\x20coin_add\x20(permission\x20153)\x20—\x20the\x20claim\x20key\x20slot\x20is\x20written\x20BEFORE\x20the\x20balance\x20assert\x20and\x20the\x20abort\x20rolls\x20it\x20back,\x20so\x20NOTHING\x20was\x20consumed;\x20the\x20identical\x20claim\x20succeeds\x20after\x20the\x20top-up\x20(mainnet-proven,\x20T14).\x202.\x20Allocation\x20pool:\x20the\x20payer\x20side\x20funds\x20the\x20order/allocation\x20first\x20(order\x20renew,\x20payment\x20create\x20into\x20the\x20allocation),\x20then\x20re-runs\x20the\x20rail;\x20if\x20the\x20pool\x20is\x20drained\x20because\x20the\x20rail\x20ALREADY\x20paid\x20(balance\x200,\x20once-slot\x20consumed),\x20verify\x20via\x20the\x20Payment\x20record\x20instead\x20of\x20retrying.\x203.\x20As\x20the\x20BUYER:\x20report\x20the\x20shortage\x20to\x20the\x20merchant\x20—\x20never\x20fund\x20a\x20pool\x20you\x20do\x20not\x20own','user_prompt':'The\x20on-chain\x20pool\x20backing\x20this\x20operation\x20is\x20short\x20of\x20funds.\x20The\x20pool\x27s\x20owner\x20must\x20top\x20it\x20up\x20(reward\x20coin_add\x20/\x20allocation\x20funding)\x20—\x20a\x20faucet\x20claim\x20will\x20not\x20help.\x20As\x20the\x20buyer,\x20ask\x20the\x20merchant\x20to\x20fund\x20the\x20pool.'},'stock_exhausted':{'error_code':'stock_exhausted','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Merchant-side\x20inventory\x20shortfall\x20(Move\x20service:16\x20E_STOCK_NOT_ENOUGH)\x20—\x20NOT\x20a\x20buyer\x20balance\x20problem,\x20so\x20a\x20faucet\x20claim\x20will\x20NOT\x20help.\x201.\x20Reduce\x20the\x20purchase\x20quantity\x20to\x20the\x20item\x27s\x20remaining\x20stock\x202.\x20Pick\x20another\x20sale\x20item\x203.\x20Ask\x20the\x20merchant\x20to\x20restock,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x27s\x20stock\x20is\x20exhausted\x20for\x20the\x20requested\x20quantity.\x20Reduce\x20the\x20quantity,\x20choose\x20another\x20item,\x20or\x20ask\x20the\x20merchant\x20to\x20restock.'},'sale_suspended':{'error_code':'sale_suspended','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20merchant\x20suspended\x20this\x20sale\x20item\x20(Move\x20service:34\x20E_SALE_SUSPENDED).\x201.\x20Pick\x20another\x20(non-suspended)\x20item\x202.\x20Contact\x20the\x20merchant\x20to\x20resume\x20the\x20sale,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x20is\x20suspended\x20by\x20the\x20merchant.\x20Please\x20choose\x20another\x20item\x20or\x20contact\x20the\x20merchant.'},'discount_invalid':{'error_code':'discount_invalid','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20discount\x20is\x20outside\x20its\x20[time_start,\x20time_end]\x20validity\x20window\x20(Move\x20service:35\x20E_DISCOUNT_TIME_INVALID).\x201.\x20Retry\x20without\x20the\x20discount\x202.\x20Ask\x20the\x20merchant\x20for\x20a\x20fresh\x20discount,\x20then\x20retry','user_prompt':'The\x20discount\x20is\x20not\x20valid\x20at\x20the\x20current\x20time\x20(outside\x20its\x20validity\x20window).\x20Buy\x20without\x20the\x20discount\x20or\x20ask\x20the\x20merchant\x20for\x20a\x20new\x20one.'},'rate_limit':{'error_code':'rate_limit','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Rate\x20limit\x20hit\x20(HTTP\x20429).\x20Exponential\x20backoff\x20retry:\x202s\x20/\x204s\x20/\x208s\x20/\x2016s\x20/\x2032s.\x20Avoid\x20parallel\x20calls\x20while\x20the\x20limit\x20window\x20is\x20active.'},'gas_exceeded':{'error_code':'gas_exceeded','strategy':'adjust_params','max_attempts':0x3,'automation':'semi','detail':'Gas\x20budget\x20exceeded.\x201.\x20Increase\x20the\x20gas_budget\x20parameter\x202.\x20Reduce\x20the\x20operation\x20size\x20(fewer\x20objects\x20per\x20transaction)\x203.\x20Retry\x20the\x20original\x20operation','user_prompt':'Gas\x20budget\x20exceeded.\x20Increase\x20the\x20gas\x20budget\x20or\x20reduce\x20the\x20operation\x20size,\x20then\x20retry.'},'insufficient_gas':{'error_code':'insufficient_gas','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Gas\x20exhausted\x20—\x20the\x20transaction\x20failed\x20deterministically\x20and\x20did\x20NOT\x20commit\x20on-chain\x20(no\x20state\x20changed;\x20commit-state\x20verification\x20is\x20NOT\x20needed).\x201.\x20Raise\x20the\x20gas_budget\x20parameter\x20above\x20the\x20failed\x20transaction\x27s\x20gas_used\x202.\x20If\x20the\x20account\x20balance\x20cannot\x20cover\x20any\x20budget,\x20fund\x20the\x20signing\x20account\x20with\x20gas\x20tokens\x20first\x203.\x20Resubmit\x20as\x20a\x20FRESH\x20call\x20—\x20do\x20NOT\x20replay\x20the\x20same\x20transaction','user_prompt':'The\x20transaction\x20ran\x20out\x20of\x20gas\x20and\x20did\x20not\x20commit\x20on-chain.\x20Increase\x20the\x20gas\x20budget\x20(or\x20fund\x20the\x20account\x20with\x20gas)\x20and\x20submit\x20a\x20fresh\x20transaction\x20—\x20retrying\x20unchanged\x20will\x20fail\x20the\x20same\x20way.'},'bcs_error':{'error_code':'bcs_error','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'BCS\x20serialization/deserialization\x20error\x20—\x20a\x20parameter\x20does\x20not\x20match\x20the\x20expected\x20type/structure.\x201.\x20Query\x20the\x20operation\x20schema\x20(schema_query)\x202.\x20Fix\x20the\x20offending\x20parameter\x20type\x20(e.g.\x20BigInt\x20vs\x20number,\x20vector\x20element\x20type)\x203.\x20Retry','user_prompt':'A\x20parameter\x20failed\x20serialization.\x20Check\x20the\x20parameter\x20types\x20against\x20the\x20schema\x20and\x20retry.'},'signature_error':{'error_code':'signature_error','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'Signature\x20verification\x20failed.\x201.\x20Verify\x20the\x20account\x20is\x20not\x20suspended\x202.\x20Check\x20the\x20network\x20matches\x20the\x20account\x27s\x203.\x20Switch\x20to\x20a\x20healthy\x20account\x20and\x20retry','user_prompt':'Signature\x20verification\x20failed.\x20The\x20account\x20may\x20be\x20suspended\x20or\x20misconfigured.\x20Switch\x20accounts\x20or\x20check\x20the\x20configuration\x20and\x20retry.'},'config_error':{'error_code':'config_error','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'Local\x20configuration\x20error\x20(network\x20not\x20specified,\x20persistent\x20storage\x20not\x20set).\x201.\x20Show\x20the\x20user\x20which\x20configuration\x20is\x20missing\x202.\x20Guide\x20the\x20user\x20through\x20the\x20account_operation/config\x20setup\x203.\x20Retry\x20after\x20the\x20user\x20fixes\x20it','user_prompt':'Local\x20configuration\x20is\x20incomplete.\x20Please\x20finish\x20the\x20account/network\x20setup\x20and\x20retry.'},'wip_verification_failed':{'error_code':'wip_verification_failed','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'WIP\x20file\x20not\x20publicly\x20reachable\x20/\x20hash\x20mismatch.\x201.\x20Upload\x20via\x20the\x20wip\x20storage\x20service\x20(wip_file\x20type=\x27upload\x27\x20—\x20official\x20free\x20store\x20or\x20storage=\x27custom\x27)\x202.\x20Or\x20deploy\x20to\x20a\x20public\x20URL\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20own\x20site)\x203.\x20Update\x20the\x20sale\x27s\x20wip\x20URL\x204.\x20Re-run\x20the\x20operation','user_prompt':'The\x20WIP\x20file\x20could\x20not\x20be\x20verified\x20from\x20a\x20public\x20URL.\x20Upload\x20it\x20with\x20wip_file\x20type=\x27upload\x27\x20(official\x20free\x20store\x20or\x20your\x20own\x20service)\x20or\x20deploy\x20it\x20(GitHub\x20Pages\x20/\x20IPFS),\x20update\x20the\x20sale\x27s\x20WIP\x20URL,\x20and\x20retry.'},'wip_storage_unavailable':{'error_code':'wip_storage_unavailable','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'Transient\x20wip\x20storage\x20transport\x20failure.\x201.\x20Retry\x20the\x20same\x20request\x20with\x20bounded\x20backoff\x202.\x20Large\x20WIP\x20files\x20are\x20network-sensitive:\x20compress\x20images\x20before\x20generate\x20(each\x20image\x20<=\x202MB,\x20total\x20<=\x2010MB)\x203.\x20Check\x20connectivity\x20to\x20the\x20storage\x20base\x20URL\x20if\x20retries\x20keep\x20failing','user_prompt':'The\x20wip\x20storage\x20request\x20failed\x20due\x20to\x20a\x20network\x20problem.\x20Retry\x20the\x20upload;\x20if\x20it\x20keeps\x20failing,\x20reduce\x20the\x20file\x20size\x20or\x20check\x20connectivity.'},'wip_storage_rejected':{'error_code':'wip_storage_rejected','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'WIP\x20storage\x20service\x20rejected\x20the\x20request\x20(HTTP\x204xx\x20—\x20deterministic\x20client-side\x20fault,\x20retrying\x20unchanged\x20fails\x20identically).\x20400:\x20malformed\x20body\x20or\x20failed\x20WIP\x20validation\x20—\x20re-generate\x20via\x20wip_file\x20type=\x27generate\x27\x20401:\x20re-sign\x20with\x20a\x20fresh\x20nonce\x20inside\x20the\x20timestamp\x20window\x20403:\x20check\x20storage\x20service\x20configuration\x20404:\x20file\x20does\x20not\x20exist\x20—\x20re-upload\x20409:\x20quota\x20—\x20delete\x20old\x20files\x20via\x20wip_file\x20type=\x27list\x27\x20then\x20delete\x20413:\x20compress\x20images\x20(each\x20<=\x202MB,\x20total\x20<=\x2010MB)\x20and\x20regenerate','user_prompt':'The\x20WIP\x20storage\x20service\x20rejected\x20the\x20request\x20(HTTP\x204xx).\x20Fix\x20the\x20specific\x20fault\x20(re-generate/re-sign/re-upload\x20per\x20the\x20status\x20code)\x20and\x20retry\x20—\x20do\x20not\x20retry\x20unchanged.'},'network_error':{'error_code':'network_error','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Transport\x20failure\x20(timeout\x20/\x20connection\x20reset\x20/\x20RPC\x20unreachable\x20/\x20HTTP\x205xx\x20gateway\x20error).\x20Exponential\x20backoff\x20retry:\x201s\x20/\x202s\x20/\x204s\x20/\x208s\x20/\x2016s.\x20Switch\x20RPC\x20node\x20if\x20available.\x20READS:\x20a\x20plain\x20retry\x20is\x20safe.\x20FUND-MOVING\x20WRITES:\x20before\x20any\x20resubmission,\x20verify\x20whether\x20the\x20previous\x20attempt\x20landed\x20(query\x20the\x20reported\x20digest\x20directly,\x20or\x20the\x20expected\x20object\x20via\x20the\x20sender\x27s\x20recent\x20on-chain\x20objects\x20/\x20onchain_events)\x20—\x20if\x20it\x20landed,\x20ADOPT\x20it\x20and\x20stop;\x20a\x20blind\x20backoff\x20retry\x20of\x20a\x20landed\x20write\x20moves\x20the\x20funds\x20a\x20second\x20time.'},'submission_unknown':{'error_code':'submission_unknown','strategy':'query_and_retry','max_attempts':0x2,'automation':'semi','detail':'Transport-level\x20failure\x20after\x20the\x20request\x20left\x20the\x20client\x20—\x20the\x20submission\x20state\x20is\x20UNKNOWN\x20and\x20the\x20transaction\x20may\x20already\x20be\x20committed.\x20NEVER\x20auto-retry\x20a\x20write\x20here.\x201.\x20Verify\x20commit\x20state\x20on-chain:\x20query_toolkit\x20for\x20the\x20object\x20this\x20call\x20would\x20create/modify\x20(resolve\x20the\x20reference\x20from\x20the\x20call\x27s\x20own\x20arguments),\x20or\x20onchain_events\x20for\x20the\x20sender\x27s\x20recent\x20transactions.\x202.\x20If\x20the\x20expected\x20object\x20EXISTS,\x20adopt\x20it\x20and\x20continue\x20the\x20workflow\x20(the\x20operation\x20succeeded\x20despite\x20the\x20transport\x20error).\x203.\x20If\x20confirmed\x20ABSENT,\x20resubmit\x20the\x20SAME\x20call\x20once\x20—\x20for\x20a\x20FIRST-EVER\x20transaction\x20on\x20a\x20fresh\x20account\x20make\x20that\x20resubmission\x20with\x20env.no_auto_register=true\x20and\x20SAY\x20SO\x20(the\x20SDK\x20silently\x20appends\x20an\x20entity\x20registration\x20to\x20a\x20first\x20business\x20call;\x20if\x20that\x20appended\x20leg\x20was\x20the\x20failing\x20leg\x20the\x20skip\x20lets\x20the\x20call\x20through\x20—\x20ziroom-mn-261013\x20live\x20case;\x20if\x20the\x20resubmission\x20aborts,\x20the\x20envelope\x20now\x20names\x20the\x20abort\x20—\x20re-enable\x20auto\x20registration\x20and\x20retry).\x204.\x20If\x20the\x20reported\x20digest\x20does\x20not\x20resolve\x20or\x20the\x20failure\x20repeats,\x20STOP\x20looping\x20on\x20digest\x20checks\x20and\x20re-run\x20the\x20SAME\x20call\x20with\x20env.dry_run=true\x20—\x20the\x20simulation\x20surfaces\x20the\x20real\x20failure\x20(exact\x20Move\x20abort)\x20without\x20gas\x20or\x20duplicate\x20risk.\x205.\x20Reads\x20are\x20idempotent\x20—\x20retry\x20immediately.\x206.\x20M-K2\x20replay\x20discipline:\x20a\x20FAILED\x20receipt\x20is\x20final\x20—\x20its\x20digest\x20is\x20consumed\x20and\x20replaying\x20the\x20same\x20bytes\x20returns\x20the\x20same\x20failure\x20forever;\x20fix\x20the\x20cause\x20(usually\x20funding)\x20and\x20build\x20a\x20FRESH\x20transaction.\x20Live\x20mainnet\x20incident\x20behind\x20this\x20rule:\x20an\x20order_new\x20-32603\x20\x27did\x20not\x20complete\x27\x20had\x20committed;\x20the\x20blind\x20retry\x20created\x20a\x20second\x20order\x20with\x20a\x20second\x20full\x20escrow\x20and\x20a\x20second\x20stock\x20decrement','user_prompt':'The\x20request\x20failed\x20at\x20transport\x20level\x20but\x20may\x20have\x20already\x20been\x20committed\x20on-chain.\x20Verify\x20whether\x20the\x20expected\x20object\x20exists\x20(query\x20it)\x20before\x20any\x20retry\x20—\x20a\x20blind\x20retry\x20can\x20duplicate\x20the\x20operation\x20(double\x20escrow).\x20For\x20read\x20operations,\x20a\x20plain\x20retry\x20is\x20safe.'},'transaction_expired':{'error_code':'transaction_expired','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'The\x20transaction\x20expired\x20before\x20execution\x20(epoch\x20boundary\x20or\x20validator/gateway\x20outage)\x20—\x20it\x20did\x20NOT\x20land\x20and\x20nothing\x20was\x20committed.\x20Bounded\x20backoff\x20retry:\x2010s\x20/\x2030s\x20/\x2060s,\x20resubmit\x20the\x20SAME\x20call\x20unchanged.\x20If\x20a\x20dry_run\x20passes\x20while\x20the\x20real\x20call\x20keeps\x20failing,\x20the\x20fault\x20is\x20chain-side\x20—\x20wait\x20it\x20out.\x20Verify\x20with\x20onchain_events\x20if\x20unsure.'},'guard_rejected':{'error_code':'guard_rejected','strategy':'fill_submission','max_attempts':0x2,'automation':'semi','detail':'1.\x20Parse\x20Guard\x20table\x20structure\x202.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20them\x20and\x20resubmit\x20with\x20call_with_submission\x203.\x20If\x20it\x20defines\x20none,\x20the\x20rule\x20evaluated\x20false\x20—\x20typical\x20causes:\x20a\x20TIME\x20WINDOW\x20(Clock\x20deadline/opening\x20comparison\x20—\x20this\x20call\x20may\x20sit\x20outside\x20the\x20window,\x20and\x20a\x20mis-oriented\x20comparison\x20inverts\x20it:\x20everything\x20inside\x20rejected,\x20everything\x20after\x20admitted)\x20or\x20an\x20IDENTITY\x20condition\x20(signer/state\x20checks\x20—\x20the\x20caller\x20may\x20not\x20be\x20the\x20address\x20the\x20rule\x20expects);\x20adjust\x20the\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20(docs#40)\x204.\x20When\x20the\x20failure\x20is\x20passport\x20E_VERIFY_FAILED\x20and\x20a\x20submission\x20was\x20supplied,\x20the\x20response\x20appends\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line\x20naming\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20fix\x20that\x20guard\x20first\x205.\x20A\x20TIME-window\x20rejection\x20may\x20simply\x20be\x20EARLY:\x20re-run\x20the\x20SAME\x20call\x20with\x20env.dry_run=true\x20to\x20probe\x20the\x20window\x20for\x20free\x20(guard\x20rejections\x20do\x20NOT\x20consume\x20the\x20total\x20retry\x20budget;\x20only\x20the\x20per-code\x20cap\x20of\x202\x20applies)','user_prompt':'Guard\x20verification\x20rejected.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20in\x20the\x20required\x20submission\x20data\x20and\x20resubmit;\x20if\x20it\x20defines\x20none,\x20the\x20Guard\x20rule\x20evaluated\x20false\x20—\x20the\x20usual\x20causes\x20are\x20a\x20time\x20window\x20(this\x20call\x20may\x20be\x20outside\x20the\x20Clock\x20deadline/opening\x20window)\x20or\x20an\x20identity\x20condition\x20(the\x20caller\x20is\x20not\x20the\x20address\x20the\x20rule\x20expects);\x20adjust\x20this\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20rule.\x20When\x20the\x20response\x20includes\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line,\x20it\x20names\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20address\x20that\x20guard\x20first.\x20A\x20time-window\x20rejection\x20may\x20simply\x20be\x20early:\x20probe\x20the\x20window\x20with\x20env.dry_run=true\x20(free\x20—\x20guard\x20rejections\x20do\x20not\x20consume\x20the\x20total\x20retry\x20budget).'},'time_lock_not_elapsed':{'error_code':'time_lock_not_elapsed','strategy':'wait_and_retry','max_attempts':0x1,'automation':'semi','detail':'1.\x20Verify\x20Service\x20is\x20paused\x20(bPaused=true).\x20If\x20not,\x20submit\x20pause=true\x20first.\x202.\x20Wait\x20until\x20paused_time\x20+\x20setting_lock_duration\x20<=\x20current\x20clock.\x203.\x20Retry\x20the\x20original\x20operation.\x20Do\x20NOT\x20recreate\x20the\x20object.','user_prompt':'Service\x20setting_lock_duration\x20has\x20not\x20elapsed\x20since\x20the\x20Service\x20was\x20paused.\x20Please\x20pause\x20the\x20Service\x20if\x20it\x20is\x20not\x20already\x20paused,\x20wait\x20for\x20the\x20lock\x20duration\x20to\x20elapse,\x20then\x20retry.'},'immutable_violation':{'error_code':'immutable_violation','strategy':'recreate','max_attempts':0x1,'automation':'semi','detail':'1.\x20Stop\x20modification\x20attempt\x202.\x20Evaluate\x20creating\x20a\x20new\x20object\x20as\x20replacement\x203.\x20Re-plan\x20affected\x20phases','user_prompt':'Cannot\x20modify\x20an\x20immutable\x20object.\x20A\x20new\x20object\x20must\x20be\x20created\x20as\x20a\x20replacement.\x20Confirm\x20to\x20proceed\x20with\x20recreation.'},'permission_denied':{'error_code':'permission_denied','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20object\x27s\x20permission_guard\x202.\x20List\x20accounts\x20with\x20permission\x203.\x20Switch\x20account\x20or\x20prompt\x20user\x20to\x20add\x20permission','user_prompt':'Current\x20account\x20lacks\x20permission\x20for\x20this\x20operation.\x20Switch\x20to\x20an\x20authorized\x20account\x20or\x20update\x20the\x20Permission\x20object.'},'object_not_found':{'error_code':'object_not_found','strategy':'query_and_retry','max_attempts':0x3,'automation':'semi','detail':'1.\x20Verify\x20the\x20referenced\x20name/ID\x20spelling\x20(local_mark_list)\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network\x202.\x20If\x20recently\x20created,\x20re-query\x20the\x20object\x20(may\x20be\x20sync\x20delay)\x203.\x20If\x20truly\x20absent,\x20search\x20for\x20similar\x20objects\x204.\x20Prompt\x20user\x20to\x20reselect','user_prompt':'Referenced\x20object\x20not\x20found.\x20First\x20verify\x20the\x20name/ID\x20spelling\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network;\x20if\x20it\x20was\x20created\x20recently,\x20this\x20may\x20be\x20a\x20synchronization\x20delay\x20—\x20retry.\x20If\x20the\x20issue\x20persists,\x20please\x20select\x20a\x20valid\x20object.'},'state_conflict':{'error_code':'state_conflict','strategy':'adjust_params','max_attempts':0x2,'automation':'full','detail':'1.\x20Query\x20object\x27s\x20current\x20true\x20state\x202.\x20Update\x20ODG\x20status\x20annotations\x203.\x20Adjust\x20subsequent\x20operations\x20(e.g.,\x20skip\x20completed\x20steps)'},'invalid_parameter':{'error_code':'invalid_parameter','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20the\x20relevant\x20schema\x202.\x20Auto-fix\x20obvious\x20errors\x20(e.g.,\x20BigInt\x20vs\x20string)\x203.\x20If\x20unfixable,\x20prompt\x20user','user_prompt':'Parameter\x20validation\x20failed.\x20Please\x20check\x20the\x20parameter\x20types\x20and\x20values\x20against\x20the\x20schema\x20and\x20retry.'},'move_abort_unmapped':{'error_code':'move_abort_unmapped','strategy':'stop','max_attempts':0x1,'automation':'manual','detail':'The\x20chain\x27s\x20business\x20logic\x20aborted\x20and\x20the\x20(module,\x20abort\x20code)\x20pair\x20has\x20no\x20local\x20mapping.\x20Read\x20the\x20module\x20and\x20abort\x20code\x20from\x20move_abort_info\x20/\x20the\x20message\x20(rendered\x20as\x20\x27abort\x20(N)\x27),\x20resolve\x20their\x20meaning\x20from\x20the\x20module\x27s\x20documentation\x20or\x20the\x20wowok-tools\x20Skill,\x20fix\x20the\x20business\x20cause,\x20and\x20issue\x20a\x20NEW\x20call.\x20Do\x20NOT\x20restart\x20the\x20server\x20and\x20do\x20NOT\x20retry\x20the\x20identical\x20call\x20—\x20it\x20aborts\x20deterministically.','user_prompt':'The\x20operation\x20was\x20rejected\x20by\x20the\x20chain\x27s\x20business\x20logic\x20and\x20its\x20abort\x20code\x20is\x20not\x20mapped\x20locally.\x20The\x20module\x20name\x20and\x20abort\x20code\x20in\x20the\x20error\x20are\x20authoritative\x20—\x20review\x20them\x20(and\x20the\x20object\x20state\x20via\x20query_toolkit)\x20before\x20adjusting\x20anything.'},'missing_data':{'error_code':'missing_data','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'A\x20guard\x20rule\x20read\x20a\x20keyed\x20table\x20row\x20that\x20does\x20NOT\x20exist\x20(repository.data\x20/\x20oracle\x20entry)\x20and\x20the\x20verifier\x20surfaced\x20it\x20as\x20a\x20location-only\x20fault\x20inside\x20the\x20passport\x20module\x20—\x20no\x20abort\x20code,\x20because\x20the\x20framework\x20cannot\x20express\x20\x27row\x20absent\x27\x20as\x20an\x20abort.\x20This\x20is\x20a\x20DATA\x20problem:\x201.\x20Identify\x20the\x20repository\x20and\x20key\x20the\x20guard\x20rule\x20reads\x20(guard2file\x20/\x20analyze_guard_semantics\x20on\x20the\x20guard\x20source)\x202.\x20Have\x20the\x20row\x27s\x20producer\x20write\x20it\x20(e.g.\x20an\x20oracle\x20timestamp\x20like\x20checkin_ts),\x20or\x20add\x20it\x20with\x20repository\x20data_add\x20(data_add.name\x20must\x20match\x20a\x20policy\x20rule\x20name)\x203.\x20Retry\x20the\x20SAME\x20call\x20unchanged\x20—\x20a\x20dry_run\x20that\x20turns\x20clean\x20after\x20the\x20row\x20exists\x20confirms\x20the\x20diagnosis','user_prompt':'A\x20guard\x20rule\x20references\x20a\x20data\x20row\x20that\x20has\x20not\x20been\x20written\x20yet\x20(location-only\x20fault\x20inside\x20the\x20passport\x20module\x20—\x20NOT\x20a\x20network\x20problem).\x20Identify\x20the\x20repository\x20row\x20the\x20guard\x20expects\x20(guard2file\x20/\x20analyze_guard_semantics),\x20write\x20it\x20with\x20repository\x20data_add\x20(or\x20let\x20its\x20producer\x20write\x20it),\x20then\x20retry.'},'state_not_visible':{'error_code':'state_not_visible','strategy':'wait_and_retry','max_attempts':0x3,'automation':'full','detail':'The\x20state\x20this\x20call\x20needs\x20was\x20JUST\x20written\x20and\x20is\x20not\x20yet\x20visible\x20to\x20reads\x20(write-to-visibility\x20window),\x20or\x20it\x20does\x20not\x20exist\x20at\x20all.\x201.\x20If\x20a\x20write\x20on\x20this\x20order/machine\x20committed\x20within\x20the\x20last\x20few\x20seconds,\x20wait\x20500ms\x20(doubling\x20each\x20attempt)\x20and\x20replay\x20the\x20SAME\x20call\x20UNCHANGED\x20—\x20NEVER\x20edit\x20parameters\x20to\x20\x27fix\x27\x20a\x20visibility\x20window;\x20an\x20aborted\x20call\x20never\x20landed,\x20so\x20the\x20replay\x20cannot\x20double-spend.\x202.\x20If\x20the\x20fault\x20persists\x20past\x20~3\x20attempts\x20(or\x20nothing\x20was\x20just\x20written),\x20the\x20state\x20is\x20deterministically\x20ABSENT\x20—\x20stop\x20retrying:\x20for\x20a\x20forward-info\x20miss\x20query\x20the\x20Machine\x27s\x20node\x20table\x20(onchain_table_data\x20onchain_table_item_machine_node)\x20and\x20use\x20an\x20existing\x20node/next_node/forward\x20triple;\x20for\x20a\x20guard-read\x20repository\x20row\x20follow\x20the\x20missing_data\x20path\x20(write\x20the\x20row).','user_prompt':'A\x20just-committed\x20write\x20is\x20not\x20visible\x20to\x20this\x20read\x20yet.\x20The\x20same\x20call\x20will\x20be\x20replayed\x20after\x20a\x20short\x20wait\x20—\x20no\x20parameter\x20change\x20is\x20needed.\x20If\x20it\x20keeps\x20failing,\x20the\x20required\x20state\x20is\x20genuinely\x20missing\x20and\x20must\x20be\x20created\x20first.'},'unknown':{'error_code':'unknown','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'1.\x20Report\x20full\x20error\x20context\x20to\x20the\x20user\x202.\x20Escalate\x20to\x20human\x20intervention\x203.\x20Flag\x20for\x20error-classification\x20rule\x20addition','user_prompt':'An\x20unclassified\x20error\x20occurred.\x20Please\x20review\x20the\x20error\x20details\x20and\x20contact\x20support\x20if\x20needed.'}};const operationAttempts=new Map();function getAttemptCount(a,b){const c=operationAttempts['get'](a);if(!c)return 0x0;return c['get'](b)??0x0;}function incrementAttempt(a,b){!operationAttempts['has'](a)&&operationAttempts['set'](a,new Map());const c=operationAttempts['get'](a),d=(c['get'](b)??0x0)+0x1;return c['set'](b,d),d;}const BUDGET_EXEMPT_CODES=new Set(['guard_rejected']);function getBudgetAttempts(a){const b=operationAttempts['get'](a);if(!b)return 0x0;let c=0x0;for(const [d,e]of b){if(!BUDGET_EXEMPT_CODES['has'](d))c+=e;}return c;}export function resetAttempts(a){operationAttempts['delete'](a);}export function recover(a,b,c){const d=RECOVERY_RULES[a]??RECOVERY_RULES['unknown'],e=0x5,f=getBudgetAttempts(b),g=getAttemptCount(b,a);if(d['max_attempts']<=0x1||d['strategy']==='stop')return{'strategy':d['strategy'],'should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};if(f>=e)return{'strategy':'stop','should_retry':![],'max_attempts':e,'current_attempt':f,'detail':'Total\x20retry\x20limit\x20('+e+')\x20reached\x20for\x20operation\x20'+b+'.\x20Escalating\x20to\x20human\x20intervention.\x20Attempts\x20recorded\x20for\x20this\x20operation\x20id:\x20'+([...(operationAttempts['get'](b)??new Map())['entries']()]['map'](([j,k])=>j+':'+k)['join'](',\x20')||'none')+'.','user_prompt':'Maximum\x20retry\x20attempts\x20reached.\x20Manual\x20intervention\x20required.'};if(g>=d['max_attempts'])return{'strategy':'escalate_human','should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'detail':'Per-error-code\x20retry\x20limit\x20('+d['max_attempts']+')\x20reached\x20for\x20'+a+'.\x20Escalating\x20to\x20human.','user_prompt':'Recovery\x20attempts\x20for\x20'+a+'\x20exhausted.\x20Manual\x20intervention\x20required.'};const h=incrementAttempt(b,a),i={'strategy':d['strategy'],'should_retry':d['automation']==='full'||h<d['max_attempts'],'max_attempts':d['max_attempts'],'current_attempt':h,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};return i['should_retry']&&c?.['retryable']===![]&&a!=='guard_rejected'&&d['strategy']!=='fill_submission'&&d['strategy']!=='query_and_retry'&&(i['should_retry']=![],i['detail']+='\x20NON-RETRYABLE\x20CLASSIFICATION:\x20retrying\x20the\x20IDENTICAL\x20call\x20fails\x20identically\x20—\x20apply\x20the\x20strategy\x20above\x20to\x20fix\x20the\x20cause,\x20then\x20submit\x20a\x20FRESH\x20call.'),i;}export function getBackoffDelay(a){return Math['pow'](0x2,a-0x1)*0x3e8;}
@@ -45,7 +45,7 @@ export interface ArchetypeTemplate {
45
45
  affiliate_mode?: "none" | "commission";
46
46
  crowdfunding_mode?: "none" | "threshold" | "flexible";
47
47
  }
48
- export declare const BUILTIN_TEMPLATES_VERSION = 102;
48
+ export declare const BUILTIN_TEMPLATES_VERSION = 105;
49
49
  export declare const BUILTIN_TEMPLATES: ArchetypeTemplate[];
50
50
  export declare const TEMPLATE_KEYWORDS: Record<string, string[]>;
51
51
  export declare const TEMPLATE_TAGS: Record<string, string[]>;