@wowok/agent-mcp 3.3.8 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +3 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +6 -0
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/materialize.d.ts +4 -0
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/param-disclosure.d.ts +61 -0
- package/dist/composition/param-disclosure.js +1 -0
- package/dist/composition/plan.d.ts +11 -1
- package/dist/composition/plan.js +1 -1
- package/dist/customer/account-events.js +1 -1
- package/dist/data/api/api.spec.js +1 -1
- package/dist/data/api/cli.js +1 -1
- package/dist/data/api/server.d.ts +1 -0
- package/dist/data/api/server.js +1 -1
- package/dist/data/projection/store.d.ts +2 -1
- package/dist/data/projection/store.js +1 -1
- package/dist/data/projection/types.d.ts +10 -0
- package/dist/data/sync/cdc.js +1 -1
- package/dist/data/sync/cdc.spec.js +1 -1
- package/dist/data/sync/store.d.ts +5 -0
- package/dist/data/sync/store.js +1 -1
- package/dist/data/sync/types.d.ts +2 -0
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/guard-scan.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +1 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-risk.d.ts +1 -0
- package/dist/knowledge/arbitration-risk.js +1 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/allocation.json +6 -6
- package/dist/knowledge/baselines/rules/arb.json +2 -2
- package/dist/knowledge/baselines/rules/guard.json +11 -11
- package/dist/knowledge/baselines/rules/order.json +1 -1
- package/dist/knowledge/baselines/rules/plan.json +1 -1
- package/dist/knowledge/baselines/semantic-facts.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +14 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/catalog-facts.d.ts +4 -0
- package/dist/knowledge/catalog-facts.js +1 -0
- package/dist/knowledge/commission-landing.js +1 -1
- package/dist/knowledge/component-schema.d.ts +64 -0
- package/dist/knowledge/component-schema.js +1 -0
- package/dist/knowledge/entity-recipient-guard.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fee-param-bindings.d.ts +26 -0
- package/dist/knowledge/fee-param-bindings.js +1 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.d.ts +2 -2
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-anchor-reach.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.d.ts +14 -3
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.d.ts +5 -0
- package/dist/knowledge/knob-docs.js +1 -0
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/onchain-constants.d.ts +2 -0
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/param-schema.d.ts +70 -0
- package/dist/knowledge/param-schema.js +1 -0
- package/dist/knowledge/param-tiers.d.ts +25 -0
- package/dist/knowledge/param-tiers.js +1 -0
- package/dist/knowledge/passport-ledger.d.ts +1 -1
- package/dist/knowledge/passport-ledger.js +1 -1
- package/dist/knowledge/pattern-resolutions.d.ts +106 -0
- package/dist/knowledge/pattern-resolutions.js +1 -0
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +1 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/service-allocation-semantics.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/strategy-manuals.d.ts +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +101 -1
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-nav.d.ts +7 -0
- package/dist/knowledge/template-nav.js +1 -0
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +33 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-test-profiles.d.ts +17 -0
- package/dist/knowledge/template-test-profiles.js +1 -0
- package/dist/knowledge/template-validation.d.ts +1 -0
- package/dist/knowledge/template-validation.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/treasury-templates.js +1 -1
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/time-window.d.ts +37 -0
- package/dist/participation/time-window.js +1 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.d.ts +1 -0
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +4 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.d.ts +1 -0
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.d.ts +1 -0
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/relationship/registry.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/runtime/instance-registry.d.ts +7 -1
- package/dist/runtime/instance-registry.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +2 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +8 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +2 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +3 -3
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +8 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/planning.d.ts +1 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +29 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/local/index.d.ts +20 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +2 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +1 -1
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +106 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +5 -5
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/watch/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +4 -2
- package/dist/schemas/benchmark_migration_operation.output.json +3 -3
- package/dist/schemas/benchmark_migration_operation.schema.json +16 -2
- package/dist/schemas/bridge_operation.output.json +4 -2
- package/dist/schemas/bridge_operation.schema.json +5 -5
- package/dist/schemas/evaluation_operation.output.json +16 -0
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +150 -1
- package/dist/schemas/industry_pack_operation.schema.json +9 -3
- package/dist/schemas/keeper_operation.output.json +2 -2
- package/dist/schemas/local_cache_operation.output.json +4 -2
- package/dist/schemas/local_history_operation.output.json +4 -2
- package/dist/schemas/local_info_operation.output.json +4 -2
- package/dist/schemas/local_mark_operation.output.json +4 -2
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.output.json +13 -2
- package/dist/schemas/messenger_operation.schema.json +41 -34
- package/dist/schemas/monitor_events.output.json +2 -2
- package/dist/schemas/monitor_subscription.output.json +2 -2
- package/dist/schemas/onchain_events.output.json +14 -14
- package/dist/schemas/onchain_operations.output.json +13 -10
- package/dist/schemas/onchain_operations.schema.json +124 -99
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +7 -6
- package/dist/schemas/onchain_operations_contact.schema.json +4 -3
- package/dist/schemas/onchain_operations_demand.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +7 -6
- package/dist/schemas/onchain_operations_machine.schema.json +9 -7
- package/dist/schemas/onchain_operations_order.schema.json +6 -4
- package/dist/schemas/onchain_operations_payment.schema.json +2 -2
- package/dist/schemas/onchain_operations_permission.schema.json +19 -15
- package/dist/schemas/onchain_operations_personal.schema.json +17 -14
- package/dist/schemas/onchain_operations_progress.schema.json +6 -4
- package/dist/schemas/onchain_operations_proof.schema.json +4 -3
- package/dist/schemas/onchain_operations_repository.schema.json +9 -7
- package/dist/schemas/onchain_operations_reward.schema.json +5 -4
- package/dist/schemas/onchain_operations_service.schema.json +15 -12
- package/dist/schemas/onchain_operations_treasury.schema.json +4 -3
- package/dist/schemas/onchain_table_data.output.json +18 -13
- package/dist/schemas/onchain_table_data.schema.json +13 -13
- package/dist/schemas/query_toolkit.output.json +301 -33
- package/dist/schemas/query_toolkit.schema.json +6 -6
- package/dist/schemas/watch_operation.output.json +3 -3
- package/dist/schemas/workflow_operation.schema.json +3 -2
- package/dist/schemas/wowok_buildin_info.schema.json +1 -1
- package/dist/task/playbook.js +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +1 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/evaluation.spec.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +4 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/sanitize-output.js +1 -1
- package/dist/tools/sanitize-output.spec.js +1 -1
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/upgrade-check.d.ts +22 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wrap.d.ts +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +7 -6
|
@@ -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 a13a,afterSalesRailNodeMatches}from'../knowledge/template-scanner.js';import{refsOf}from'./plan.js';import{numericAmount}from'../knowledge/audit-rules.js';const P=a=>a;function lowestSalePrice(a){if(!Array['isArray'](a))return undefined;let b;for(const c of a){const d=numericAmount(c?.['price']);if(d!==undefined&&d>0x0)b=b===undefined?d:Math['min'](b,d);}return b;}function toByteVector(a){if(Array['isArray'](a))return a['every'](c=>typeof c==='number'&&Number['isInteger'](c)&&c>=0x0&&c<=0xff)?a:undefined;if(typeof a==='string'&&a['length']>0x0)return Array['from'](new TextEncoder()['encode'](a));return undefined;}function offTaskSlotIdentityLegs(a){const b=new Set(['order.owner','order.agent\x20has']),c=new Set(['query_order_named_operator_member']),d=new Set(),e=[],f=g=>{if(g===null||typeof g!=='object')return;const h=g;if(h['type']==='logic_equal'&&Array['isArray'](h['nodes'])){const l=h['nodes']['filter'](m=>m!==null&&typeof m==='object'&&m['type']==='identifier'&&typeof m['identifier']==='number');if(l['some'](m=>m['identifier']===TASK_BINDING_SLOT)){for(const m of l)d['add'](m['identifier']);}}const i=h['object'],j=typeof h['query']==='string'&&b['has'](h['query'])||typeof h['type']==='string'&&c['has'](h['type']);if(j&&i!==null&&typeof i==='object'&&typeof i['identifier']==='number'){const o=i['identifier'],p=typeof h['query']==='string'?h['query']:h['type'];if(o!==TASK_BINDING_SLOT)e['push']({'query':p,'identifier':o});}if(Array['isArray'](h['nodes'])){for(const q of h['nodes'])f(q);}if(h['node']!==undefined&&typeof h['node']==='object')f(h['node']);};return f(a),e['filter'](g=>!d['has'](g['identifier']));}export function normalizeInlineGuardTable(a,b){const c=b+'_service',d=f=>f['replace'](/\//g,'_'),e=d(c);return a['map'](f=>{if(f===null||typeof f!=='object'||Array['isArray'](f))return f;const g={...f};typeof g['value']==='string'&&d(g['value'])===e&&(g['value']=ref('service'));if(g['b_submission']===undefined)g['b_submission']=![];return g;});}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 at of a['conditional_guards']??[]){const au=b[at['param']]??a['fee_params'][at['param']];if(au!==at['emit_value'])l['add'](at['guard_key']);}const q=new Map();for(const av of a['conditional_guards']??[]){q['set'](av['param'],(q['get'](av['param'])??0x0)+0x1);}const t=new Set((a['conditional_guards']??[])['filter'](aw=>(q['get'](aw['param'])??0x0)>0x1)['map'](aw=>aw['guard_key'])),u=new Set([...l]['filter'](aw=>t['has'](aw))),v=u['size']>0x0?a['machine_shape']['map'](aw=>({...aw,'from':(aw['from']??[])['filter'](ax=>typeof ax==='string'||ax['guard_key']===undefined||!u['has'](ax['guard_key']))})):a['machine_shape'],w=u['size']>0x0?(a['allocator']['rows']??[])['filter'](aw=>aw['guard_key']===undefined||!u['has'](aw['guard_key'])):a['allocator']['rows']??[],x=[];for(const [aw,ax]of Object['entries'](d['guardResolutions']??{})){if(ax?.['kind']==='omit')x['push'](aw);}const y=new Set();if(x['length']>0x0){const ay=new Set(v['flatMap'](aA=>(aA['from']??[])['map'](aB=>typeof aB==='string'?undefined:aB['guard_key'])['filter'](aB=>typeof aB==='string'))),az=new Set(w['map'](aA=>aA['guard_key'])['filter'](aA=>typeof aA==='string'));for(const aA of x){const aB=a['guards']['find']((aD,aE)=>(aD['key']??aD['template_id']+'#'+aE)===aA);if(aB===undefined)continue;const aC=[];if(ay['has'](aA))aC['push']('a\x20machine\x20forward\x20edge\x20(guard_key)');if(az['has'](aA))aC['push']('an\x20allocator\x20rail\x20row\x20(guard_key)');if(aB['policy']!==undefined)aC['push']('a\x20Repository\x20write-policy\x20credential\x20(policy)');if(aB['host']==='service'&&aA==='buy')aC['push']('the\x20Service\x20buy\x20gate\x20(buy_guard)');aC['length']>0x0?j['push']({'code':'GUARD_OMIT_UNSUPPORTED','detail':'guard_resolutions[\x27'+aA+'\x27]\x20=\x20{kind:\x27omit\x27}\x20refused:\x20this\x20design\x20is\x20bound\x20to\x20'+aC['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.'}):y['add'](aA);}}const z=a['guards']['map']((aD,aE)=>({'key':aD['key']??aD['template_id']+'#'+aE,'template_id':aD['template_id'],'host':aD['host'],'purpose':aD['purpose'],'policy':aD['policy'],'params':aD['params']}))['filter'](aD=>!l['has'](aD['key'])&&!y['has'](aD['key'])),A=new Map();{const aD=new Set(z['map'](aE=>aE['key']));for(const aE of v){for(const aF of aE['from']??[]){const aG=typeof aF==='string'?{'prev':aF}:aF,aH=aG['operator']??aE['operator']??(aG['prev']===''?'order_payer':'merchant');if(aH!=='order_payer'||aG['guard_key']!==undefined)continue;const aI=aG['forward']??(aG['prev']===''?'enter_'+aE['name']:aG['prev']+'_to_'+aE['name']);if(A['has'](aI))continue;let aJ='order_holder_'+aI;while(aD['has'](aJ))aJ=aJ+'_x';aD['add'](aJ),A['set'](aI,aJ),z['push']({'key':aJ,'template_id':'tpl_forward_order_holder','host':'machine','purpose':'F05\x20kernel-injected\x20order-holder\x20identity\x20binding\x20for\x20the\x20buyer-exclusive\x20forward\x20'+('\x27'+aI+'\x27\x20(edge\x20\x27'+aG['prev']+'\x27->\x27'+aE['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 B=new Map(z['map'](aK=>[aK['key'],aK])),C=b['review_mode'],D=C==='review'||C==='review_reward'||C==='none'?C:undefined,E=D??a['review_mode']??'none',F=h+'_review_reward';if(E==='review_reward'){const aK=z['find'](aO=>aO['host']==='reward'),aL=aK!==undefined?d['guardResolutions']?.[aK['key']]:undefined,aM=aL!==undefined&&(aL['kind']==='template'||aL['kind']==='inline'),aN=aK!==undefined&&(aK['template_id']['startsWith']('tpl_')||aM);if(aK===undefined||!aN){const aO=v['find'](aS=>/review/i['test'](aS['name'])),aP=v['filter'](aS=>aS['semantic_role']==='final')['map'](aS=>aS['name']),aQ=aO?.['name']??aP[0x0],aR=[...new Set([aQ,...aP])]['slice'](0x0,0x4);if(aQ!==undefined){const aS=new Set([aQ,...aP])['size']>0x4,aT={'reward_address':'review_pool','expected_pre_claim_node':aR[0x0],'expected_pre_claim_node_alt':aR[0x1]??aQ,'expected_pre_claim_node_alt2':aR[0x2]??aQ,'expected_pre_claim_node_alt3':aR[0x3]??aQ,'rating_repository':''};if(aK===undefined){let aU='reward_claim_default';while(z['some'](aV=>aV['key']===aU))aU=aU+'_x';z['push']({'key':aU,'template_id':'tpl_reward_one_time_claim','host':'reward','purpose':'4R-02\x20kernel-injected\x20DEFAULT\x20claim\x20guard\x20for\x20review_mode\x20\x27review_reward\x27\x20(the\x20template\x20'+('declares\x20no\x20reward\x20spec):\x20claim-allowed\x20SET\x20{'+aR['join'](',\x20')+'}'+(aS?'\x20(TRUNCATED\x20to\x20the\x204\x20template\x20slots\x20—\x20the\x20shape\x20carries\x20more\x20terminals;\x20declare\x20an\x20explicit\x20host:\x22reward\x22\x20spec)':'')+',\x20')+'bounty\x20derived\x20T-02\x20(2%\x20of\x20the\x20cheapest\x20SKU,\x20floored\x20at\x201),\x20funding\x20fail-closed\x20'+'(REVIEW_REWARD_UNFUNDED).\x20Declare\x20an\x20explicit\x20host:\x22reward\x22\x20guard\x20spec\x20to\x20replace\x20this\x20'+'default\x20with\x20a\x20named\x20design.','params':aT});}else{const aV=aK['template_id'];aK['template_id']='tpl_reward_one_time_claim',aK['params']=aT,aK['purpose']='4R-02\x20default\x20assembly\x20replaced\x20the\x20unresolved\x20design\x20reference\x20(was\x20\x27'+aV+'\x27\x20with\x20no\x20'+('caller\x20resolution):\x20claim-allowed\x20SET\x20{'+aR['join'](',\x20')+'}'+(aS?'\x20(TRUNCATED\x20to\x20the\x204\x20template\x20slots\x20—\x20declare\x20an\x20explicit\x20spec\x20or\x20resolve\x20this\x20key\x20to\x20cover\x20every\x20terminal)':'')+'.\x20')+'Resolve\x20this\x20key\x20via\x20guard_resolutions\x20(kind\x20\x27inline\x27\x20or\x20\x27template\x27)\x20to\x20override\x20the\x20'+'default\x20mount\x20per\x20build.';}}}}const G=new Set(['wip_provenance','subscription_with_proof']),H=Array['isArray'](b['adopted_module_ids'])?b['adopted_module_ids']['filter'](aW=>typeof aW==='string'):[],I=z['some'](aW=>aW['host']==='repository'||aW['template_id']==='pattern.repository_data_check'||aW['template_id']==='pattern.repository_write_authorization'||aW['template_id']==='tpl_repository_row_present'||aW['template_id']==='tpl_repository_row_equals_order_field')||H['some'](aW=>G['has'](aW)),J=new Map(),K=[],L=z['map'](aW=>aW['key']);for(const aW of Object['keys'](d['guardResolutions']??{})){if(y['has'](aW))continue;!B['has'](aW)&&j['push']({'code':'GUARD_RESOLUTION_UNKNOWN','detail':'guard_resolutions\x20key\x20\x27'+aW+'\x27\x20matches\x20no\x20guard\x20spec\x20key\x20declared\x20by\x20\x27'+h+'\x27.\x20'+('Legal\x20keys:\x20'+(L['length']>0x0?L['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 aX of z){const aY='guard_'+safeId(aX['key']),aZ=d['guardResolutions']?.[aX['key']];let b0=aX['purpose'],b1,b2;if(aZ?.['kind']==='inline')b1=normalizeInlineGuardTable(aZ['table'],h),b2=aZ['root'],b0=aZ['description']??aX['purpose'];else{const b3=aZ?.['kind']==='template'?aZ['template_id']:aX['template_id']['startsWith']('tpl_')?aX['template_id']:undefined;if(b3!==undefined){const b4={'service_name':h+'_service',...I?{'repository_name':h+'_evidence'}:{},...a['fee_params'],...b,...aX['params'],...aZ?.['kind']==='template'?aZ['params']:{}},b5=fillGuardTemplate(b3,b4);!b5['ok']?j['push']({'code':'GUARD_TEMPLATE_PARAMS','detail':'guard\x20\x27'+aX['key']+'\x27\x20('+b3+'):\x20'+b5['error']}):(b1=b5['table'],b2=b5['root']);}}b1!==undefined?(J['set'](aX['key'],{'stepId':aY,'description':b0,'table':b1,'root':b2}),aX['step_id']=aY):(!aX['template_id']['startsWith']('tpl_')&&getTemplateById(aX['template_id'])===undefined&&!GUARD_DESIGN_PATTERNS['some'](b6=>b6['id']===aX['template_id'])&&j['push']({'code':'GUARD_PATTERN_UNKNOWN','detail':'guard\x20\x27'+aX['key']+'\x27\x20of\x20\x27'+h+'\x27\x20references\x20design\x20\x27'+aX['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).'}),K['push'](aX));}const M=new Set(v['flatMap'](b6=>(b6['from']??[])['map'](b7=>typeof b7==='string'?undefined:b7['guard_key'])['filter'](b7=>typeof b7==='string')));for(const b6 of w){typeof b6['guard_key']==='string'&&b6['recipient']==='guard_identifier'&&b6['recipient_key']===String(TASK_BINDING_SLOT)&&M['add'](b6['guard_key']);}const N=new Set();for(const b7 of z){if(!M['has'](b7['key']))continue;const b8=J['get'](b7['key']);if(b8===undefined)continue;const b9=b8['table']['some'](ba=>ba['identifier']===TASK_BINDING_SLOT);if(b9)continue;J['set'](b7['key'],{...b8,'table':[...b8['table'],{'identifier':TASK_BINDING_SLOT,'b_submission':!![],'value_type':'Address','name':'task_binding\x20order\x20anchor\x20(protocol\x20slot\x20254;\x20written\x20by\x20order\x20creation)'}]}),N['add'](b7['key']);}const O=ba=>J['get'](ba)!==undefined&&refsOf({'table':J['get'](ba)['table'],'root':J['get'](ba)['root']})['has']('service'),Q=ba=>{const bb=J['get'](ba),bc=B['get'](ba)?.['purpose'];return{'op':'create','id':bb['stepId'],'object':'guard','params':P({'description':bb['description'],'table':bb['table'],'root':bb['root']}),'notes':N['has'](ba)?(bc??'Guard')+'\x20[kernel:\x20protocol\x20slot\x20254\x20(task\x20binding)\x20auto-declared]':bc};};k['push']({'op':'create','id':'permission','object':'permission','params':{'name':h+'_permission'}});const R=a['arbitration_mode']!==undefined&&a['arbitration_mode']!=='none';R&&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 S=b['after_sales_mode'],T=S==='return'||S==='exchange'||S==='warranty'||S==='none'?S:undefined,U=T??a['after_sales_mode']??'none',V=b['acceptance_mode'],W=V==='milestone'||V==='contest'||V==='bounty'||V==='agent'||V==='none'?V:undefined,X=W??a['acceptance_mode']??'none',Y=X==='contest'||X==='bounty'||X==='agent',Z=b['installment_mode'],a0=Z==='deposit_balance'||Z==='milestone_n'||Z==='none'?Z:undefined,a1=a0??a['installment_mode']??'none',a2=b['affiliate_mode'],a3=a2==='commission'||a2==='none'?a2:undefined,a4=a3??a['affiliate_mode']??'none',a5=b['crowdfunding_mode'],a6=a5==='threshold'||a5==='flexible'||a5==='none'?a5:undefined,a7=a6??a['crowdfunding_mode']??'none',a8=b['logistics_mode'],a9=a8==='carrier'||a8==='merchant_managed'||a8==='courier'||a8==='pickup_point'||a8==='none'?a8:undefined,aa=a9??a['logistics_mode']??'none',ab=ba=>{const bb=new Set(),bc=bd=>{if(Array['isArray'](bd)){for(const bf of bd)bc(bf);return;}if(typeof bd!=='object'||bd===null)return;const be=bd;if(typeof be['type']==='string'&&be['type']['startsWith']('query_reward_record')){const bg=be['object'];if(bg!==undefined&&typeof bg['identifier']==='number')bb['add'](bg['identifier']);}for(const bh of Object['values'](be))bc(bh);};return bc(ba),bb;},ac=E==='review_reward'?z['find'](ba=>ba['host']==='reward'):undefined;if(E==='review_reward'&&ac?.['step_id']!==undefined){const ba=J['get'](ac['key']);if(ba!==undefined){const bb=ab(ba['root']);J['set'](ac['key'],{...ba,'table':ba['table']['map'](bc=>{const bd=bc;if(bd['b_submission']===!![]||!bb['has'](bd['identifier']))return bc;return{...bd,'value':{'$late':{'by':'local_name','mark':F}}};})});}k['push']({'op':'create','id':'reward_review','object':'reward','params':P({'name':F,'description':'Review\x20incentive\x20pool\x20(sale-time\x20planned;\x20terms\x20disclosed\x20at\x20quote/buy):\x20claim\x20gated\x20by\x20guard\x20\x27'+ac['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§4).\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 ad=[];for(const [bc]of J){O(bc)?ad['push'](bc):k['push'](Q(bc));}if(I){const bd=Array['isArray'](b['repository_policies'])?b['repository_policies']['filter'](bg=>typeof bg==='object'&&bg!==null):[],be=[...bd],bf=new Set(bd['map'](bg=>bg['name']));for(const bg of z){if(bg['host']!=='repository'||bg['step_id']===undefined)continue;const bh='host:\x22repository\x22\x20guard\x20\x27'+bg['key']+'\x27\x20(step\x20\x27'+bg['step_id']+'\x27)';if(bg['policy']===undefined){j['push']({'code':'REPO_GUARD_POLICY_MISSING','detail':bh+'\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(O(bg['key'])){j['push']({'code':'REPO_GUARD_POLICY_MISSING','detail':bh+'\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 bi=bg['policy']['name']??bg['key'],bj=(bg['policy']['id_from']??'none')['toLowerCase'](),bk=bg['policy']['id_from_submission'],bl=bg['policy']['data_from_submission'];bk!==undefined&&(bj==='signer'||bj==='clock')&&j['push']({'code':'REPO_GUARD_SUBMISSION_ID_FORBIDDEN','detail':bh+'\x20declares\x20id_from_submission\x20'+bk+'\x20while\x20its\x20policy\x20id_from\x20is\x20'+('\x27'+bj+'\x27\x20—\x20the\x20row\x20id\x20is\x20AUTO-generated\x20from\x20the\x20'+bj+'\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 bm=J['get'](bg['key']),bn=[['id_from_submission',bk],['data_from_submission',bl]];for(const [bo,bp]of bn){if(bp===undefined)continue;const bq=bm?.['table']['find'](br=>br['identifier']===bp);(bm===undefined||bq===undefined||bq['b_submission']!==!![])&&j['push']({'code':'REPO_GUARD_SUBMISSION_SLOT_UNKNOWN','detail':bh+'\x20declares\x20'+bo+'\x20'+bp+',\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'+bp+'\x20on\x20the\x20guard,\x20or\x20point\x20')+(bo+'\x20at\x20an\x20existing\x20submission\x20slot.')});}}if(bf['has'](bi))continue;be['push']({'name':bi,'description':bg['policy']['description']??bg['purpose'],'write_guard':[{'guard':ref(bg['step_id']),...bk!==undefined?{'id_from_submission':bk}:{},...bl!==undefined?{'data_from_submission':bl}:{}}],'id_from':bg['policy']['id_from']??'none','value_type':bg['policy']['value_type']??'String','write_once':bg['policy']['write_once']??![]});}k['push']({'op':'create','id':'repository','object':'repository','params':P({'name':h+'_evidence',...be['length']>0x0?{'policies':be}:{}}),'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 ae=new Set(v['map'](br=>br['name'])),af=new Set((a['allocator']?.['rows']??[])['filter'](br=>br['track']==='settlement')['map'](br=>br['guard_key'])['filter'](br=>typeof br==='string'&&br['trim']()!=='')),ag=[],ah=new Set();for(const br of v){if(br['from']===undefined||br['from']['length']===0x0){j['push']({'code':'MACHINE_EDGES_MISSING','detail':'machine_shape\x20node\x20\x27'+br['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 bs=[],bt=new Map(),bu=new Map();for(const bw of br['from']){const bx=typeof bw==='string'?{'prev':bw}:bw;if(bx['prev']!==''&&!ae['has'](bx['prev'])){j['push']({'code':'EDGE_UNKNOWN_PREV','detail':'node\x20\x27'+br['name']+'\x27\x20edge\x20prev\x20\x27'+bx['prev']+'\x27\x20is\x20not\x20a\x20machine_shape\x20node'});continue;}const by=bx['operator']??br['operator']??(bx['prev']===''?'order_payer':'merchant'),bz=bx['named_operator']??br['named_operator'],bA=bx['forward']??(bx['prev']===''?'enter_'+br['name']:bx['prev']+'_to_'+br['name']);bx['permission_index']!==undefined&&by==='order_payer'&&j['push']({'code':'PERMISSION_INDEX_DROPPED','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20declares\x20permission_index\x20'+bx['permission_index']+'\x20on\x20operator\x20\x27order_payer\x27.\x20'+'The\x20two\x20are\x20contradictory\x20rails:\x20\x27order_payer\x27\x20compiles\x20to\x20the\x20on-chain\x20order-holder\x20check\x20(namedOperator\x20\x22\x22),\x20which\x20the\x20chain\x20evaluates\x20FIRST,\x20'+'so\x20the\x20declared\x20permission\x20index\x20is\x20silently\x20dropped\x20and\x20the\x20forward\x20remains\x20open\x20to\x20EVERY\x20order\x20agent\x20—\x20the\x20opposite\x20of\x20the\x20entity-only\x20intent\x20'+'(alg2-tn-261025\x20T8e:\x20the\x20provider\x20self-advanced\x20the\x20evaluation\x20forward\x20and\x20settled\x20the\x20escrow\x20to\x20itself).\x20Pick\x20ONE\x20rail:\x20remove\x20permission_index\x20to\x20keep\x20the\x20'+('buyer\x20rail,\x20or\x20remove\x20the\x20\x27order_payer\x27\x20operator\x20(node-level\x20or\x20edge-level)\x20so\x20this\x20forward\x20binds\x20permission_index\x20'+bx['permission_index']+'\x20only')});bz!==undefined&&bx['permission_index']!==undefined&&j['push']({'code':'NAMED_OPERATOR_RAIL_CONFLICT','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20declares\x20named_operator\x20\x27'+bz+'\x27\x20AND\x20permission_index\x20'+bx['permission_index']+'.\x20'+'namedOperator\x20and\x20permissionIndex\x20are\x20OR-options\x20in\x20the\x20on-chain\x20pre-check\x20(namedOperator\x20first),\x20so\x20both\x20rails\x20on\x20one\x20forward\x20'+'is\x20a\x20widening\x20ambiguity\x20—\x20the\x20forward\x20stays\x20open\x20to\x20whichever\x20rail\x20matches\x20and\x20neither\x20the\x20roster-only\x20nor\x20the\x20entity-only\x20intent\x20binds.\x20'+'Pick\x20ONE\x20rail:\x20drop\x20permission_index\x20to\x20keep\x20the\x20named\x20roster\x20rail,\x20or\x20drop\x20named_operator\x20to\x20keep\x20the\x20permission\x20entity\x20rail'});bz!==undefined&&(bx['operator']==='order_payer'||br['operator']==='order_payer')&&j['push']({'code':'NAMED_OPERATOR_RAIL_CONFLICT','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20declares\x20named_operator\x20\x27'+bz+'\x27\x20on\x20an\x20EXPLICIT\x20operator:\x27order_payer\x27.\x20'+'Both\x20ride\x20the\x20namedOperator\x20rail\x20with\x20different\x20payloads\x20—\x20the\x20buyer\x20self-advance\x20(\x27\x27\x20resolves\x20to\x20the\x20order\x20payer)\x20and\x20the\x20'+('third-party\x20namespace\x20(\x27'+bz+'\x27\x20resolves\x20to\x20the\x20per-order\x20roster)\x20cannot\x20share\x20one\x20forward;\x20one\x20of\x20them\x20would\x20silently\x20lose.\x20')+'Pick\x20ONE\x20rail:\x20drop\x20the\x20operator\x20declaration\x20to\x20keep\x20the\x20named\x20roster\x20rail,\x20or\x20drop\x20named_operator\x20to\x20keep\x20the\x20buyer\x20self-advance'});{const bF=bx['guard_key']!==undefined&&bx['guard_key']['trim']()!==''&&af['has'](bx['guard_key'])||/settle|release|payout/i['test'](bA);bF&&bx['permission_index']===undefined&&bz===undefined&&by!=='order_payer'&&j['push']({'code':'RELEASE_EDGE_PERMISSIONLESS','detail':'settlement\x20edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20(forward\x20\x27'+bA+'\x27,\x20guard\x20\x27'+(bx['guard_key']??'none')+'\x27)\x20binds\x20NO\x20permission_index\x20and\x20NO\x20named_operator\x20rail\x20—\x20it\x20compiles\x20PERMISSIONLESS:\x20progress.move\x20checks\x20namedOperator\x20then\x20permissionIndex,\x20and\x20with\x20neither\x20present\x20ANYONE\x20with\x20a\x20valid\x20order\x20passport\x20can\x20advance\x20the\x20release\x20and\x20move\x20the\x20escrow\x20(5R-07①\x20F-56,\x20tbp\x20T17\x20live:\x20an\x20unrelated\x20buyer\x27s\x20wallet\x20executed\x20the\x20payout).\x20Bind\x20ONE\x20rail:\x20permission_index\x201002\x20(the\x20keeper/merchant\x20release\x20slot\x20—\x20recommended\x20default\x20C:\x20the\x20time-lock\x20guard\x20+\x20keeper\x20duty\x20+\x20bounty\x20schedule\x20the\x20release)\x20or\x20a\x20stricter\x20merchant-approval\x20rail\x20for\x20high-ticket\x20builds\x20(default\x20A:\x20the\x20merchant\x27s\x20own\x20approval\x20BEFORE\x20the\x20escrow\x20moves).\x20Pair\x20the\x20rail\x20with\x20the\x20guard\x27s\x20identity\x20leg\x20(Signer\x20binding)\x20as\x20defense\x20in\x20depth\x20—\x20declared\x20in\x20the\x20guard\x20table,\x20verified\x20by\x20the\x20audit\x20face'});}const bB={'name':bA,'weight':0x1,...bz!==undefined?{'namedOperator':bz}:by==='order_payer'?{'namedOperator':''}:{'permissionIndex':bx['permission_index']??i}};if(bx['guard_key']!==undefined){const bG=B['get'](bx['guard_key']);if(bG===undefined)j['push']({'code':'GUARD_KEY_UNKNOWN','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20binds\x20unknown\x20guard_key\x20\x27'+bx['guard_key']+'\x27'});else{for(const bI of bG['purpose']['matchAll'](/progress\.current\s*==\s*([a-z0-9_]+)/g)){const bJ=bI[0x1];ae['has'](bJ)&&bJ!==bx['prev']&&j['push']({'code':'FORWARD_GUARD_PINNED_TO_NON_PREV','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20guard\x20\x27'+bG['key']+'\x27\x20pins\x20progress.current\x20==\x20\x27'+bJ+'\x27,\x20but\x20a\x20'+('forward\x20guard\x20evaluates\x20BEFORE\x20the\x20advance\x20(progress.current\x20==\x20prev\x20\x27'+bx['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.'});}const bH=bG['template_id']==='pattern.identity_check_order_holder'||bG['template_id']==='tpl_forward_order_holder'||bG['template_id']==='tpl_forward_order_holder_or_time'||bG['template_id']==='tpl_time_window_upper_order_holder';if(bH&&bz!==undefined)j['push']({'code':'FORWARD_GUARD_IDENTITY_NAMED_CONFLICT','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20guard\x20\x27'+bG['key']+'\x27\x20is\x20an\x20order-holder\x20(buyer)\x20identity\x20'+('check\x20but\x20the\x20forward\x20rides\x20a\x20named_operator\x20rail\x20(\x27'+bz+'\x27\x20—\x20a\x20third\x20party\x20that\x20is\x20')+'neither\x20the\x20merchant\x20entity\x20nor\x20the\x20buyer).\x20The\x20identity\x20layer\x20runs\x20BEFORE\x20the\x20guard\x20and\x20the\x20'+'roster\x20signer\x20is\x20never\x20the\x20order\x20owner\x20—\x20nobody\x20can\x20pass\x20both.\x20Move\x20the\x20buyer-identity\x20leg\x20'+'off\x20this\x20forward\x20(the\x20roster\x20forward\x20may\x20carry\x20only\x20evidence/time\x20guards),\x20or\x20split\x20the\x20hop.'});else bH&&by!=='order_payer'&&j['push']({'code':'FORWARD_GUARD_IDENTITY_PERM_CONFLICT','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20guard\x20\x27'+bG['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 bK=J['get'](bG['key']);if(bK!==undefined){const bL=bK['table']['some'](bN=>bN['identifier']===TASK_BINDING_SLOT),bM=offTaskSlotIdentityLegs(bK['root'])['filter'](bN=>{if(!bL)return![];const bO=bK['table']['find'](bP=>bP['identifier']===bN['identifier']);return bO!==undefined&&bO['b_submission']===!![];});for(const bN of bM){j['push']({'code':'GUARD_IDENTITY_SLOT_NOT_TASKBOUND','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20guard\x20\x27'+bG['key']+'\x27\x20reads\x20'+bN['query']+'\x20off\x20free\x20'+('submission\x20slot\x20'+bN['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'+bN['query']+'\x20query\x20on\x20identifier\x20')+(TASK_BINDING_SLOT+'\x20(the\x20task-binding\x20order\x20anchor\x20—\x20the\x20order\x20the\x20forward\x20actually\x20mutates).')});}}}bG['step_id']!==undefined&&(O(bG['key'])?j['push']({'code':'GUARD_CYCLE','detail':'edge\x20\x27'+bx['prev']+'\x27->\x27'+br['name']+'\x27\x20binds\x20guard\x20\x27'+bG['key']+'\x27\x20which\x20itself\x20'+'refs\x20the\x20service\x20(created\x20after\x20the\x20machine)\x20—\x20an\x20F-05\x20cycle.\x20Rebind\x20or\x20split\x20the\x20guard.'}):bB['guard']=ref(bG['step_id']));}}else{const bO=A['get'](bA);if(bO!==undefined){const bP=B['get'](bO);bP?.['step_id']!==undefined&&(bB['guard']=ref(bP['step_id']));}}const bC=bt['get'](bx['prev']);bC!==undefined?bC['push'](bB):bt['set'](bx['prev'],[bB]);const bD=bu['get'](bx['prev']),bE=bz!==undefined?'namedOperator:'+bz:by==='order_payer'?'namedOperator:':'permissionIndex:'+(bx['permission_index']??i);bz!==undefined&&ah['add'](bz),bD!==undefined?bD['add'](bE):bu['set'](bx['prev'],new Set([bE]));}const bv=br['threshold']??0x0;for(const [bQ,bR]of bt){bv>bR['length']&&j['push']({'code':'PAIR_THRESHOLD_UNREACHABLE','detail':'node\x20\x27'+br['name']+'\x27\x20pair\x20from\x20\x27'+(bQ===''?'(entry)':bQ)+'\x27\x20declares\x20threshold\x20'+bv+'\x20'+('but\x20the\x20pair\x20merges\x20only\x20'+bR['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(bv>=0x2){const bS=bu['get'](bQ)?.['size']??0x0;bS<0x2&&j['push']({'code':'PAIR_THRESHOLD_SINGLE_OPERATOR','detail':'node\x20\x27'+br['name']+'\x27\x20pair\x20from\x20\x27'+(bQ===''?'(entry)':bQ)+'\x27\x20declares\x20threshold\x20'+bv+'\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).'});}bs['push']({'prev_node':bQ,'threshold':bv,'forwards':bR});}ag['push']({'name':br['name'],...br['semantic_role']!==undefined?{'role':br['semantic_role']}:{},...br['optional']===!![]?{'optional':!![]}:{},'pairs':bs});}if(ah['size']>0x0){const bT=/(named[-_ ]?operator|operator roster|\broster\b|dispatch|permission.{0,12}221)/i,bU=(a['build_notes']??[])['some'](bV=>bT['test'](bV));!bU&&j['push']({'code':'NAMED_OPERATOR_ROSTER_UNDISCLOSED','detail':'machine_shape\x20binds\x20a\x20named\x20third-party\x20operator\x20namespace\x20('+[...ah]['map'](bV=>'\x27'+bV+'\x27')['join'](',\x20')+')\x20'+'but\x20no\x20build_note\x20discloses\x20the\x20roster\x20management.\x20The\x20per-order\x20NamedOperator\x20roster\x20(max\x2060\x20rosters\x20/\x2080\x20addresses)\x20is\x20written\x20at\x20'+'runtime\x20by\x20the\x20account\x20holding\x20permission\x20index\x20221\x20—\x20without\x20a\x20disclosed\x20dispatch\x20duty\x20the\x20forward\x20compiles\x20but\x20nobody\x20can\x20ever\x20'+'pass\x20it\x20(silent\x20brick).\x20Add\x20a\x20build_note\x20stating\x20WHO\x20writes\x20the\x20roster,\x20WHEN\x20(per\x20order?\x20per\x20shift?),\x20and\x20what\x20happens\x20on\x20a\x20miss\x20'+'(e.g.\x20\x22namedOperator\x20\x27delivery_team\x27\x20roster\x20is\x20written\x20per\x20order\x20by\x20the\x20dispatch\x20keeper\x20via\x20permission\x20221;\x20an\x20unassigned\x20order\x20'+'waits\x20until\x20the\x20keeper\x20assigns\x20a\x20courier\x22).\x20K-4\x20stance:\x20dispatch\x20assignment\x20is\x20an\x20OFF-CHAIN\x20keeper\x20optimization,\x20never\x20a\x20chain\x20scheduler'});}k['push']({'op':'create','id':'machine','object':'machine','params':P({'name':h+'_machine','nodes':ag})}),k['push']({'op':'publish','id':'machine_publish','target':ref('machine'),'preflight':[{'check':'machine_publish','status':'pending'},{'check':'TASKBIND-01','status':'pending'}]});const ai=typeof b['currency']==='string'?b['currency']:'0x2::wow::WOW',aj=z['find'](bV=>bV['host']==='service'&&bV['key']==='buy');k['push']({'op':'create','id':'service','object':'service','params':P({'name':h+'_service','type_parameter':ai,'permission':ref('permission'),'machine':ref('machine'),'um':ref('contact'),'description':a['id']+'\x20—\x20compiled\x20by\x20composition/compile',...I?{'repositories':[ref('repository')]}:{},...aj?.['step_id']!==undefined?{'buy_guard':ref(aj['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 bV of ad)k['push'](Q(bV));const ak=w['length']>0x0?w:[{'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}],al=[],am=new Map();for(const bW of ak){if(bW['guard_key']!==undefined){let bX=am['get'](bW['guard_key']);bX===undefined&&(bX={'key':bW['guard_key'],'rows':[]},am['set'](bW['guard_key'],bX),al['push'](bX)),bX['rows']['push'](bW);}else al['push']({'rows':[bW]});}const an=[];for(const bY of al){const bZ=[];let c0;for(const c2 of bY['rows']){let c3=c2['value'];c3===undefined&&c2['value_from']!==undefined&&(c3=b[c2['value_from']]??a['fee_params'][c2['value_from']]);if(c3===undefined&&c2['value_from_complement']!==undefined){const c5=c2['value_from_complement'],c6=b[c5]??a['fee_params'][c5],c7=typeof c6==='number'?c6:typeof c6==='string'&&/^\d+(?:\.\d+)?$/['test'](c6['trim']())?Number(c6):undefined;if(c2['mode']!=='rate'){j['push']({'code':'ALLOCATOR_COMPLEMENT_INVALID','detail':'allocator\x20row\x20('+c2['track']+'/'+(c2['recipient_key']??c2['recipient'])+')\x20declares\x20value_from_complement\x20\x27'+c5+'\x27\x20but\x20'+('mode\x20\x27'+c2['mode']+'\x27\x20—\x20the\x20complement\x20is\x20RATE-domain\x20only\x20(10000\x20-\x20bps).\x20Use\x20value/value_from\x20for\x20Amount\x20rows.')});continue;}if(c7===undefined||!Number['isFinite'](c7)||c7<0x0||c7>0x2710){j['push']({'code':'ALLOCATOR_COMPLEMENT_INVALID','detail':'allocator\x20row\x20('+c2['track']+'/'+(c2['recipient_key']??c2['recipient'])+')\x20value_from_complement\x20\x27'+c5+'\x27\x20resolves\x20to\x20'+('\x27'+String(c6)+'\x27\x20—\x20not\x20a\x20bps\x20value\x20in\x20[0,\x2010000];\x20the\x20complement\x20leg\x20cannot\x20be\x20computed.')});continue;}c3=0x2710-c7;}if(c3===undefined&&c2['mode']!=='surplus'){j['push']({'code':'ALLOCATOR_VALUE_MISSING','detail':'allocator\x20row\x20('+c2['track']+'/'+c2['recipient']+')\x20has\x20neither\x20value\x20nor\x20a\x20resolvable\x20value_from'});continue;}(c2['fix']!==undefined||c2['fix_from']!==undefined)&&j['push']({'code':'ALLOCATOR_FIX_UNSUPPORTED','detail':'allocator\x20row\x20('+c2['track']+'/'+c2['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.'});c0??=c2['note'];let c4;if(c2['recipient']==='entity')c4={'Entity':{'$late':{'by':'local_name','mark':c2['recipient_key']??'merchant'}}};else{if(c2['recipient']==='guard_identifier'){const c8=Number(c2['recipient_key']??0x0);c4={'GuardIdentifier':c8};const c9=bY['key']!==undefined?J['get'](bY['key']):undefined;if(c9!==undefined){const ca=c9['table']['find'](cb=>cb['identifier']===c8);(ca===undefined||ca['b_submission']!==!![]||ca['value_type']!=='Address')&&j['push']({'code':'GUARD_SLOT_UNKNOWN','detail':'allocator\x20leg\x20{GuardIdentifier:\x20'+c8+'}\x20on\x20guard\x20\x27'+bY['key']+'\x27\x20of\x20\x27'+h+'\x27:\x20the\x20bound\x20'+('Guard\x20table\x20has\x20no\x20slot\x20'+c8+'\x20Address\x20submission\x20row\x20(b_submission:\x20true).\x20On\x20chain\x20the\x20leg\x20')+('reads\x20slot\x20'+c8+'\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'+c8+',\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 c4='Signer';}bZ['push']({'who':c4,'sharing':String(c3??'0'),'mode':MODE_MAP[c2['mode']]});}if(bZ['length']===0x0)continue;const c1=bY['key']!==undefined?B['get'](bY['key'])?.['step_id']:undefined;bY['key']!==undefined&&!B['has'](bY['key'])&&j['push']({'code':'GUARD_KEY_UNKNOWN','detail':'allocator\x20row\x20('+bY['rows'][0x0]['track']+')\x20binds\x20unknown\x20guard_key\x20\x27'+bY['key']+'\x27'}),an['push']({...c1!==undefined?{'guard':ref(c1)}:{},...bY['key']!==undefined?{'guard_key':bY['key']}:{},'track':bY['rows'][0x0]['track'],'sharing':bZ,...c0!==undefined?{'note':c0}:{}});}const ao=al['map'](cb=>{if(cb['key']===undefined)return undefined;const cc=J['get'](cb['key']);return{'key':cb['key'],'track':cb['rows'][0x0]['track'],'table':cc?.['table']??[],'root':cc?.['root']};})['filter'](cb=>cb!==undefined);if(ao['length']>0x0){const cb=verifyAllocatorRails(ao,v['map'](ce=>({'name':ce['name'],'semanticRole':ce['semantic_role']}))),cc=al['map'](ce=>ce['key'])['filter'](ce=>ce!==undefined&&!J['has'](ce)),cd=cc['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'+cc['join'](',\x20')+'.':'';for(const ce of cb){ce['level']==='critical'&&j['push']({'code':ce['code'],'detail':ce['detail']+cd});}}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':an}),'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(U!=='none'){const cf=a13a(U),cg=v['some'](ch=>afterSalesRailNodeMatches(U,ch['name']));!cg&&j['push']({'code':'AFTER_SALES_RAIL_MISSING','detail':'after_sales_mode\x20\x27'+U+'\x27\x20declares\x20a\x20buyer\x20after-sales\x20remedy,\x20but\x20machine_shape\x20has\x20no\x20'+('backing\x20rail\x20(no\x20node\x20matching\x20'+cf+').\x20Add\x20the\x20'+U+'\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(X!=='none'){Y&&a['arbitration_mode']!=='third_party'&&j['push']({'code':'ACCEPTANCE_JUDGE_NOT_INDEPENDENT','detail':'acceptance_mode\x20\x27'+X+'\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 ch=a['fee_params']['revision_rounds_max'],ci=typeof ch==='number'||typeof ch==='string'&&ch['trim']()!==''&&/^\d+$/['test'](ch['trim']());if(ci){const cj=z['some'](ck=>ck['host']==='repository'||/repository/i['test'](ck['template_id']));!cj&&j['push']({'code':'ACCEPTANCE_REVISION_UNBOUNDED','detail':'acceptance_mode\x20\x27'+X+'\x27\x20declares\x20a\x20bounded\x20revision\x20loop\x20'+('(fee_params.revision_rounds_max\x20=\x20'+String(ch)+'),\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(a1!=='none'){const ck=/(due|owed|owing|unpaid|awaiting|pending)/i,cl=/(paid|captured|funded|settled)/i,cm=/(deposit|down_?pay|balance_due|balance_owed|awaiting|installment|milestone)/i,cn=/(refund|cancel|exit|forfeit|kill|void|abandon|release|expire|lapse)/i,co=[];for(const cr of v){const cs=cr['name'];for(const ct of cr['from']??[]){typeof ct==='string'?co['push']({'prev':ct,'target':cs}):co['push']({'prev':ct['prev'],'target':cs,'guardKey':ct['guard_key']});}}const cp=co['filter'](cu=>ck['test'](cu['prev'])&&cl['test'](cu['target'])&&(cu['guardKey']===undefined||cu['guardKey']['trim']()===''));cp['length']>0x0&&j['push']({'code':'INSTALLMENT_FUNDING_UNGATED','detail':'installment_mode\x20\x27'+a1+'\x27\x20captures\x20a\x20later\x20payment,\x20but\x20the\x20funding\x20forward(s)\x20'+cp['map'](cu=>'\x27'+cu['prev']+'\x27\x20→\x20\x27'+cu['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 cq=[];for(const cu of v){if(!cm['test'](cu['name']))continue;const cv=co['filter'](cx=>cx['prev']===cu['name']),cw=cv['some'](cx=>cn['test'](cx['target']));if(!cw)cq['push'](cu['name']);}cq['length']>0x0&&j['push']({'code':'INSTALLMENT_DEPOSIT_STRANDED','detail':'installment_mode\x20\x27'+a1+'\x27\x20holds\x20a\x20buyer\x20payment\x20at\x20state(s)\x20'+cq['map'](cx=>'\x27'+cx+'\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(a4!=='none'){const cx=/(commission|affiliate|referr|attribut|partner_?payout)/i,cy=v['some'](cC=>cx['test'](cC['name'])),cz=ak['some'](cC=>cx['test'](cC['value_from']??'')||cx['test'](cC['recipient_key']??''));!cy&&!cz&&j['push']({'code':'AFFILIATE_RAIL_MISSING','detail':'affiliate_mode\x20\x27'+a4+'\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—\x20anti-grab-pool)\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 cA=/(post-?lock|clawback|unrecoverable|irrevocab|no\s*(?:revers|recov|clawback)|cannot be reversed|once released|released commission)/i,cB=(a['build_notes']??[])['some'](cC=>cA['test'](cC));!cB&&j['push']({'code':'AFFILIATE_CLAWBACK_UNDISCLOSED','detail':'affiliate_mode\x20\x27'+a4+'\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—\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(a7!=='none'){const cC=/(releas|settle|funded|disburs|project)/i,cD=/(refund|missed|unmet|return|reimburse)/i,cE=v['some'](cR=>cC['test'](cR['name'])),cF=ak['some'](cR=>cR['track']==='settlement'&&(cC['test'](cR['guard_key']??'')||cC['test'](cR['recipient_key']??''))),cG=v['some'](cR=>cD['test'](cR['name'])),cH=ak['some'](cR=>cR['track']==='refund'||cD['test'](cR['guard_key']??''));!cE&&!cF&&j['push']({'code':'CROWDFUNDING_THRESHOLD_GATE_MISSING','detail':'crowdfunding_mode\x20\x27'+a7+'\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.'});a7==='threshold'&&!cG&&!cH&&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(a7==='threshold'){const cR=z['filter'](cU=>cU['host']==='repository'||/repository_write/i['test'](cU['template_id'])),cS=cR['length']>0x0,cT=cR['some'](cU=>{const cV=(cU['policy']?.['id_from']??'')['toLowerCase']();return cV==='signer'||cV==='clock';});if(!cS)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\x20declares\x20the\x20contribution\x20rows\x20—\x20with\x20no\x20write-bound\x20policy\x20the\x20total\x20is\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'+'Mount\x20pattern.repository_write_authorization\x20(identity\x20leaf\x20order.owner==Signer\x20/\x20order.agent\x20has\x20Signer)\x20'+'and\x20key\x20the\x20contribution\x20rows\x20by\x20the\x20funder\x27s\x20ORDER\x20(policy\x20id_from\x20unset;\x20row\x20id\x20=\x20the\x20Order\x20address).'});else{if(cT){const cU=cR['filter'](cV=>{const cW=(cV['policy']?.['id_from']??'')['toLowerCase']();return cW==='signer'||cW==='clock';})['map'](cV=>'\x27'+cV['key']+'\x27');j['push']({'code':'CROWDFUNDING_SIGNER_KEYED_ROWS','detail':'crowdfunding_mode\x20\x27threshold\x27\x20gates\x20release\x20on\x20an\x20aggregate\x20funding\x20total,\x20but\x20the\x20contribution\x20'+('policy\x20'+cU['join'](',\x20')+'\x20keys\x20rows\x20by\x20the\x20WALLET\x20(id_from\x20signer/clock)\x20—\x20the\x20OLD\x20pre-migration\x20')+'shape\x20(ksc-tn-261024\x20F-01/F-05).\x20Wallet-keyed\x20rows\x20feed\x20the\x20escrow-bound\x20sum\x20(query\x201179,\x20per-row\x20'+'min(row,\x20order.amount))\x20ZERO\x20—\x20the\x20goal\x20gate\x20silently\x20bricks\x20—\x20and\x20the\x20free-form\x20sum-where\x20(1174)\x20stays\x20'+'self-reported,\x20so\x20a\x20backer\x20can\x20still\x20record\x201.0\x20for\x20a\x200.1\x20pledge.\x20Key\x20the\x20rows\x20by\x20the\x20funder\x27s\x20ORDER\x20'+'instead\x20(policy\x20id_from\x20unset;\x20the\x20backer\x27s\x20tooling\x20submits\x20the\x20row\x20id\x20=\x20their\x20Order\x20address\x20through\x20'+'the\x20passport-bearing\x20data\x20write),\x20pass\x20those\x20ORDER\x20addresses\x20as\x20the\x20aggregate\x27s\x20candidate\x20ids,\x20and\x20pair\x20the\x20gate\x20'+'with\x20the\x20live-escrow\x20leg\x20(allocation.balance\x20query\x201051\x20via\x20convert_witness\x20OrderAllocation\x20109,\x20'+'>=\x20order.amount)\x20so\x20a\x20refunded/never-funded\x20order\x20can\x20neither\x20count\x20toward\x20the\x20goal\x20nor\x20be\x20settled.'});}}}const cI=a['build_notes']??[],cJ=/(attest|keeper|aggregate trust|read-?only sum|not a chain-?verified|independent recomputation)/i,cK=/(not investment|non-?investment|no (?:investment )?return|never promise)/i,cL=/(kyc|aml|securities|money-?transmission|regulatory|cross-border|compliance)/i,cM=/(no-?refund|non-?refundable|keep-?it-?all)/i,cN=cI['some'](cV=>cK['test'](cV)),cO=cI['some'](cV=>cL['test'](cV)),cP=a7==='threshold'?cI['some'](cV=>cJ['test'](cV)):!![],cQ=a7==='flexible'?cI['some'](cV=>cM['test'](cV)):!![];if(!cP||!cN||!cO||!cQ){const cV=[!cP?'the\x20aggregate-trust\x20boundary\x20(the\x20funding\x20total\x20is\x20a\x20keeper-attested\x20Repository\x20sum,\x20NOT\x20a\x20chain-verified\x20money\x20oracle)':null,!cN?'the\x20L-01\x20non-investment\x20statement\x20(never\x20promise\x20returns\x20/\x20promote\x20coin\x20price;\x20not\x20investment\x20advice\x20or\x20a\x20return\x20promise)':null,!cO?'the\x20L-05\x20KYC/AML\x20+\x20cross-border\x20regulatory\x20caution\x20(HIGH\x20intensity)':null,!cQ?'the\x20flexible\x20keep-it-all\x20NO-REFUND\x20posture\x20(contributions\x20non-refundable\x20once\x20the\x20deadline\x20passes;\x20no\x20refunds)':null]['filter'](Boolean);j['push']({'code':'CROWDFUNDING_DISCLOSURE_MISSING','detail':'crowdfunding_mode\x20\x27'+a7+'\x27\x20declares\x20a\x20campaign\x20but\x20no\x20build_note\x20carries:\x20'+cV['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(aa!=='none'){const cW=v,cX=cW['some'](cZ=>cZ['named_operator']!==undefined||(cZ['from']??[])['some'](d0=>d0['named_operator']!==undefined));aa==='courier'&&!cX&&j['push']({'code':'LOGISTICS_COURIER_RAIL_MISSING','detail':'logistics_mode\x20\x27courier\x27\x20declares\x20per-order\x20dispatched\x20riders,\x20but\x20machine_shape\x20carries\x20NO\x20named_operator\x20'+'rail.\x20A\x20dispatched\x20rider\x20is\x20NEITHER\x20a\x20permission\x20entity\x20NOR\x20the\x20buyer\x20—\x20the\x20ONLY\x20forward\x20they\x20can\x20ever\x20'+'pass\x20is\x20a\x20namedOperator\x20roster\x20rail\x20(the\x20rider\x20namespace\x27s\x20per-order\x20roster,\x20written\x20by\x20the\x20dispatch\x20'+'keeper\x20via\x20permission\x20index\x20221;\x20K-1\x20batch\x20B).\x20Bind\x20the\x20handover\x20forwards\x20(merchant→courier\x20pickup,\x20'+'courier→buyer\x20drop-off)\x20with\x20named_operator\x20\x27<namespace>\x27\x20—\x20and\x20disclose\x20the\x20roster\x20duty\x20in\x20a\x20build_note\x20'+'(the\x20NAMED_OPERATOR_ROSTER_UNDISCLOSED\x20gate\x20and\x20the\x20G6\x20dispatch\x20disclosure\x20below\x20enforce\x20the\x20rest).'});const cY=/(deliver|courier|shipping|freight|ride|dispatch|logistic)/i;if(aa==='courier'){const cZ=ak['find'](d0=>d0['mode']==='surplus'&&cY['test']((d0['value_from']??'')+'\x20'+(d0['recipient_key']??'')));cZ!==undefined&&j['push']({'code':'LOGISTICS_COURIER_FEE_POOLED','detail':'logistics_mode\x20\x27courier\x27\x20has\x20a\x20delivery-fee\x20allocator\x20row\x20in\x20SURPLUS\x20mode\x20'+('(value_from/recipient_key\x20\x27'+(cZ['value_from']??cZ['recipient_key']??'')+'\x27)\x20—\x20a\x20surplus\x20leg\x20')+'drains\x20the\x20remainder\x20of\x20the\x20pool\x20it\x20hangs\x20on,\x20which\x20for\x20a\x20courier\x20build\x20IS\x20the\x20buyer\x27s\x20goods\x20escrow\x20'+'(the\x20grab-pool\x20shape\x20the\x20affiliate\x20INV-D3\x20family\x20bans).\x20The\x20delivery\x20fee\x20is\x20KNOWN\x20at\x20order\x20time\x20—\x20the\x20'+'buyer\x20sees\x20and\x20pays\x20it\x20before\x20dispatch\x20—\x20so\x20make\x20it\x20an\x20INDEPENDENT\x20leg:\x20a\x20fixed\x20Amount\x20row\x20(or\x20a\x20Rate\x20'+'row\x20off\x20a\x20dedicated\x20delivery-fee\x20pool\x20funded\x20separately),\x20never\x20a\x20Surplus/Rate\x20drain\x20of\x20the\x20goods\x20pool.'});}if(aa==='pickup_point'){const d0=z['some'](d2=>d2['template_id']==='pattern.time_lock_absolute'||d2['template_id']==='tpl_time_lock_absolute_ms'),d1=z['some'](d2=>d2['template_id']==='pattern.time_window_upper_bound'||d2['template_id']==='tpl_time_window_upper'||d2['template_id']==='tpl_time_window_upper_absolute_ms');(!d0||!d1)&&j['push']({'code':'LOGISTICS_PICKUP_CUTOFF_MISSING','detail':'logistics_mode\x20\x27pickup_point\x27\x20declares\x20batch\x20consolidation,\x20but\x20the\x20shape\x20is\x20missing\x20'+(''+(!d0?'the\x20ABSOLUTE\x20batch-cutoff\x20release\x20gate\x20(pattern.time_lock_absolute\x20—\x20every\x20funder\x27s/leader\x27s\x20release\x20anchors\x20on\x20the\x20SAME\x20shared\x20cutoff\x20clock,\x20not\x20per-order\x20entry+duration)':''))+(''+(!d0&&!d1?'\x20and\x20':''))+(''+(!d1?'the\x20unclaimed-goods\x20exit\x20window\x20(pattern.time_window_upper_bound\x20—\x20goods\x20never\x20picked\x20up\x20must\x20refund/return\x20at\x20a\x20bounded\x20deadline,\x20never\x20hold\x20open-ended)':''))+'.\x20Both\x20are\x20mandatory:\x20without\x20the\x20shared\x20cutoff\x20the\x20batch\x20is\x20not\x20a\x20batch\x20(each\x20order\x20releases\x20on\x20its\x20own\x20clock),\x20and\x20without\x20the\x20exit\x20window\x20an\x20unclaimed\x20parcel\x20strands\x20in\x20the\x20pickup\x20point\x20forever.'});}if(aa==='carrier'){const d2=/(track|shipping evidence|waybill|airbill|carrier record|parcel evidence)/i,d3=z['some'](d4=>d4['host']==='machine'&&d2['test'](d4['key']+'\x20'+d4['purpose']));!d3&&j['push']({'code':'LOGISTICS_CARRIER_EVIDENCE_MISSING','detail':'logistics_mode\x20\x27carrier\x27\x20declares\x20third-party\x20carrier\x20shipment,\x20but\x20NO\x20machine\x20guard\x20binds\x20'+'shipping/tracking\x20evidence.\x20Add\x20a\x20repository_data_check\x20guard\x20on\x20the\x20ship\x20forward\x20keyed\x20to\x20a\x20'+'tracking-hash\x20row\x20(the\x20retail\x20idiom:\x20the\x20evidence\x20Repository\x20row\x20is\x20written\x20by\x20an\x20authorized\x20'+'writer\x20—\x20pattern.repository_write_authorization\x20—\x20and\x20the\x20ship\x20guard\x20reads\x20it),\x20so\x20a\x20dispute\x20has\x20a\x20'+'dispute-ready\x20record\x20of\x20what\x20was\x20shipped\x20and\x20when.'});}{const d4=/(lost|loss|damag|theft)/i,d5=d9=>d9['replace'](/permanently lost/gi,''),d6=/(transit loss|lost (?:parcel|package|goods|in transit)|in[- ]transit loss|carrier lost|loss (?:is |)remed|loss route|lost shipment)/i,d7=cW['some'](d9=>d4['test'](d9['name'])||d4['test'](d9['role']??''))||z['some'](d9=>d9['host']==='machine'&&d4['test'](d5(d9['key']+'\x20'+d9['purpose']))),d8=(a['build_notes']??[])['some'](d9=>d6['test'](d9));!d7&&!d8&&j['push']({'code':'LOGISTICS_TRANSIT_LOSS_UNCOVERED','detail':'logistics_mode\x20\x27'+aa+'\x27\x20moves\x20a\x20physical\x20good,\x20but\x20the\x20shape\x20has\x20NO\x20in-transit\x20loss\x20rail\x20'+'(no\x20loss/damage\x20node\x20or\x20machine-guard\x20family)\x20and\x20NO\x20build_note\x20disclosing\x20the\x20loss\x20remedy.\x20Goods\x20can\x20'+'be\x20lost\x20or\x20damaged\x20between\x20handover\x20and\x20acceptance\x20in\x20EVERY\x20physical\x20mode\x20—\x20silence\x20means\x20the\x20buyer\x27s\x20'+'funds\x20strand\x20behind\x20an\x20undeliverable\x20order\x20with\x20no\x20taught\x20route.\x20Either\x20express\x20the\x20loss\x20waypoint\x20(a\x20'+'node\x20like\x20the\x20retail\x20lost-parcel\x20record,\x20or\x20a\x20loss-evidence\x20machine\x20guard)\x20or\x20add\x20a\x20build_note\x20'+'disclosing\x20the\x20remedy\x20route\x20(e.g.\x20\x22transit\x20loss\x20is\x20remedied\x20by\x20the\x20buyer\x27s\x20arbitration\x20route\x20into\x20the\x20'+'refund\x20rail\x20—\x20the\x20ruling\x20pays\x20the\x20buyer;\x20the\x20carrier\x20claim\x20is\x20an\x20off-chain\x20recovery,\x20disclosed\x20as\x20such\x22).'});}if(aa==='courier'||aa==='pickup_point'){const d9=/(dispatch|schedul|no.{0,24}oracle|no on-chain.{0,24}(dispatch|scheduler)|off-chain keeper|keeper.{0,40}dispatch|roster|named.?operator|permission.{0,12}221)/i,da=(a['build_notes']??[])['some'](db=>d9['test'](db));!da&&j['push']({'code':'LOGISTICS_DISPATCH_UNDISCLOSED','detail':'logistics_mode\x20\x27'+aa+'\x27\x20is\x20a\x20dynamically\x20dispatched\x20fulfillment\x20topology,\x20but\x20no\x20build_note\x20'+'discloses\x20the\x20two\x20🔴\x20SOLE-TRUTH\x20boundaries.\x20①\x20The\x20chain\x20has\x20NO\x20dispatch/scheduling\x20primitive\x20—\x20'+'assignment\x20of\x20riders/pickup\x20batches\x20is\x20an\x20OFF-CHAIN\x20keeper\x20duty\x20(K-4);\x20its\x20only\x20chain\x20footprint\x20is\x20the\x20'+'namedOperator\x20roster\x20written\x20via\x20permission\x20index\x20221.\x20②\x20There\x20is\x20NO\x20distance/weight/weather\x20oracle\x20—\x20'+'ETA,\x20route,\x20and\x20dynamic\x20pricing\x20are\x20NOT\x20chain-verifiable.\x20Add\x20a\x20build_note\x20stating\x20WHO\x20dispatches\x20(the\x20'+'keeper),\x20WHAT\x20the\x20keeper\x20writes\x20(the\x20roster,\x20per\x20order/shift),\x20and\x20that\x20ETA/pricing\x20live\x20off-chain.'});}}if(E!=='none'){const db=v['some'](dh=>/review/i['test'](dh['name']));E==='review'&&!db&&j['push']({'code':'REVIEW_NODE_MISSING','detail':'review_mode\x20\x27'+E+'\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 dc=z['find'](dh=>dh['host']==='reward'),dd=v['find'](dh=>/review/i['test'](dh['name']))?.['name'];let de,df;if(dd!==undefined){const dh=[];for(const dk of v){for(const dl of dk['from']??[]){const dm=typeof dl==='string'?{'prev':dl,'guard_key':undefined}:dl;dh['push']({'prev':dm['prev'],'guard_key':dm['guard_key'],'target':dk['name']});}}const di=dh['find'](dn=>dn['target']===dd&&dn['guard_key']!==undefined)?.['guard_key']??dh['find'](dn=>dn['prev']===dd&&dn['guard_key']!==undefined)?.['guard_key'],dj=di!==undefined?B['get'](di):undefined;de=dj?.['step_id'],df=di;}if(de===undefined){const dn=v['filter'](dt=>/review/i['test'](dt['name'])||dt['semantic_role']==='final')['map'](dt=>dt['name']),dp={'type':'logic_or','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'order.owner','object':{'identifier':0x0},'parameters':[]},{'type':'context','context':'Signer'}]},{'type':'query','query':'order.agent\x20has','object':{'identifier':0x0},'parameters':[{'type':'context','context':'Signer'}]}]},dq={'type':'logic_equal','nodes':[{'type':'query','query':'order.service','object':{'identifier':0x0},'parameters':[]},{'type':'identifier','identifier':0x1}]},dr=dn['map']((dt,du)=>({'type':'logic_equal','nodes':[{'type':'query','query':'progress.current','object':{'identifier':0x0,'convert_witness':'OrderProgress'},'parameters':[]},{'type':'identifier','identifier':0x2+du}]})),ds=dr['length']===0x1?dr[0x0]:dr['length']>0x1?{'type':'logic_or','nodes':dr}:undefined;k['push']({'op':'create','id':'guard_review_write','object':'guard','params':P({'description':'Review\x20write\x20credential\x20(AR-3,\x20kernel-emitted):\x20the\x20signer\x20owns\x20or\x20administers\x20an\x20order\x20of\x20THIS\x20service'+(ds!==undefined?',\x20anchored\x20on\x20the\x20order\x20having\x20reached\x20'+dn['join']('\x20/\x20')+'.\x20':'.\x20')+'Gates\x20the\x20\x27review\x27\x20and\x20\x27rating\x27\x20policies\x20of\x20the\x20plan-created\x20review\x20repository\x20—\x20reads\x20nothing\x20from\x20that\x20repository,\x20so\x20the\x20write\x20path\x20is\x20satisfiable\x20by\x20construction\x20(no\x20credential\x20cycle).','table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'order_being_reviewed'},{'identifier':0x1,'b_submission':![],'value_type':'Address','value':ref('service'),'name':'this_service'},...dn['map']((dt,du)=>({'identifier':0x2+du,'b_submission':![],'value_type':'String','value':dt}))],'root':{'type':'logic_and','nodes':[...ds!==undefined?[ds]:[],dp,dq]}}),'notes':'AR-3\x20review\x20write\x20credential\x20(service\x20pinned\x20by\x20plan\x20ref\x20—\x20survives\x20permission\x20rotation).\x20The\x20buyer\x20writes\x20both\x20rows\x20at\x20review\x20time:\x20repository.data_add\x20{name:\x27review\x27|\x27rating\x27,\x20items:[{write_guard:\x27<this\x20guard>\x27,\x20data:[{id:<order\x20address>,\x20data:<stars/text>}]}]}\x20with\x20a\x20passport\x20submission\x20carrying\x20the\x20order.\x20Ordering:\x20pushed\x20BEFORE\x20repository_review\x20(HOST-GRAPH-01\x20—\x20the\x20frozen\x20write_guard\x20ref\x20resolves\x20only\x20if\x20the\x20credential\x20already\x20exists).'}),de='guard_review_write',df='review_write';}const dg=b['review_decision_enabled']===!![]&&E==='review_reward'&&dc?.['step_id']!==undefined&&de!==undefined;dg&&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(de!==undefined){const dt=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'+df+'\x27).\x20Payload:\x20JSON\x20text\x20{rating,\x20tags?,\x20orderRef?}.','write_guard':[{'guard':ref(de)}],'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(de)}],'id_from':'none','value_type':'U64','write_once':!![]},...dt?[{'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':!![]}]:[],...dg?[{'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.'+(dg?'\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(E==='review_reward'){const du=dc;if(du===undefined||du['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 dv=b['reward_funding'],dw=du['params']?.['reward_claim_amount'];let dx=dw!==undefined&&dw!==null?dw:b['reward_claim_amount'],dy='';if(dx===undefined){const dE=a['fee_params']?.['review_reward_per_claim'];typeof dE==='number'&&dE>0x0&&(dx=dE,dy='template\x20fee_param\x20review_reward_per_claim\x20(override\x20with\x20the\x20reward_claim_amount\x20input)');}if(dx===undefined){const dF=lowestSalePrice(b['sales']);dF!==undefined&&(dx=String(Math['max'](Math['floor'](dF*0.02),0x1)),dy='derived:\x202%\x20of\x20the\x20cheapest\x20SKU\x20('+dF+'\x20smallest\x20units),\x20floored\x20at\x201\x20(T-02)');}let dz='';if(dx!==undefined){const dG=numericAmount(String(dx)),dH=lowestSalePrice(b['sales']);if(dG!==undefined&&dH!==undefined&&dH>0x0&&dG>0.5*dH){const dI=numericAmount(String(b['reward_funding']??'')),dJ=dI!==undefined&&dG>0x0?'\x20the\x20reward_funding\x20pool\x20covers\x20~'+Math['floor'](dI/dG)+'\x20claim(s)':'';dz='\x20⚠\x20T-02\x20SCALE:\x20the\x20per-claim\x20bounty\x20('+dG+')\x20exceeds\x20half\x20the\x20cheapest\x20SKU\x20price\x20('+dH+')\x20—\x20'+('each\x20claimed\x20order\x20pays\x20out\x20more\x20than\x20the\x20sale\x20earns;\x20a\x20low-price\x20SKU\x20makes\x20the\x20rail\x20a\x20bounty-farm\x20target.'+dJ);}}const dA=J['get'](du['key']);dA!==undefined&&!rootHasRewardRecordGate(dA['root'])&&j['push']({'code':'REVIEW_REWARD_UNARMED','detail':'review_reward\x20claim\x20guard\x20\x27'+du['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 dB;if(dA!==undefined&&rootHasRewardRecordGate(dA['root']))for(const dK of dA['table']){const dL=dK;if(dL['b_submission']===!![]&&String(dL['value_type']??'')['toLowerCase']()==='address'&&(String(dL['object_type']??'')==='Order'||/order/i['test'](String(dL['name']??'')))){dB=dL['identifier'];break;}}const dC=du['params']?.['evidence']??b['review_claim_evidence'];let dD;if(dC!==undefined&&dC!==null&&typeof dC==='object'){const dM=dC,dN=toByteVector(dM['key']),dO=toByteVector(dM['predicate']);dN!==undefined&&dO!==undefined&&(dB===undefined?j['push']({'code':'REVIEW_REWARD_EVIDENCE_NO_STAMP','detail':'review_reward\x20resolved\x20an\x20evidence\x20binding\x20request,\x20but\x20the\x20claim\x20guard\x20mount\x20carries\x20no\x20'+'store_from_id\x20stamp\x20slot\x20—\x20the\x20evidence\x20binding\x20reads\x20THE\x20store_from\x20row\x20(the\x20submitted\x20'+'Order\x20address),\x20so\x20the\x20chain\x20refuses\x20the\x20guard\x20at\x20build\x20time\x20(reward::evidence_bind,\x20'+'E_EVIDENCE_NEEDS_STORE_FROM).\x20Give\x20the\x20claim\x20guard\x27s\x20table\x20an\x20address-typed\x20Order\x20'+'submission\x20row\x20(b_submission)\x20so\x20the\x20mount\x20can\x20pin\x20store_from_id,\x20then\x20rebuild.'}):dD={'repo':ref('repository_review'),'key':dN,'predicate':dO});}dx===undefined&&j['push']({'code':'REVIEW_REWARD_AMOUNT_MISSING','detail':'review_mode\x20\x27review_reward\x27\x20resolved\x20a\x20claim\x20guard\x20but\x20no\x20per-claim\x20bounty\x20was\x20provided\x20or\x20derivable.\x20'+'The\x20reward\x20guard_add\x20mount\x20REQUIRES\x20an\x20amount\x20(schema-required)\x20—\x20a\x20plan\x20step\x20emitted\x20without\x20'+'it\x20fails\x20mid-execution.\x20Pass\x20\x27reward_claim_amount\x27\x20(a\x20display\x20string\x20with\x20the\x20token\x20'+'symbol\x20like\x20\x271WOW\x27,\x20or\x20a\x20smallest-unit\x20integer\x20like\x20\x27100000000\x27),\x20set\x20it\x20in\x20the\x20guard\x20'+'spec\x27s\x20params,\x20or\x20include\x20a\x20parseable\x20sales\x20catalog\x20(inputs.sales\x20with\x20numeric\x20prices)\x20so\x20the\x20'+'T-02\x20default\x20applies\x20(2%\x20of\x20the\x20cheapest\x20SKU,\x20floored\x20at\x201\x20smallest\x20unit).'}),k['push']({'op':'configure','id':'reward_review_guard_add','target':ref('reward_review'),'method':'guard_add','params':P({'guard':ref(du['step_id']),'recipient':{'Signer':'signer'},...dx!==undefined?{'amount':{'type':'Fixed','value':String(dx)}}:{},...dB!==undefined?{'store_from_id':dB}:{},...dD!==undefined?{'evidence':dD}:{}}),'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.'+(dx!==undefined?'\x20AMOUNT\x20(BK15-F09):\x20per-claim\x20bounty\x20pinned\x20at\x20plan\x20time\x20('+String(dx)+')'+(dy?'\x20—\x20'+dy+';\x20override\x20with\x20the\x20reward_claim_amount\x20input':'')+'\x20—\x20no\x20execution-time\x20fill\x20needed.'+dz:'')+(dB!==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).':'')+(dD!==undefined?'\x20EVIDENCE\x20(ksk9d2-tn-261026\x20F-01):\x20the\x20guard\x20carries\x20an\x20evidence\x20binding\x20—\x20at\x20claim\x20the\x20'+'chain\x20counts\x20repository\x20rows\x20under\x20the\x20binding\x27s\x20(repo,\x20key)\x20matching\x20the\x20predicate\x20for\x20'+'THIS\x20claim\x27s\x20own\x20store_from\x20value\x20(the\x20submitted\x20order)\x20and\x20aborts\x2015\x20'+'(E_EVIDENCE_NOT_OWNED)\x20when\x20none:\x20a\x20borrowed\x20foreign\x20row\x20can\x20never\x20satisfy\x20the\x20bounty;\x20'+'the\x20order\x27s\x20attestation\x20row\x20must\x20exist\x20before\x20the\x20claim.'+'\x20PACKAGE\x20AVAILABILITY\x20(ksr-tn-261026\x20Q8-F04):\x20the\x20native\x20evidence-pinning\x20entry\x20is\x20'+'UNAVAILABLE\x20on\x20the\x20currently\x20deployed\x20package\x20—\x20batch\x20guard_add\x20submissions\x20silently\x20'+'DROP\x20the\x20pin\x20and\x20the\x20direct\x20face\x20hard-fails\x20with\x20a\x20missing-entry\x20error\x20(classified\x20'+'capability_unavailable,\x20non-retryable).\x20The\x20reward\x20guard_add\x20read-back\x20contract\x20'+'reports\x20EVIDENCE\x20BINDING\x20VERIFIED\x20/\x20NOT\x20ON\x20CHAIN\x20after\x20the\x20landed\x20call\x20—\x20treat\x20NOT\x20ON\x20'+'CHAIN\x20as\x20the\x20truth:\x20fall\x20back\x20to\x20the\x20repository-floor\x20guard\x20leg\x20and\x20disclose\x20that\x20it\x20'+'proves\x20only\x20\x27a\x20qualifying\x20row\x20exists\x20for\x20this\x20order\x27,\x20not\x20who\x20wrote\x20it.\x20Do\x20not\x20'+'re-send\x20guard_add\x20to\x20\x27fix\x27\x20a\x20dropped\x20pin.':'')}),k['push']({'op':'configure','id':'service_rewards','target':ref('service'),'method':'rewards','params':P({'op':'add','objects':[ref('reward_review')]}),'requires':['service']}),typeof dv==='string'||typeof dv==='number'?k['push']({'op':'configure','id':'reward_review_coin_add','target':ref('reward_review'),'method':'coin_add','params':{'coin':String(dv)},'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(R){k['push']({'op':'create','id':'arbitration','object':'arbitration','params':P({'name':h+'_arbitration','permission':ref('permission_arb'),'type_parameter':ai}),'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 dP=b['compensation_fund'];if(typeof dP==='string'||typeof dP==='number')k['push']({'op':'configure','id':'service_compensation','target':ref('service'),'method':'compensation_fund_add','params':{'balance':String(dP)}});else{const dQ=v['some'](dR=>{if(dR['semantic_role']!=='final')return![];for(const dS of dR['from']??[]){if(typeof dS==='string')continue;const dT=dS['guard_key']===undefined?undefined:B['get'](dS['guard_key']);if(dT?.['template_id']==='tpl_forward_arb_ruling_won')return!![];}return![];});dQ&&j['push']({'code':'COMPENSATION_FUND_REQUIRED','detail':'This\x20build\x20routes\x20a\x20POST-settlement\x20arbitration\x20re-route\x20(an\x20arb-ruling-won\x20guard\x20on\x20an\x20edge\x20'+'leaving\x20a\x20settled\x20terminal):\x20the\x20escrow\x20is\x20already\x20drained\x20when\x20that\x20ruling\x20lands,\x20so\x20the\x20buyer\x27s\x20'+'only\x20remedy\x20is\x20the\x20compensation\x20fund\x20—\x20which\x20this\x20build\x20never\x20creates.\x20Pass\x20'+'inputs.compensation_fund\x20(>=\x20the\x20largest\x20single-order\x20exposure)\x20so\x20the\x20indemnity\x20is\x20real,\x20'+'or\x20rebuild\x20on\x20a\x20template\x20without\x20the\x20post-settlement\x20arb\x20edge.'});}}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 ap=new Set(w['map'](dR=>dR['guard_key'])['filter'](dR=>typeof dR==='string')),aq=/^0x[0-9a-fA-F]{20,64}$/,ar=dR=>{const dS=J['get'](dR);if(dS===undefined)return undefined;for(const dT of dS['table']){const dU=dT;if(dU['b_submission']===!![]||dU['value_type']!=='Address')continue;const dV=dU['value'];if(typeof dV==='string'&&aq['test'](dV))return String(dU['identifier']??'?');}return undefined;};for(const dR of J['keys']()){if(!M['has'](dR)&&!ap['has'](dR))continue;const dS=ar(dR);dS!==undefined&&j['push']({'code':'GUARD_FOREIGN_SERVICE','detail':'guard\x20\x27'+dR+'\x27\x20pins\x20an\x20on-chain\x20address\x20literal\x20(table\x20slot\x20'+dS+')\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 dT=new Map(),dU=new Map();for(const e0 of k){if(e0['op']!=='create'||e0['object']!=='repository')continue;const e1=e0['params'],e2=new Set(),e3=new Set(),e4=Array['isArray'](e1['policies'])?e1['policies']:[];for(const e6 of e4){if(typeof e6['name']==='string')e2['add'](e6['name']);const e7=Array['isArray'](e6['write_guard'])?e6['write_guard']:[];for(const e8 of e7){const e9=e8['guard'];if(typeof e9==='string')e3['add'](e9);else e9!==null&&typeof e9==='object'&&typeof e9['$ref']==='string'&&e3['add'](e9['$ref']);}}const e5={'keys':e2,'writeGuardSteps':e3};dT['set'](e0['id'],e5);if(typeof e1['name']==='string')dU['set'](e1['name'],e5);}const dV=new Map();for(const ea of J['values']()){if(ea['stepId']!==undefined)dV['set'](ea['stepId'],{'table':ea['table'],'root':ea['root']});}const dW=(eb,ec)=>ec===undefined?undefined:eb['find'](ed=>ed['identifier']===ec),dX=(eb,ec)=>{const ed=dW(eb,ec)?.['value'];if(ed!==null&&typeof ed==='object'&&typeof ed['$ref']==='string')return dT['get'](ed['$ref']);return typeof ed==='string'?dU['get'](ed):undefined;},dY=(eb,ec)=>{const ed=dW(eb,ec)?.['value'];return typeof ed==='string'?ed:undefined;},dZ=(eb,ec)=>{const ed=[],ee=ef=>{if(ef===null||typeof ef!=='object')return;if(Array['isArray'](ef)){for(const eh of ef)ee(eh);return;}const eg=ef;if(eg['type']==='query_repository_data_find_where'){const ei=eg['object'],ej=eg['key'],ek=dX(eb,typeof ei?.['identifier']==='number'?ei['identifier']:undefined),el=dY(eb,typeof ej?.['identifier']==='number'?ej['identifier']:undefined);if(ek!==undefined&&el!==undefined)ed['push']({'repo':ek,'key':el});}if(eg['type']==='query'&&typeof eg['query']==='string'&&/^repository\.data\b/i['test'](eg['query'])){const em=eg['object'],en=dX(eb,typeof em?.['identifier']==='number'?em['identifier']:undefined),eo=Array['isArray'](eg['parameters'])?eg['parameters']:[],ep=dY(eb,typeof eo[0x0]?.['identifier']==='number'?eo[0x0]['identifier']:undefined);if(en!==undefined&&ep!==undefined)ed['push']({'repo':en,'key':ep});}if(eg['type']==='query_repository_data'||eg['type']==='query_repository_data_has'){const eq=eg['object'],er=dX(eb,typeof eq?.['identifier']==='number'?eq['identifier']:undefined),es=typeof eg['key']==='string'?eg['key']:undefined;if(er!==undefined&&es!==undefined)ed['push']({'repo':er,'key':es});}for(const et of Object['keys'](eg))ee(eg[et]);};return ee(ec),ed;};for(const [eb,ec]of J){if(ec['stepId']===undefined)continue;for(const ed of dZ(ec['table'],ec['root'])){!ed['repo']['keys']['has'](ed['key'])&&j['push']({'code':'POLICY_KEY_UNRESOLVED','detail':'guard\x20\x27'+eb+'\x27\x20reads\x20repository\x20policy\x20key\x20\x27'+ed['key']+'\x27,\x20but\x20NO\x20repository\x20create\x20step\x20in\x20this\x20'+'plan\x20defines\x20that\x20policy\x20—\x20policies\x20freeze\x20at\x20Repository\x20creation\x20(REPO-GATE-KEY-01),\x20so\x20the\x20read\x20'+'is\x20identically\x20ZERO:\x20the\x20gated\x20forward\x20never\x20opens\x20and\x20every\x20order\x20freezes\x20mid-rail\x20(bsx\x20BSX-F01:\x20'+'the\x20delivery\x20gate\x20read\x20\x27license_grant\x27\x20while\x20the\x20repository\x20stored\x20\x27grant\x27).\x20Align\x20the\x20guard\x27s\x20row\x20'+'key\x20with\x20a\x20policy\x20name\x20this\x20plan\x20actually\x20creates.'}),ed['repo']['writeGuardSteps']['has'](ec['stepId'])&&j['push']({'code':'CREDENTIAL_CYCLE','detail':'guard\x20\x27'+eb+'\x27\x20is\x20a\x20write\x20credential\x20of\x20a\x20repository\x20policy\x20it\x20also\x20READS\x20(\x27'+ed['key']+'\x27)\x20—\x20to\x20write\x20'+'the\x20row\x20you\x20must\x20first\x20pass\x20a\x20guard\x20requiring\x20the\x20row.\x20Unsatisfiable\x20by\x20construction\x20(bsn7\x20T-01\x20/\x20'+'bsx\x20BSX-F02:\x20the\x20review\x20write\x20credential\x20fell\x20back\x20to\x20the\x20reward-claim\x20guard,\x20which\x20requires\x20the\x20'+'rating\x20row\x20it\x20gates).\x20The\x20write\x20credential\x20must\x20be\x20an\x20identity/progress\x20credential\x20that\x20reads\x20'+'nothing\x20from\x20that\x20repository.'});}}}const as=K['flatMap'](ee=>{const ef=ap['has'](ee['key'])?'allocator':M['has'](ee['key'])?'machine_edge':ee['host']==='service'&&ee['key']==='buy'?'service_buy':undefined;return ef?[{'key':ee['key'],'template_id':ee['template_id'],'host':ee['host'],'site':ef,'purpose':ee['purpose']}]:[];});return{'plan':{'version':0x1,'intent':d['intent']??'compile\x20'+a['id'],'templateId':a['id'],'inputs':b,'steps':k,...as['length']>0x0?{'pending_guards':as}:{}},'guardSpecs':z,'unresolved':K,'blockers':j,'omitted':[...y]};}
|
|
1
|
+
import{fillGuardTemplate,getTemplateById}from'../knowledge/guard-templates.js';import{applyFeeParamBindings}from'../knowledge/fee-param-bindings.js';import{identityDefaultResolution,patternDefaultResolution,progressStateDefaultResolution,timeInstantiationFor}from'../knowledge/pattern-resolutions.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 a13a,afterSalesRailNodeMatches,feeParamCouplingMismatches,windowMathMismatches,incentiveRatingFloorClaims}from'../knowledge/template-scanner.js';import{guardTemplateHasIdentityLeg}from'../knowledge/builtin-templates.js';import{refsOf}from'./plan.js';import{numericAmount}from'../knowledge/audit-rules.js';function normalizeLogicArity(a){if(Array['isArray'](a))return a['map'](normalizeLogicArity);if(a===null||typeof a!=='object')return a;const b=a,c={};for(const [d,e]of Object['entries'](b))c[d]=normalizeLogicArity(e);if((c['type']==='logic_and'||c['type']==='logic_or')&&Array['isArray'](c['nodes'])){const f=c['nodes'];if(f['length']===0x1)return f[0x0];}return c;}const P=a=>a;function lowestSalePrice(a){if(!Array['isArray'](a))return undefined;let b;for(const c of a){const d=numericAmount(c?.['price']);if(d!==undefined&&d>0x0)b=b===undefined?d:Math['min'](b,d);}return b;}function toByteVector(a){if(Array['isArray'](a))return a['every'](c=>typeof c==='number'&&Number['isInteger'](c)&&c>=0x0&&c<=0xff)?a:undefined;if(typeof a==='string'&&a['length']>0x0)return Array['from'](new TextEncoder()['encode'](a));return undefined;}function offTaskSlotIdentityLegs(a){const b=new Set(['order.owner','order.agent\x20has']),c=new Set(['query_order_named_operator_member']),d=new Set(),e=[],f=g=>{if(g===null||typeof g!=='object')return;const h=g;if(h['type']==='logic_equal'&&Array['isArray'](h['nodes'])){const l=h['nodes']['filter'](m=>m!==null&&typeof m==='object'&&m['type']==='identifier'&&typeof m['identifier']==='number');if(l['some'](m=>m['identifier']===TASK_BINDING_SLOT)){for(const m of l)d['add'](m['identifier']);}}const i=h['object'],j=typeof h['query']==='string'&&b['has'](h['query'])||typeof h['type']==='string'&&c['has'](h['type']);if(j&&i!==null&&typeof i==='object'&&typeof i['identifier']==='number'){const o=i['identifier'],p=typeof h['query']==='string'?h['query']:h['type'];if(o!==TASK_BINDING_SLOT)e['push']({'query':p,'identifier':o});}if(Array['isArray'](h['nodes'])){for(const q of h['nodes'])f(q);}if(h['node']!==undefined&&typeof h['node']==='object')f(h['node']);};return f(a),e['filter'](g=>!d['has'](g['identifier']));}export function normalizeInlineGuardTable(a,b){const c=b+'_service',d=f=>f['replace'](/\//g,'_'),e=d(c);return a['map'](f=>{if(f===null||typeof f!=='object'||Array['isArray'](f))return f;const g={...f};typeof g['value']==='string'&&d(g['value'])===e&&(g['value']=ref('service'));if(g['b_submission']===undefined)g['b_submission']=![];return g;});}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,h={}){const i=h['nameBase']??a['id']['replace'](/\//g,'_'),j=h['merchantPermissionIndex']??0x3e8,k=[],l=[];b['review_reward_pool']!==undefined&&b['reward_funding']===undefined&&(b={...b,'reward_funding':b['review_reward_pool']});const q=[];{const aL=a['fee_params'],aM=aL['campaign_deadline_ms']!==undefined,aN=aL['campaign_duration_days']!==undefined;if(aM&&aN){const aO=aW=>{if(aW===undefined||aW===null||aW==='')return undefined;const aX=typeof aW==='number'?aW:Number(aW);return Number['isFinite'](aX)?aX:undefined;},aP=aO(b['campaign_deadline_ms']),aQ=aO(b['campaign_duration_days']),aR=aO(aL['campaign_deadline_ms']),aS=aO(aL['campaign_duration_days']),aT=aQ??aS,aU=aP!==undefined&&aP>0x0?aP:aR,aV=aQ!==undefined||aU===undefined||aU===0x0;if(h['buildTimeMs']!==undefined&&aT!==undefined&&aT>0x0&&aV){const aW=Math['round'](h['buildTimeMs']+aT*0x5265c00);aQ!==undefined&&aU!==undefined&&aU>0x0&&aU!==aW?k['push']({'code':'CAMPAIGN_DEADLINE_CONFLICT','detail':'campaign_deadline_ms\x20('+aU+')\x20and\x20campaign_duration_days\x20('+aT+'\x20→\x20'+aW+'\x20at\x20this\x20'+'build\x20instant)\x20name\x20different\x20instants.\x20ONE\x20campaign\x20has\x20ONE\x20deadline:\x20pass\x20either\x20the\x20'+'absolute\x20timestamp\x20or\x20the\x20length\x20in\x20days,\x20and\x20drop\x20the\x20other\x20(0\x20=\x20unset\x20is\x20not\x20a\x20deadline).'}):(b={...b,'campaign_deadline_ms':aW},q['push']({'param':'campaign_deadline_ms','from':'campaign_duration_days','input':aT,'value':aW,'at_ms':h['buildTimeMs'],'note':'converted\x20at\x20generation:\x20'+aT+'\x20day(s)\x20after\x20the\x20build\x20instant\x20'+('('+new Date(h['buildTimeMs'])['toISOString']()+')\x20became\x20the\x20ABSOLUTE\x20campaign\x20')+('deadline\x20epoch-ms\x20'+aW+'\x20—\x20the\x20value\x20every\x20deadline\x20gate\x20and\x20the\x20pre-deadline\x20')+'withdrawal\x20window\x20now\x20read\x20on\x20chain'}));}}}const t=new Set();for(const aX of a['conditional_guards']??[]){const aY=b[aX['param']]??a['fee_params'][aX['param']];if(aY!==aX['emit_value'])t['add'](aX['guard_key']);}{const aZ=new Map();for(const b0 of a['conditional_guards']??[]){const b1=aZ['get'](b0['param']);if(b1===undefined)aZ['set'](b0['param'],new Set(b0['values']??[]));else{for(const b2 of b0['values']??[])b1['add'](b2);}}for(const [b3,b4]of aZ){if(b4['size']===0x0)continue;const b5=b[b3];if(b5===undefined||b5===null||b5==='')continue;const b6=String(b5);if(b4['has'](b6))continue;k['push']({'code':'SELECTOR_VALUE_UNKNOWN','detail':'build\x20input\x20\x27'+b3+'\x27\x20=\x20\x27'+b6+'\x27\x20is\x20outside\x20the\x20value\x20set\x20this\x20template\x20accepts\x20'+('('+[...b4]['join']('\x20|\x20')+').\x20The\x20param\x20drives\x20a\x20conditional\x20guard\x20emission,\x20so\x20an\x20out-of-set\x20answer\x20')+'used\x20to\x20compile\x20the\x20DEFAULT\x20business\x20model\x20silently\x20instead\x20of\x20the\x20one\x20asked\x20for\x20—\x20on\x20the\x20'+'storefront_mode\x20/\x20deposit_exit_policy\x20families\x20that\x20means\x20a\x20public\x20storefront\x20or\x20a\x20refunded\x20deposit\x20'+'with\x20no\x20warning\x20at\x20all.\x20Answer\x20one\x20of\x20the\x20accepted\x20values,\x20or\x20drop\x20the\x20input\x20to\x20take\x20the\x20declared\x20'+('default\x20(\x27'+String(a['fee_params'][b3]??'none')+'\x27).')});}}const u=new Map();for(const b7 of a['conditional_guards']??[]){u['set'](b7['param'],(u['get'](b7['param'])??0x0)+0x1);}const w=new Set((a['conditional_guards']??[])['filter'](b8=>(u['get'](b8['param'])??0x0)>0x1)['map'](b8=>b8['guard_key'])),x=new Set([...t]['filter'](b8=>w['has'](b8))),y=x['size']>0x0?a['machine_shape']['map'](b8=>({...b8,'from':(b8['from']??[])['filter'](b9=>typeof b9==='string'||b9['guard_key']===undefined||!x['has'](b9['guard_key']))})):a['machine_shape'],z=x['size']>0x0?(a['allocator']['rows']??[])['filter'](b8=>b8['guard_key']===undefined||!x['has'](b8['guard_key'])):a['allocator']['rows']??[],A={};a['guards']['forEach']((b8,b9)=>{const ba=b8['key']??b8['template_id']+'#'+b9;if(x['has'](ba))return;const bb=patternDefaultResolution(a['id'],ba)??progressStateDefaultResolution(a,b8)??identityDefaultResolution(a,b8);if(bb!==undefined)A[ba]=bb;}),Object['assign'](A,h['guardResolutions']??{});const B=[];for(const [b8,b9]of Object['entries'](h['guardResolutions']??{})){if(b9?.['kind']==='omit')B['push'](b8);}const C=new Set();if(B['length']>0x0){const ba=new Set(y['flatMap'](bc=>(bc['from']??[])['map'](bd=>typeof bd==='string'?undefined:bd['guard_key'])['filter'](bd=>typeof bd==='string'))),bb=new Set(z['map'](bc=>bc['guard_key'])['filter'](bc=>typeof bc==='string'));for(const bc of B){const bd=a['guards']['find']((bf,bg)=>(bf['key']??bf['template_id']+'#'+bg)===bc);if(bd===undefined)continue;const be=[];if(ba['has'](bc))be['push']('a\x20machine\x20forward\x20edge\x20(guard_key)');if(bb['has'](bc))be['push']('an\x20allocator\x20rail\x20row\x20(guard_key)');if(bd['policy']!==undefined)be['push']('a\x20Repository\x20write-policy\x20credential\x20(policy)');if(bd['host']==='service'&&bc==='buy')be['push']('the\x20Service\x20buy\x20gate\x20(buy_guard)');be['length']>0x0?k['push']({'code':'GUARD_OMIT_UNSUPPORTED','detail':'guard_resolutions[\x27'+bc+'\x27]\x20=\x20{kind:\x27omit\x27}\x20refused:\x20this\x20design\x20is\x20bound\x20to\x20'+be['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.'}):C['add'](bc);}}const D=a['guards']['map']((bf,bg)=>{const bh=bf['key']??bf['template_id']+'#'+bg,bi=applyFeeParamBindings(bf['params'],a['id'],bh,b,a['fee_params']);return{'key':bh,'template_id':bf['template_id'],'host':bf['host'],'purpose':bf['purpose'],'policy':bf['policy'],'params':bi};})['filter'](bf=>!t['has'](bf['key'])&&!C['has'](bf['key'])),E=new Map();{const bf=new Set(D['map'](bh=>bh['key'])),bg=bh=>{if(bh===undefined)return![];const bi=D['find'](bk=>bk['key']===bh);if(bi===undefined)return![];const bj=A[bh];return bj?.['kind']==='inline'||bj?.['kind']==='template'||bi['template_id']['startsWith']('tpl_');};for(const bh of y){for(const bi of bh['from']??[]){const bj=typeof bi==='string'?{'prev':bi}:bi,bk=bj['operator']??bh['operator']??(bj['prev']===''?'order_payer':'merchant');if(bk!=='order_payer')continue;if(bj['guard_key']!==undefined&&bg(bj['guard_key']))continue;const bl=bj['forward']??(bj['prev']===''?'enter_'+bh['name']:bj['prev']+'_to_'+bh['name']);if(E['has'](bl))continue;let bm='order_holder_'+bl;while(bf['has'](bm))bm=bm+'_x';bf['add'](bm),E['set'](bl,bm);const bn=bj['guard_key']===undefined?'Declare\x20an\x20explicit\x20order-holder\x20guard_key\x20on\x20the\x20edge\x20to\x20replace\x20this\x20auto\x20key\x20with\x20a\x20named\x20credential.':'The\x20edge\x20DOES\x20declare\x20guard_key\x20\x27'+bj['guard_key']+'\x27,\x20but\x20that\x20design\x20does\x20not\x20resolve\x20to\x20a\x20Guard\x20object,\x20so\x20the\x20forward\x20would\x20otherwise\x20ship\x20unguarded;\x20resolve\x20\x27'+bj['guard_key']+'\x27\x20(guard_resolutions,\x20or\x20re-point\x20the\x20spec\x20at\x20an\x20instantiable\x20tpl_*\x20id)\x20to\x20carry\x20the\x20richer\x20condition\x20—\x20this\x20identity\x20leg\x20stays\x20bound\x20either\x20way.';D['push']({'key':bm,'template_id':'tpl_forward_order_holder','host':'machine','purpose':'F05\x20kernel-injected\x20order-holder\x20identity\x20binding\x20for\x20the\x20buyer-exclusive\x20forward\x20'+('\x27'+bl+'\x27\x20(edge\x20\x27'+bj['prev']+'\x27->\x27'+bh['name']+'\x27):\x20namedOperator\x20\x22\x22\x20passes\x20for\x20')+'anyone\x20at\x20the\x20permission\x20layer,\x20so\x20without\x20this\x20guard\x20the\x20'+'buyer\x20rail\x20is\x20advanceable\x20by\x20ANY\x20passport\x20holder\x20attached\x20to\x20the\x20order\x20—\x20takeover\x20'+('risk.\x20'+bn)});}}}const F=new Map(D['map'](bo=>[bo['key'],bo])),G=b['review_mode'],H=G==='review'||G==='review_reward'||G==='none'?G:undefined,I=H??a['review_mode']??'none',J=i+'_review_reward',K=bo=>{const bp=b[bo]??a['fee_params'][bo];if(typeof bp==='number'&&Number['isFinite'](bp))return bp;if(typeof bp==='string'&&bp['trim']()!==''&&Number['isFinite'](Number(bp)))return Number(bp);return undefined;},L=0x4,M=K('reward_rating_floor'),N=M??L,O=K('reward_claim_opens_after_days'),Q=K('reward_claim_closes_after_days'),R=0xe,S=0xe,T=a['fee_params']['return_window_days']??a['fee_params']['review_window_days'],U=typeof T==='number'&&Number['isFinite'](T)&&T>0x0?T:0x0,V=Math['max'](R,U+0x1),W=O??V,X=Q??S;if(I==='review_reward'){const bo=D['find'](bs=>bs['host']==='reward'),bp=bo!==undefined?A[bo['key']]:undefined,bq=bp!==undefined&&(bp['kind']==='template'||bp['kind']==='inline'),br=bo!==undefined&&(bo['template_id']['startsWith']('tpl_')||bq);if(bo===undefined||!br){const bs=y['find'](bw=>/review/i['test'](bw['name'])),bt=y['filter'](bw=>bw['semantic_role']==='final')['map'](bw=>bw['name']),bu=bs?.['name']??bt[0x0],bv=[...new Set([bu,...bt])]['slice'](0x0,0x4);if(bu!==undefined){const bw=new Set([bu,...bt])['size']>0x4,bx=N>0x0,by=bx?'Rating\x20leg\x20ARMED\x20on\x20the\x20plan-created\x20\x27'+i+'_review\x27\x20repository\x20/\x20\x27rating\x27\x20policy\x20(order-keyed\x20U64):\x20pays\x20only\x20at\x20rating\x20>=\x20'+N+'\x20(reward_rating_floor\x20input'+(M===undefined?'\x20—\x20S14\x20default\x20'+L+',\x20no\x20input\x20given':'')+').':'No\x20rating\x20leg\x20—\x20reward_rating_floor\x20was\x20EXPLICITLY\x20set\x20to\x200\x20(plain\x20praise\x20bounty\x20opt-out,\x20S14\x20default\x20is\x20'+L+').',bz=O!==undefined?'Claim\x20window:\x20opens\x20'+W+'\x20day(s)\x20after\x20the\x20claim-allowed\x20entry\x20(reward_claim_opens_after_days\x20input;\x20overrides\x20the\x20after-sales-expiry\x20derivation\x20—\x20keep\x20it\x20ABOVE\x20the\x20store\x27s\x20return/review\x20window\x20or\x20the\x20claim-and-return\x20arbitrage\x20re-opens,\x20tbs7\x20F-04),\x20claimable\x20for\x20a\x20further\x20'+X+'\x20day(s)\x20(bsw4\x20F-11\x20close).':'Claim\x20window:\x20opens\x20'+W+'\x20day(s)\x20after\x20the\x20claim-allowed\x20entry\x20(derived\x20after-sales\x20expiry\x20+\x201d,\x20floored\x20at\x2014d\x20—\x20tbs7\x20F-04:\x20the\x20bounty\x20opens\x20only\x20after\x20the\x20return/review\x20window\x20closed),\x20claimable\x20for\x20a\x20further\x20'+X+'\x20day(s)\x20(bsw4\x20F-11:\x20the\x20window\x20CLOSES\x20—\x20a\x20real\x20deadline,\x20counted\x20from\x20the\x20open).',bA={'reward_address':'review_pool','expected_pre_claim_node':bv[0x0],'expected_pre_claim_node_alt':bv[0x1]??bu,'expected_pre_claim_node_alt2':bv[0x2]??bu,'expected_pre_claim_node_alt3':bv[0x3]??bu,...bx?{'rating_repository':i+'_review','rating_policy_name':'rating','rating_floor':String(N)}:{'rating_repository':''},'opens_after_days':String(W),'closes_after_days':String(X)};if(bo===undefined){let bB='reward_claim_default';while(D['some'](bC=>bC['key']===bB))bB=bB+'_x';D['push']({'key':bB,'template_id':'tpl_reward_one_time_claim','host':'reward','purpose':'4R-02\x20kernel-injected\x20DEFAULT\x20claim\x20guard\x20for\x20review_mode\x20\x27review_reward\x27\x20(the\x20template\x20'+('declares\x20no\x20reward\x20spec):\x20claim-allowed\x20SET\x20{'+bv['join'](',\x20')+'}'+(bw?'\x20(TRUNCATED\x20to\x20the\x204\x20template\x20slots\x20—\x20the\x20shape\x20carries\x20more\x20terminals;\x20declare\x20an\x20explicit\x20host:\x22reward\x22\x20spec)':'')+',\x20')+'bounty\x20derived\x20T-02\x20(2%\x20of\x20the\x20cheapest\x20SKU,\x20floored\x20at\x201),\x20funding\x20fail-closed\x20'+('(REVIEW_REWARD_UNFUNDED).\x20'+by+'\x20'+bz+'\x20Declare\x20an\x20explicit\x20host:\x22reward\x22\x20guard\x20spec\x20to\x20replace\x20this\x20')+'default\x20with\x20a\x20named\x20design.','params':bA});}else{const bC=bo['template_id'];bo['template_id']='tpl_reward_one_time_claim',bo['params']=bA,bo['purpose']='4R-02\x20default\x20assembly\x20replaced\x20the\x20unresolved\x20design\x20reference\x20(was\x20\x27'+bC+'\x27\x20with\x20no\x20'+('caller\x20resolution):\x20claim-allowed\x20SET\x20{'+bv['join'](',\x20')+'}'+(bw?'\x20(TRUNCATED\x20to\x20the\x204\x20template\x20slots\x20—\x20declare\x20an\x20explicit\x20spec\x20or\x20resolve\x20this\x20key\x20to\x20cover\x20every\x20terminal)':'')+'.\x20')+(by+'\x20'+bz+'\x20Resolve\x20this\x20key\x20via\x20guard_resolutions\x20(kind\x20\x27inline\x27\x20or\x20\x27template\x27)\x20to\x20override\x20the\x20')+'default\x20mount\x20per\x20build.';}}}}const Y=new Set(['wip_provenance','subscription_with_proof']),Z=Array['isArray'](b['adopted_module_ids'])?b['adopted_module_ids']['filter'](bD=>typeof bD==='string'):[],a0=D['some'](bD=>bD['host']==='repository'||bD['template_id']==='pattern.repository_data_check'||bD['template_id']==='pattern.repository_write_authorization'||bD['template_id']==='tpl_repository_row_present'||bD['template_id']==='tpl_repository_row_equals_order_field'||bD['template_id']==='tpl_holder_confirm_evidence_gate')||Z['some'](bD=>Y['has'](bD)),a1=new Map(),a2=[],a3=D['map'](bD=>bD['key']);for(const bD of Object['keys'](h['guardResolutions']??{})){if(C['has'](bD))continue;!F['has'](bD)&&k['push']({'code':'GUARD_RESOLUTION_UNKNOWN','detail':'guard_resolutions\x20key\x20\x27'+bD+'\x27\x20matches\x20no\x20guard\x20spec\x20key\x20declared\x20by\x20\x27'+i+'\x27.\x20'+('Legal\x20keys:\x20'+(a3['length']>0x0?a3['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 bE of D){const bF='guard_'+safeId(bE['key']),bG=A[bE['key']];let bH=bE['purpose'],bI,bJ;if(bG?.['kind']==='inline')bI=normalizeInlineGuardTable(bG['table'],i),bJ=bG['root'],bH=bG['description']??bE['purpose'];else{const bK=bG?.['kind']==='template'?bG['template_id']:bE['template_id']['startsWith']('tpl_')?bE['template_id']:undefined;if(bK!==undefined){const bL={'service_name':i+'_service',...a0?{'repository_name':i+'_evidence'}:{},...I!=='none'?{'review_repository':i+'_review'}:{},...a['arbitration_mode']!==undefined&&a['arbitration_mode']!=='none'?{'arbitration_name':i+'_arbitration'}:{},...a['fee_params'],...b,...bE['params'],...bG?.['kind']==='template'?bG['params']:{}},bM=fillGuardTemplate(bK,bL);!bM['ok']?k['push']({'code':'GUARD_TEMPLATE_PARAMS','detail':'guard\x20\x27'+bE['key']+'\x27\x20('+bK+'):\x20'+bM['error']}):(bI=bM['table'],bJ=bM['root']);}}bI!==undefined?(a1['set'](bE['key'],{'stepId':bF,'description':bH,'table':bI,'root':normalizeLogicArity(bJ)}),bE['step_id']=bF):(!bE['template_id']['startsWith']('tpl_')&&getTemplateById(bE['template_id'])===undefined&&!GUARD_DESIGN_PATTERNS['some'](bN=>bN['id']===bE['template_id'])&&k['push']({'code':'GUARD_PATTERN_UNKNOWN','detail':'guard\x20\x27'+bE['key']+'\x27\x20of\x20\x27'+i+'\x27\x20references\x20design\x20\x27'+bE['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).'}),a2['push'](bE));}for(const bN of feeParamCouplingMismatches(a)){k['push']({'code':'FEE_PARAM_COUPLING_MISMATCH','detail':'guard\x20\x27'+bN['key']+'\x27\x20('+bN['template_id']+')\x20claims\x20to\x20mirror\x20fee_param\x20\x27'+bN['param']+'\x27\x20('+bN['declared']+')\x20but\x20carries\x20no\x20matching\x20'+('numeric\x20literal\x20(params:\x20'+(bN['literals']['length']>0x0?bN['literals']['join'](',\x20'):'none')+').\x20The\x20guard\x20literal\x20is\x20the\x20ONLY\x20value\x20that\x20')+'becomes\x20on-chain\x20—\x20the\x20fee\x20param\x20the\x20merchant\x20sets\x20stays\x20decorative\x20(rex5-tn-261028\x20T-02).\x20'+('Re-sync\x20the\x20literal\x20with\x20fee_param\x20\x27'+bN['param']+'\x27\x20or\x20drop\x20the\x20coupling\x20claim\x20from\x20the\x20purpose.')});}for(const bO of windowMathMismatches(a)){k['push']({'code':'WINDOW_MATH_MISMATCH','detail':bO['rule']==='R-WINDOW-MATH-ZERO'?'settlement\x20window\x20fee_param\x20\x27'+bO['settle_param']+'\x27\x20=\x20'+bO['settle_value']+':\x20the\x20escrow\x20releases\x20the\x20moment\x20the\x20anchor\x20node\x20is\x20entered,\x20so\x20every\x20buyer\x20window\x20is\x20structurally\x20dead\x20from\x20the\x20first\x20order\x20(ksk4\x20F-35).\x20'+'Set\x20it\x20to\x20a\x20positive\x20duration\x20that\x20covers\x20the\x20after-sales\x20schedule.':'settlement\x20window\x20fee_param\x20\x27'+bO['settle_param']+'\x27\x20('+bO['settle_value']+')\x20opens\x20the\x20release\x20before\x20buyer\x20window\x20'+bO['violates']+'\x20closes\x20—\x20the\x20refund\x20rail\x20is\x20structurally\x20dead\x20from\x20the\x20release\x20moment,\x20since\x20settlement\x20drains\x20the\x20allocation\x20balance\x20and\x20every\x20later\x20refund\x20leg\x20aborts\x20on\x20empty\x20(ktt3\x20F-05).\x20'+'Raise\x20the\x20settlement\x20window\x20to\x20>=\x20the\x20largest\x20buyer\x20window,\x20or\x20shorten\x20the\x20buyer\x20window\x20to\x20match\x20the\x20real\x20policy;\x20re-sync\x20guards[].params\x20with\x20the\x20new\x20fee_params\x20value\x20(FEE_PARAM_COUPLING_MISMATCH).'});}const a4=incentiveRatingFloorClaims(a);if(a4['length']>0x0){const bP=[...new Set(a4['map'](bR=>'\x27'+bR['excerpt']+'\x27\x20('+bR['field']+')'))]['join'](',\x20'),bQ=[...new Set(a4['map'](bR=>bR['claimed']))];if(I!=='review_reward')k['push']({'code':'INCENTIVE_RATING_FLOOR_MISMATCH','detail':'incentive\x20prose\x20promises\x20a\x20rating\x20floor\x20('+bP+')\x20but\x20review_mode\x20is\x20\x27'+I+'\x27\x20—\x20no\x20reward\x20track\x20'+'exists,\x20so\x20the\x20promise\x20pays\x20nothing\x20regardless\x20of\x20rating\x20(ktt3\x20F02/F12\x20residual).\x20'+('Build\x20with\x20review_mode\x20\x27review_reward\x27\x20and\x20reward_rating_floor\x20=\x20'+bQ['join']('/')+',\x20or\x20drop\x20the\x20promise\x20from\x20the\x20prose.')});else{const bR=D['find'](bY=>bY['host']==='reward'),bS=bR!==undefined?A[bR['key']]:undefined,bT=bS?.['kind']==='template'&&bS['params']?{...bR?.['params']??{},...bS['params']}:bR?.['params']??{},bU=bT['rating_floor'],bV=typeof bU==='number'&&Number['isFinite'](bU)?bU:typeof bU==='string'&&bU['trim']()!==''&&Number['isFinite'](Number(bU))?Number(bU):undefined,bW=Math['max'](0x0,...a4['filter'](bY=>bY['kind']==='praise')['map'](bY=>bY['claimed'])),bX=[...new Set(a4['filter'](bY=>bY['kind']==='numeric')['map'](bY=>bY['claimed']))];if(bV===undefined||bV<=0x0){const bY=bS?.['kind']==='inline'?'the\x20claim\x20guard\x20is\x20a\x20hand-designed\x20inline\x20root\x20compile\x20cannot\x20statically\x20parse\x20—\x20verify\x20its\x20rating\x20leg\x20yourself':'the\x20reward\x20track\x20carries\x20NO\x20rating\x20leg\x20(reward_rating_floor:\x200\x20explicit\x20opt-out,\x20or\x20a\x20reward\x20spec\x20without\x20rating_floor\x20—\x20the\x20S14\x20default\x20only\x20arms\x20the\x20kernel\x20DEFAULT\x20assembly)';k['push']({'code':'INCENTIVE_RATING_FLOOR_MISMATCH','detail':'incentive\x20prose\x20promises\x20a\x20rating\x20floor\x20('+bP+')\x20but\x20the\x20compiled\x20reward\x20track\x20carries\x20NO\x20statically\x20visible\x20'+('rating\x20leg:\x20'+bY+'\x20—\x20the\x20bounty\x20pays\x20even\x20at\x20rating\x201\x20while\x20the\x20store\x20page\x20advertises\x20the\x20floor\x20')+('(ktt3\x20F02/F12\x20residual;\x20S14\x20default\x20arms\x20'+L+').\x20Pass\x20reward_rating_floor\x20=\x20'+bQ['join']('/')+'\x20to\x20arm\x20it,\x20or\x20drop\x20the\x20promise\x20from\x20the\x20prose.')});}else{if(bW>0x0&&bV<bW)k['push']({'code':'INCENTIVE_RATING_FLOOR_MISMATCH','detail':'incentive\x20prose\x20promises\x20a\x20GOOD-review\x20reward\x20('+bP+')\x20—\x20a\x20praise\x20promise\x20derives\x20to\x20floor\x20'+(bW+'\x20(good\x20==\x204+,\x20S14)\x20—\x20but\x20the\x20armed\x20floor\x20is\x20'+bV+':\x20ratings\x20between\x20'+bV+'\x20')+('and\x20'+(bW-0x1)+'\x20would\x20PAY\x20while\x20the\x20store\x20page\x20advertises\x20a\x20good-review-only\x20bounty\x20')+('(ktt3\x20F02/F12\x20residual,\x20S14\x20praise\x20shape).\x20Raise\x20reward_rating_floor\x20to\x20>=\x20'+bW+',\x20or\x20rewrite\x20the\x20prose.')});else bX['length']>0x0&&!bX['includes'](bV)&&k['push']({'code':'INCENTIVE_RATING_FLOOR_MISMATCH','detail':'incentive\x20prose\x20promises\x20rating\x20floor\x20'+bX['join']('/')+'\x20('+bP+')\x20but\x20the\x20armed\x20floor\x20is\x20'+bV+'\x20—\x20'+'orders\x20at\x20the\x20promised\x20rating\x20would\x20be\x20REJECTED\x20by\x20the\x20claim\x20guard\x20while\x20the\x20store\x20page\x20advertises\x20it\x20'+'(ktt3\x20F02/F12\x20residual).\x20Align\x20reward_rating_floor\x20with\x20the\x20prose,\x20or\x20rewrite\x20the\x20prose.'});}}}const a5=new Set(y['flatMap'](bZ=>(bZ['from']??[])['map'](c0=>typeof c0==='string'?undefined:c0['guard_key'])['filter'](c0=>typeof c0==='string')));for(const bZ of z){typeof bZ['guard_key']==='string'&&bZ['recipient']==='guard_identifier'&&bZ['recipient_key']===String(TASK_BINDING_SLOT)&&a5['add'](bZ['guard_key']);}const a6=new Set();for(const c0 of D){if(!a5['has'](c0['key']))continue;const c1=a1['get'](c0['key']);if(c1===undefined)continue;const c2=c1['table']['some'](c3=>c3['identifier']===TASK_BINDING_SLOT);if(c2)continue;a1['set'](c0['key'],{...c1,'table':[...c1['table'],{'identifier':TASK_BINDING_SLOT,'b_submission':!![],'value_type':'Address','name':'task_binding\x20order\x20anchor\x20(protocol\x20slot\x20254;\x20written\x20by\x20order\x20creation)'}]}),a6['add'](c0['key']);}{const c3=a['settlement_window_merge'];if(c3!==undefined&&c3['length']>0x0){const c4=a['fee_params'],c5=c9=>{const ca=b[c9]??c4[c9];if(ca===undefined||ca===null)return undefined;const cb=typeof ca==='number'?ca:Number(ca);return Number['isFinite'](cb)&&cb>=0x0?cb:undefined;};let c6=0x0;for(const c9 of c3){const ca=c5(c9);if(ca===undefined){c6=undefined;break;}c6+=ca;}const c7='settlement_window_merge\x20['+c3['join']('\x20+\x20')+']',c8=D['find'](cb=>{const cc=timeInstantiationFor(a['id'],cb['key']);return cc!==undefined&&cc['direction']==='lower'&&cc['days']!==undefined&&c3['includes'](cc['days']);});if(c6===undefined)k['push']({'code':'MERGED_LOCK_MISMATCH','detail':c7+':\x20a\x20merged\x20window\x20has\x20no\x20readable\x20day\x20value,\x20so\x20the\x20effective\x20release\x20lock\x20cannot\x20be\x20'+'determined.\x20Declare\x20every\x20merged\x20key\x20as\x20a\x20numeric\x20fee_param\x20(or\x20supply\x20it\x20as\x20an\x20input).'});else{if(c8===undefined)k['push']({'code':'MERGED_LOCK_MISMATCH','detail':c7+'\x20(=\x20'+c6+'\x20days)\x20declares\x20a\x20merged\x20release\x20lock,\x20but\x20no\x20compiled\x20settlement\x20gate\x20'+'(\x22lower\x22\x20time\x20instantiation\x20whose\x20day\x20knob\x20is\x20one\x20of\x20the\x20merged\x20keys)\x20carries\x20it\x20—\x20the\x20'+'declaration\x20would\x20be\x20prose\x20while\x20the\x20escrow\x20releases\x20before\x20the\x20merged\x20windows\x20finish.'});else{if(A[c8['key']]?.['kind']!=='inline'&&a1['has'](c8['key'])){const cb=a1['get'](c8['key'])['table'];let cc;for(const cd of cb){if(cd['identifier']!==0x3)continue;const ce=cd['value'],cf=typeof ce==='number'?ce:Number(ce);if(Number['isFinite'](cf))cc=cf;}cc!==c6&&k['push']({'code':'MERGED_LOCK_MISMATCH','detail':c7+'\x20=\x20'+c6+'\x20days\x20by\x20declaration,\x20but\x20guard\x20\x27'+c8['key']+'\x27\x20compiled\x20its\x20length\x20'+('literal\x20to\x20'+(cc===undefined?'(none)':cc+'\x20days')+'.\x20The\x20escrow\x20would\x20')+'release\x20early\x20while\x20a\x20merged\x20buyer\x20window\x20can\x20still\x20draw\x20it.'});}}}}}const a7=cg=>a1['get'](cg)!==undefined&&refsOf({'table':a1['get'](cg)['table'],'root':a1['get'](cg)['root']})['has']('service'),a8=cg=>{const ch=a1['get'](cg),ci=F['get'](cg)?.['purpose'];return{'op':'create','id':ch['stepId'],'object':'guard','params':P({'description':ch['description'],'table':ch['table'],'root':ch['root']}),'notes':a6['has'](cg)?(ci??'Guard')+'\x20[kernel:\x20protocol\x20slot\x20254\x20(task\x20binding)\x20auto-declared]':ci};};l['push']({'op':'create','id':'permission','object':'permission','params':{'name':i+'_permission'}});const a9=a['arbitration_mode']!==undefined&&a['arbitration_mode']!=='none';a9&&l['push']({'op':'create','id':'permission_arb','object':'permission','params':{'name':i+'_arb_permission'},...a['arbitration_mode']==='third_party'?{'account':'arb_controller'}:{},'notes':'MUST\x20be\x20created\x20by\x20a\x20different\x20account\x20than\x20the\x20service\x20permission\x20'+'(E_ARBITRATION_PERMISSION_CONFLICT=33):\x20dispute\x20neutrality.\x20'+'third_party\x20builds\x20declare\x20account\x20\x27arb_controller\x27\x20—\x20provide\x20'+'accounts.arb_controller\x20to\x20plan_execute.'});l['push']({'op':'create','id':'contact','object':'contact','params':{'name':i+'_contact'},'notes':'R8:\x20customer-service\x20channel;\x20mandatory\x20when\x20customer_required\x20is\x20set.'});const aa=b['after_sales_mode'],ab=aa==='return'||aa==='exchange'||aa==='warranty'||aa==='none'?aa:undefined,ac=ab??a['after_sales_mode']??'none',ad=b['acceptance_mode'],ae=ad==='milestone'||ad==='contest'||ad==='bounty'||ad==='agent'||ad==='none'?ad:undefined,af=ae??a['acceptance_mode']??'none',ag=af==='contest'||af==='bounty'||af==='agent',ah=b['installment_mode'],ai=ah==='deposit_balance'||ah==='milestone_n'||ah==='none'?ah:undefined,aj=ai??a['installment_mode']??'none',ak=b['affiliate_mode'],al=ak==='commission'||ak==='none'?ak:undefined,am=al??a['affiliate_mode']??'none',an=b['crowdfunding_mode'],ao=an==='threshold'||an==='flexible'||an==='none'?an:undefined,ap=ao??a['crowdfunding_mode']??'none',aq=b['logistics_mode'],ar=aq==='carrier'||aq==='merchant_managed'||aq==='courier'||aq==='pickup_point'||aq==='none'?aq:undefined,as=ar??a['logistics_mode']??'none',at=cg=>{const ch=new Set(),ci=cj=>{if(Array['isArray'](cj)){for(const cl of cj)ci(cl);return;}if(typeof cj!=='object'||cj===null)return;const ck=cj;if(typeof ck['type']==='string'&&ck['type']['startsWith']('query_reward_record')){const cm=ck['object'];if(cm!==undefined&&typeof cm['identifier']==='number')ch['add'](cm['identifier']);}for(const cn of Object['values'](ck))ci(cn);};return ci(cg),ch;},au=I==='review_reward'?D['find'](cg=>cg['host']==='reward'):undefined;if(I==='review_reward'&&au?.['step_id']!==undefined){const cg=a1['get'](au['key']);if(cg!==undefined){const ch=at(cg['root']);a1['set'](au['key'],{...cg,'table':cg['table']['map'](ci=>{const cj=ci;if(cj['b_submission']===!![]||!ch['has'](cj['identifier']))return ci;return{...cj,'value':{'$late':{'by':'local_name','mark':J}}};})});}l['push']({'op':'create','id':'reward_review','object':'reward','params':P({'name':J,'description':'Review\x20incentive\x20pool\x20(sale-time\x20planned;\x20terms\x20disclosed\x20at\x20quote/buy):\x20claim\x20gated\x20by\x20guard\x20\x27'+au['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§4).\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 av=[];for(const [ci]of a1){a7(ci)?av['push'](ci):l['push'](a8(ci));}if(a0){const cj=Array['isArray'](b['repository_policies'])?b['repository_policies']['filter'](cm=>typeof cm==='object'&&cm!==null):[],ck=[...cj],cl=new Set(cj['map'](cm=>cm['name']));for(const cm of D){if(cm['host']!=='repository'||cm['step_id']===undefined)continue;const cn='host:\x22repository\x22\x20guard\x20\x27'+cm['key']+'\x27\x20(step\x20\x27'+cm['step_id']+'\x27)';if(cm['policy']===undefined){k['push']({'code':'REPO_GUARD_POLICY_MISSING','detail':cn+'\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(a7(cm['key'])){k['push']({'code':'REPO_GUARD_POLICY_MISSING','detail':cn+'\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 co=cm['policy']['name']??cm['key'],cp=(cm['policy']['id_from']??'none')['toLowerCase'](),cq=cm['policy']['id_from_submission'],cr=cm['policy']['data_from_submission'];cq!==undefined&&(cp==='signer'||cp==='clock')&&k['push']({'code':'REPO_GUARD_SUBMISSION_ID_FORBIDDEN','detail':cn+'\x20declares\x20id_from_submission\x20'+cq+'\x20while\x20its\x20policy\x20id_from\x20is\x20'+('\x27'+cp+'\x27\x20—\x20the\x20row\x20id\x20is\x20AUTO-generated\x20from\x20the\x20'+cp+'\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 cs=a1['get'](cm['key']),ct=[['id_from_submission',cq],['data_from_submission',cr]];for(const [cu,cv]of ct){if(cv===undefined)continue;const cw=cs?.['table']['find'](cx=>cx['identifier']===cv);(cs===undefined||cw===undefined||cw['b_submission']!==!![])&&k['push']({'code':'REPO_GUARD_SUBMISSION_SLOT_UNKNOWN','detail':cn+'\x20declares\x20'+cu+'\x20'+cv+',\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'+cv+'\x20on\x20the\x20guard,\x20or\x20point\x20')+(cu+'\x20at\x20an\x20existing\x20submission\x20slot.')});}}if(cl['has'](co))continue;ck['push']({'name':co,'description':cm['policy']['description']??cm['purpose'],'write_guard':[{'guard':ref(cm['step_id']),...cq!==undefined?{'id_from_submission':cq}:{},...cr!==undefined?{'data_from_submission':cr}:{}}],'id_from':cm['policy']['id_from']??'none','value_type':cm['policy']['value_type']??'String','write_once':cm['policy']['write_once']??![]});}l['push']({'op':'create','id':'repository','object':'repository','params':P({'name':i+'_evidence',...ck['length']>0x0?{'policies':ck}:{}}),'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 aw=new Set(y['map'](cx=>cx['name'])),ax=new Set((a['allocator']?.['rows']??[])['filter'](cx=>cx['track']==='settlement')['map'](cx=>cx['guard_key'])['filter'](cx=>typeof cx==='string'&&cx['trim']()!=='')),ay=[],az=new Set();for(const cx of y){if(cx['from']===undefined||cx['from']['length']===0x0){k['push']({'code':'MACHINE_EDGES_MISSING','detail':'machine_shape\x20node\x20\x27'+cx['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 cy=[],cz=new Map(),cA=new Map();for(const cC of cx['from']){const cD=typeof cC==='string'?{'prev':cC}:cC;if(cD['prev']!==''&&!aw['has'](cD['prev'])){k['push']({'code':'EDGE_UNKNOWN_PREV','detail':'node\x20\x27'+cx['name']+'\x27\x20edge\x20prev\x20\x27'+cD['prev']+'\x27\x20is\x20not\x20a\x20machine_shape\x20node'});continue;}const cE=cD['operator']??cx['operator']??(cD['prev']===''?'order_payer':'merchant'),cF=cD['named_operator']??cx['named_operator'],cG=cD['forward']??(cD['prev']===''?'enter_'+cx['name']:cD['prev']+'_to_'+cx['name']);cD['permission_index']!==undefined&&cE==='order_payer'&&k['push']({'code':'PERMISSION_INDEX_DROPPED','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20declares\x20permission_index\x20'+cD['permission_index']+'\x20on\x20operator\x20\x27order_payer\x27.\x20'+'The\x20two\x20are\x20contradictory\x20rails:\x20\x27order_payer\x27\x20compiles\x20to\x20the\x20on-chain\x20order-holder\x20check\x20(namedOperator\x20\x22\x22),\x20which\x20the\x20chain\x20evaluates\x20FIRST,\x20'+'so\x20the\x20declared\x20permission\x20index\x20is\x20silently\x20dropped\x20and\x20the\x20forward\x20remains\x20open\x20to\x20EVERY\x20order\x20agent\x20—\x20the\x20opposite\x20of\x20the\x20entity-only\x20intent\x20'+'(alg2-tn-261025\x20T8e:\x20the\x20provider\x20self-advanced\x20the\x20evaluation\x20forward\x20and\x20settled\x20the\x20escrow\x20to\x20itself).\x20Pick\x20ONE\x20rail:\x20remove\x20permission_index\x20to\x20keep\x20the\x20'+('buyer\x20rail,\x20or\x20remove\x20the\x20\x27order_payer\x27\x20operator\x20(node-level\x20or\x20edge-level)\x20so\x20this\x20forward\x20binds\x20permission_index\x20'+cD['permission_index']+'\x20only')});cF!==undefined&&cD['permission_index']!==undefined&&k['push']({'code':'NAMED_OPERATOR_RAIL_CONFLICT','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20declares\x20named_operator\x20\x27'+cF+'\x27\x20AND\x20permission_index\x20'+cD['permission_index']+'.\x20'+'namedOperator\x20and\x20permissionIndex\x20are\x20OR-options\x20in\x20the\x20on-chain\x20pre-check\x20(namedOperator\x20first),\x20so\x20both\x20rails\x20on\x20one\x20forward\x20'+'is\x20a\x20widening\x20ambiguity\x20—\x20the\x20forward\x20stays\x20open\x20to\x20whichever\x20rail\x20matches\x20and\x20neither\x20the\x20roster-only\x20nor\x20the\x20entity-only\x20intent\x20binds.\x20'+'Pick\x20ONE\x20rail:\x20drop\x20permission_index\x20to\x20keep\x20the\x20named\x20roster\x20rail,\x20or\x20drop\x20named_operator\x20to\x20keep\x20the\x20permission\x20entity\x20rail'});cF!==undefined&&(cD['operator']==='order_payer'||cx['operator']==='order_payer')&&k['push']({'code':'NAMED_OPERATOR_RAIL_CONFLICT','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20declares\x20named_operator\x20\x27'+cF+'\x27\x20on\x20an\x20EXPLICIT\x20operator:\x27order_payer\x27.\x20'+'Both\x20ride\x20the\x20namedOperator\x20rail\x20with\x20different\x20payloads\x20—\x20the\x20buyer\x20self-advance\x20(\x27\x27\x20resolves\x20to\x20the\x20order\x20payer)\x20and\x20the\x20'+('third-party\x20namespace\x20(\x27'+cF+'\x27\x20resolves\x20to\x20the\x20per-order\x20roster)\x20cannot\x20share\x20one\x20forward;\x20one\x20of\x20them\x20would\x20silently\x20lose.\x20')+'Pick\x20ONE\x20rail:\x20drop\x20the\x20operator\x20declaration\x20to\x20keep\x20the\x20named\x20roster\x20rail,\x20or\x20drop\x20named_operator\x20to\x20keep\x20the\x20buyer\x20self-advance'});const cH=cD['guard_key']!==undefined&&cD['guard_key']['trim']()!==''&&ax['has'](cD['guard_key'])||/settle|release|payout/i['test'](cG);{cH&&cD['permission_index']===undefined&&cF===undefined&&cE!=='order_payer'&&k['push']({'code':'RELEASE_EDGE_PERMISSIONLESS','detail':'settlement\x20edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20(forward\x20\x27'+cG+'\x27,\x20guard\x20\x27'+(cD['guard_key']??'none')+'\x27)\x20binds\x20NO\x20permission_index\x20and\x20NO\x20named_operator\x20rail\x20—\x20it\x20compiles\x20PERMISSIONLESS:\x20the\x20on-chain\x20permission\x20layer\x20checks\x20namedOperator\x20then\x20permissionIndex,\x20and\x20with\x20neither\x20present\x20ANYONE\x20with\x20a\x20valid\x20order\x20passport\x20can\x20advance\x20the\x20release\x20and\x20move\x20the\x20escrow\x20(5R-07①\x20F-56,\x20tbp\x20T17\x20live:\x20an\x20unrelated\x20buyer\x27s\x20wallet\x20executed\x20the\x20payout).\x20Bind\x20ONE\x20rail:\x20permission_index\x201002\x20(the\x20keeper\x20or\x20merchant\x20release\x20slot\x20—\x20recommended\x20default\x20C:\x20the\x20time-lock\x20guard\x20+\x20keeper\x20duty\x20+\x20bounty\x20schedule\x20the\x20release)\x20or\x20a\x20stricter\x20merchant-approval\x20rail\x20for\x20high-ticket\x20builds\x20(default\x20A:\x20the\x20merchant\x27s\x20own\x20approval\x20BEFORE\x20the\x20escrow\x20moves).\x20Pair\x20the\x20rail\x20with\x20the\x20guard\x27s\x20identity\x20leg\x20(Signer\x20binding)\x20as\x20defense\x20in\x20depth\x20—\x20declared\x20in\x20the\x20guard\x20table,\x20verified\x20by\x20the\x20audit\x20face'});}const cI={'name':cG,'weight':0x1,...cF!==undefined?{'namedOperator':cF}:cE==='order_payer'?{'namedOperator':''}:{'permissionIndex':cD['permission_index']??j}};if(cD['guard_key']!==undefined){const cM=F['get'](cD['guard_key']);if(cM===undefined)k['push']({'code':'GUARD_KEY_UNKNOWN','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20binds\x20unknown\x20guard_key\x20\x27'+cD['guard_key']+'\x27'});else{for(const cO of cM['purpose']['matchAll'](/progress\.current\s*==\s*([a-z0-9_]+)/g)){const cP=cO[0x1];aw['has'](cP)&&cP!==cD['prev']&&k['push']({'code':'FORWARD_GUARD_PINNED_TO_NON_PREV','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20guard\x20\x27'+cM['key']+'\x27\x20pins\x20progress.current\x20==\x20\x27'+cP+'\x27,\x20but\x20a\x20'+('forward\x20guard\x20evaluates\x20BEFORE\x20the\x20advance\x20(progress.current\x20==\x20prev\x20\x27'+cD['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.'});}const cN=cM['template_id']==='pattern.identity_check_order_holder'||cM['template_id']==='tpl_forward_order_holder'||cM['template_id']==='tpl_forward_order_holder_or_time'||cM['template_id']==='tpl_time_window_upper_order_holder'||cM['template_id']==='tpl_time_window_band_abs_order_holder'||cM['template_id']==='tpl_forward_order_holder_time_lock_absolute';if(cN&&cF!==undefined)k['push']({'code':'FORWARD_GUARD_IDENTITY_NAMED_CONFLICT','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20guard\x20\x27'+cM['key']+'\x27\x20is\x20an\x20order-holder\x20(buyer)\x20identity\x20'+('check\x20but\x20the\x20forward\x20rides\x20a\x20named_operator\x20rail\x20(\x27'+cF+'\x27\x20—\x20a\x20third\x20party\x20that\x20is\x20')+'neither\x20the\x20merchant\x20entity\x20nor\x20the\x20buyer).\x20The\x20identity\x20layer\x20runs\x20BEFORE\x20the\x20guard\x20and\x20the\x20'+'roster\x20signer\x20is\x20never\x20the\x20order\x20owner\x20—\x20nobody\x20can\x20pass\x20both.\x20Move\x20the\x20buyer-identity\x20leg\x20'+'off\x20this\x20forward\x20(the\x20roster\x20forward\x20may\x20carry\x20only\x20evidence/time\x20guards),\x20or\x20split\x20the\x20hop.'});else cN&&cE!=='order_payer'&&k['push']({'code':'FORWARD_GUARD_IDENTITY_PERM_CONFLICT','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20guard\x20\x27'+cM['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 cQ=a1['get'](cM['key']);if(cQ!==undefined){const cR=cQ['table']['some'](cT=>cT['identifier']===TASK_BINDING_SLOT),cS=offTaskSlotIdentityLegs(cQ['root'])['filter'](cT=>{if(!cR)return![];const cU=cQ['table']['find'](cV=>cV['identifier']===cT['identifier']);return cU!==undefined&&cU['b_submission']===!![];});for(const cT of cS){k['push']({'code':'GUARD_IDENTITY_SLOT_NOT_TASKBOUND','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20guard\x20\x27'+cM['key']+'\x27\x20reads\x20'+cT['query']+'\x20off\x20free\x20'+('submission\x20slot\x20'+cT['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,\x20so\x20this\x20'+('guard\x20is\x20the\x20only\x20identity\x20leg.\x20Anchor\x20the\x20'+cT['query']+'\x20query\x20on\x20identifier\x20')+(TASK_BINDING_SLOT+'\x20(the\x20task-binding\x20order\x20anchor\x20—\x20the\x20order\x20the\x20forward\x20actually\x20mutates).')});}}}if(cM['step_id']!==undefined){if(a7(cM['key']))k['push']({'code':'GUARD_CYCLE','detail':'edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20binds\x20guard\x20\x27'+cM['key']+'\x27\x20which\x20itself\x20'+'refs\x20the\x20service\x20(created\x20after\x20the\x20machine)\x20—\x20an\x20F-05\x20cycle.\x20Rebind\x20or\x20split\x20the\x20guard.'});else{cI['guard']=ref(cM['step_id']);if(cH&&cE==='order_payer'&&cF===undefined){const cU=a1['get'](cM['key']);cU!==undefined&&!guardTemplateHasIdentityLeg(cU['root'])&&k['push']({'code':'RELEASE_EDGE_NO_IDENTITY','detail':'settlement\x20edge\x20\x27'+cD['prev']+'\x27->\x27'+cx['name']+'\x27\x20(forward\x20\x27'+cG+'\x27,\x20guard\x20'+('\x27'+cM['key']+'\x27,\x20design\x20\x27'+cM['template_id']+'\x27)\x20rides\x20the\x20buyer\x20rail\x20(operator\x20')+'\x27order_payer\x27\x20→\x20namedOperator\x20\x22\x22\x20with\x20NO\x20permissionIndex)\x20and\x20its\x20guard\x20carries\x20NO\x20'+'order-holder\x20identity\x20leg\x20—\x20on\x20a\x20guard-bound\x20forward\x20the\x20chain\x20skips\x20the\x20'+'permission\x20assert,\x20so\x20ANY\x20signer\x20holding\x20a\x20passport\x20for\x20this\x20guard\x20can\x20drive\x20the\x20'+'settlement\x20(gfm35-tn-261029\x20F02\x20live:\x20an\x20outsider\x20force-released\x20and\x20settled\x20order).\x20'+'Bind\x20a\x20guard\x20whose\x20root\x20carries\x20the\x20owner/agent\x20identity\x20legs\x20over\x20slot\x20254\x20—\x20e.g.\x20'+'tpl_forward_order_holder_time_lock_absolute\x20for\x20a\x20deadline\x20self-heal\x20(split\x20guard\x20'+'key:\x20keep\x20the\x20pure\x20time\x20lock\x20on\x20the\x20keeper/merchant\x20edge),\x20'+'tpl_time_window_upper_absolute_ms\x20for\x20a\x20closing\x20window.\x20The\x20STATE_AUTHORIZING\x20'+'exemption\x20covers\x20keeper/merchant\x20rails\x20only,\x20never\x20the\x20buyer\x20release\x20rail'});}}}}}if(cI['guard']===undefined&&cE==='order_payer'&&cF===undefined){const cV=E['get'](cG);if(cV!==undefined){const cW=F['get'](cV);cW?.['step_id']!==undefined&&(cI['guard']=ref(cW['step_id']));}}const cJ=cz['get'](cD['prev']);cJ!==undefined?cJ['push'](cI):cz['set'](cD['prev'],[cI]);const cK=cA['get'](cD['prev']),cL=cF!==undefined?'namedOperator:'+cF:cE==='order_payer'?'namedOperator:':'permissionIndex:'+(cD['permission_index']??j);cF!==undefined&&az['add'](cF),cK!==undefined?cK['add'](cL):cA['set'](cD['prev'],new Set([cL]));}const cB=cx['threshold']??0x0;for(const [cX,cY]of cz){cB>cY['length']&&k['push']({'code':'PAIR_THRESHOLD_UNREACHABLE','detail':'node\x20\x27'+cx['name']+'\x27\x20pair\x20from\x20\x27'+(cX===''?'(entry)':cX)+'\x27\x20declares\x20threshold\x20'+cB+'\x20'+('but\x20the\x20pair\x20merges\x20only\x20'+cY['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(cB>=0x2){const cZ=cA['get'](cX)?.['size']??0x0;cZ<0x2&&k['push']({'code':'PAIR_THRESHOLD_SINGLE_OPERATOR','detail':'node\x20\x27'+cx['name']+'\x27\x20pair\x20from\x20\x27'+(cX===''?'(entry)':cX)+'\x27\x20declares\x20threshold\x20'+cB+'\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).'});}cy['push']({'prev_node':cX,'threshold':cB,'forwards':cY});}ay['push']({'name':cx['name'],...cx['semantic_role']!==undefined?{'role':cx['semantic_role']}:{},...cx['optional']===!![]?{'optional':!![]}:{},'pairs':cy});}if(az['size']>0x0){const d0=/(named[-_ ]?operator|operator roster|\broster\b|dispatch|permission.{0,12}221)/i,d1=(a['build_notes']??[])['some'](d2=>d0['test'](d2));!d1&&k['push']({'code':'NAMED_OPERATOR_ROSTER_UNDISCLOSED','detail':'machine_shape\x20binds\x20a\x20named\x20third-party\x20operator\x20namespace\x20('+[...az]['map'](d2=>'\x27'+d2+'\x27')['join'](',\x20')+')\x20'+'but\x20no\x20build_note\x20discloses\x20the\x20roster\x20management.\x20The\x20per-order\x20NamedOperator\x20roster\x20(max\x2060\x20rosters\x20/\x2080\x20addresses)\x20is\x20written\x20at\x20'+'runtime\x20by\x20the\x20account\x20holding\x20permission\x20index\x20221\x20—\x20without\x20a\x20disclosed\x20dispatch\x20duty\x20the\x20forward\x20compiles\x20but\x20nobody\x20can\x20ever\x20'+'pass\x20it\x20(silent\x20brick).\x20Add\x20a\x20build_note\x20stating\x20WHO\x20writes\x20the\x20roster,\x20WHEN\x20(per\x20order?\x20per\x20shift?),\x20and\x20what\x20happens\x20on\x20a\x20miss\x20'+'(e.g.\x20\x22namedOperator\x20\x27delivery_team\x27\x20roster\x20is\x20written\x20per\x20order\x20by\x20the\x20dispatch\x20keeper\x20via\x20permission\x20221;\x20an\x20unassigned\x20order\x20'+'waits\x20until\x20the\x20keeper\x20assigns\x20a\x20courier\x22).\x20K-4\x20stance:\x20dispatch\x20assignment\x20is\x20an\x20OFF-CHAIN\x20keeper\x20optimization,\x20never\x20a\x20chain\x20scheduler'});}l['push']({'op':'create','id':'machine','object':'machine','params':P({'name':i+'_machine','permission':ref('permission'),'nodes':ay})}),l['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=D['find'](d2=>d2['host']==='service'&&d2['key']==='buy');l['push']({'op':'create','id':'service','object':'service','params':P({'name':i+'_service','type_parameter':aA,'permission':ref('permission'),'machine':ref('machine'),'um':ref('contact'),'description':a['id']+'\x20—\x20compiled\x20by\x20the\x20composition\x20compiler',...a0?{'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 d2 of av)l['push'](a8(d2));const aC=z['length']>0x0?z:[{'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 d3 of aC){if(d3['guard_key']!==undefined){let d4=aE['get'](d3['guard_key']);d4===undefined&&(d4={'key':d3['guard_key'],'rows':[]},aE['set'](d3['guard_key'],d4),aD['push'](d4)),d4['rows']['push'](d3);}else aD['push']({'rows':[d3]});}const aF=[];for(const d5 of aD){const d6=[];let d7;for(const dc of d5['rows']){let dd=dc['value'];dd===undefined&&dc['value_from']!==undefined&&(dd=b[dc['value_from']]??a['fee_params'][dc['value_from']]);if(dd===undefined&&dc['value_from_complement']!==undefined){const dg=dc['value_from_complement'],dh=b[dg]??a['fee_params'][dg],di=typeof dh==='number'?dh:typeof dh==='string'&&/^\d+(?:\.\d+)?$/['test'](dh['trim']())?Number(dh):undefined;if(dc['mode']!=='rate'){k['push']({'code':'ALLOCATOR_COMPLEMENT_INVALID','detail':'allocator\x20row\x20('+dc['track']+'/'+(dc['recipient_key']??dc['recipient'])+')\x20declares\x20value_from_complement\x20\x27'+dg+'\x27\x20but\x20'+('mode\x20\x27'+dc['mode']+'\x27\x20—\x20the\x20complement\x20is\x20RATE-domain\x20only\x20(10000\x20-\x20bps).\x20Use\x20value/value_from\x20for\x20Amount\x20rows.')});continue;}if(di===undefined||!Number['isFinite'](di)||di<0x0||di>0x2710){k['push']({'code':'ALLOCATOR_COMPLEMENT_INVALID','detail':'allocator\x20row\x20('+dc['track']+'/'+(dc['recipient_key']??dc['recipient'])+')\x20value_from_complement\x20\x27'+dg+'\x27\x20resolves\x20to\x20'+('\x27'+String(dh)+'\x27\x20—\x20not\x20a\x20bps\x20value\x20in\x20[0,\x2010000];\x20the\x20complement\x20leg\x20cannot\x20be\x20computed.')});continue;}dd=0x2710-di;}if(dd===undefined&&dc['mode']!=='surplus'){k['push']({'code':'ALLOCATOR_VALUE_MISSING','detail':'allocator\x20row\x20('+dc['track']+'/'+dc['recipient']+')\x20has\x20neither\x20value\x20nor\x20a\x20resolvable\x20value_from'});continue;}(dc['fix']!==undefined||dc['fix_from']!==undefined)&&k['push']({'code':'ALLOCATOR_FIX_UNSUPPORTED','detail':'allocator\x20row\x20('+dc['track']+'/'+dc['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'+'in\x20full\x20at\x20release,\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.'});d7??=dc['note'];let de;if(dc['recipient']==='entity')de={'Entity':{'name_or_address':{'$late':{'by':'local_name','mark':dc['recipient_key']??'merchant'}}}};else{if(dc['recipient']==='guard_identifier'){const dj=Number(dc['recipient_key']??0x0);de={'GuardIdentifier':dj};const dk=d5['key']!==undefined?a1['get'](d5['key']):undefined;if(dk!==undefined){const dl=dk['table']['find'](dm=>dm['identifier']===dj);(dl===undefined||dl['b_submission']!==!![]||dl['value_type']!=='Address')&&k['push']({'code':'GUARD_SLOT_UNKNOWN','detail':'allocator\x20leg\x20{GuardIdentifier:\x20'+dj+'}\x20on\x20guard\x20\x27'+d5['key']+'\x27\x20of\x20\x27'+i+'\x27:\x20the\x20bound\x20'+('Guard\x20table\x20has\x20no\x20slot\x20'+dj+'\x20Address\x20submission\x20row\x20(b_submission:\x20true).\x20On\x20chain\x20the\x20leg\x20')+('reads\x20slot\x20'+dj+'\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)\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'+dj+',\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 de='Signer';}const df=typeof dd==='number'?dd===0x0:typeof dd==='string'&&/^\s*0+(?:\.0+)?\s*$/['test'](dd);d6['push']({'who':de,'sharing':String(dd??'0'),'mode':MODE_MAP[dc['mode']],'zeroEntityRate':dc['recipient']==='entity'&&dc['mode']==='rate'&&df});}const d8=d6['filter'](dm=>dm['zeroEntityRate']),d9=d8['length']>0x0&&d8['length']<d6['length']?d6['filter'](dm=>!dm['zeroEntityRate']):d6,da=d9['map'](dm=>({'who':dm['who'],'sharing':dm['sharing'],'mode':dm['mode']}));if(da['length']===0x0)continue;if(d9['length']>0x0&&d9['every'](dm=>dm['mode']==='Rate')){const dm=d9['map'](dn=>/^\d+$/['test'](dn['sharing']['trim']())?Number(dn['sharing']):Number['NaN']);if(dm['every'](dn=>Number['isFinite'](dn))){const dn=dm['reduce']((dp,dq)=>dp+dq,0x0);if(dn!==0x2710){const dp=dq=>{if(typeof dq==='string')return dq;const dr=dq;if(dr['GuardIdentifier']!==undefined)return'GuardIdentifier('+String(dr['GuardIdentifier'])+')';const ds=dr['Entity']?.['name_or_address']?.['$late']?.['mark'];return ds!==undefined?'Entity('+ds+')':JSON['stringify'](dq);};k['push']({'code':'RATE_SUM_INVALID','detail':'Rate\x20group\x20\x27'+(d5['key']??d5['rows'][0x0]['track']+'/signer')+'\x27\x20sums\x20to\x20'+dn+'\x20bps,\x20not\x2010000\x20'+('('+d9['map'](dq=>dp(dq['who'])+'='+dq['sharing'])['join']('\x20+\x20')+').\x20The\x20chain\x20aborts\x20the\x20')+'allocator\x20with\x20ERATE_NOT_10000\x20at\x20apply\x20time,\x20when\x20the\x20plan\x20is\x20already\x20publish-frozen\x20—\x20fix\x20'+'the\x20split\x20now:\x20the\x20legs\x20of\x20one\x20guard_key\x20must\x20add\x20up\x20to\x20the\x20whole\x20pool\x20(a\x20two-party\x20split\x20'+'leaves\x20the\x20remainder\x20to\x20value_from_complement,\x20never\x20to\x20a\x20guessed\x20literal).'});}}}const db=d5['key']!==undefined?F['get'](d5['key'])?.['step_id']:undefined;d5['key']!==undefined&&!F['has'](d5['key'])&&k['push']({'code':'GUARD_KEY_UNKNOWN','detail':'allocator\x20row\x20('+d5['rows'][0x0]['track']+')\x20binds\x20unknown\x20guard_key\x20\x27'+d5['key']+'\x27'}),aF['push']({...db!==undefined?{'guard':ref(db)}:{},...d5['key']!==undefined?{'guard_key':d5['key']}:{},'track':d5['rows'][0x0]['track'],'sharing':da,...d7!==undefined?{'note':d7}:{}});}const aG=aD['map'](dq=>{if(dq['key']===undefined)return undefined;const dr=a1['get'](dq['key']);return{'key':dq['key'],'track':dq['rows'][0x0]['track'],'table':dr?.['table']??[],'root':dr?.['root']};})['filter'](dq=>dq!==undefined);if(aG['length']>0x0){const dq=verifyAllocatorRails(aG,y['map'](dt=>({'name':dt['name'],'semanticRole':dt['semantic_role']}))),dr=aD['map'](dt=>dt['key'])['filter'](dt=>dt!==undefined&&!a1['has'](dt)),ds=dr['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'+dr['join'](',\x20')+'.':'';for(const dt of dq){dt['level']==='critical'&&k['push']({'code':dt['code'],'detail':dt['detail']+ds});}}l['push']({'op':'configure','id':'service_allocators','target':ref('service'),'method':'order_allocators','params':P({'description':a['allocator']['description'],'threshold':Number(b['threshold']??b['monthly_rent_amount']??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&&l['push']({'op':'configure','id':'service_sales','target':ref('service'),'method':'sales','params':{'op':'add','sales':b['sales']}});if(ac!=='none'){const du=a13a(ac),dv=y['some'](dw=>afterSalesRailNodeMatches(ac,dw['name']));!dv&&k['push']({'code':'AFTER_SALES_RAIL_MISSING','detail':'after_sales_mode\x20\x27'+ac+'\x27\x20declares\x20a\x20buyer\x20after-sales\x20remedy,\x20but\x20machine_shape\x20has\x20no\x20'+('backing\x20rail\x20(no\x20node\x20matching\x20'+du+').\x20Add\x20the\x20'+ac+'\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(af!=='none'){ag&&a['arbitration_mode']!=='third_party'&&k['push']({'code':'ACCEPTANCE_JUDGE_NOT_INDEPENDENT','detail':'acceptance_mode\x20\x27'+af+'\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 dw=a['fee_params']['revision_rounds_max'],dx=typeof dw==='number'||typeof dw==='string'&&dw['trim']()!==''&&/^\d+$/['test'](dw['trim']());if(dx){const dy=D['some'](dz=>dz['host']==='repository'||/repository/i['test'](dz['template_id']));!dy&&k['push']({'code':'ACCEPTANCE_REVISION_UNBOUNDED','detail':'acceptance_mode\x20\x27'+af+'\x27\x20declares\x20a\x20bounded\x20revision\x20loop\x20'+('(fee_params.revision_rounds_max\x20=\x20'+String(dw)+'),\x20but\x20no\x20counter-backed\x20Repository\x20')+'guard\x20exists.\x20The\x20chain\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(aj!=='none'){const dz=/(due|owed|owing|unpaid|awaiting|pending)/i,dA=/(paid|captured|funded|settled)/i,dB=/(deposit|down_?pay|balance_due|balance_owed|awaiting|installment|milestone)/i,dC=/(refund|cancel|exit|forfeit|kill|void|abandon|release|expire|lapse)/i,dD=[];for(const dG of y){const dH=dG['name'];for(const dI of dG['from']??[]){typeof dI==='string'?dD['push']({'prev':dI,'target':dH}):dD['push']({'prev':dI['prev'],'target':dH,'guardKey':dI['guard_key']});}}const dE=dD['filter'](dJ=>dz['test'](dJ['prev'])&&dA['test'](dJ['target'])&&(dJ['guardKey']===undefined||dJ['guardKey']['trim']()===''));dE['length']>0x0&&k['push']({'code':'INSTALLMENT_FUNDING_UNGATED','detail':'installment_mode\x20\x27'+aj+'\x27\x20captures\x20a\x20later\x20payment,\x20but\x20the\x20funding\x20forward(s)\x20'+dE['map'](dJ=>'\x27'+dJ['prev']+'\x27\x20→\x20\x27'+dJ['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 dF=[];for(const dJ of y){if(!dB['test'](dJ['name']))continue;const dK=dD['filter'](dM=>dM['prev']===dJ['name']),dL=dK['some'](dM=>dC['test'](dM['target']));if(!dL)dF['push'](dJ['name']);}dF['length']>0x0&&k['push']({'code':'INSTALLMENT_DEPOSIT_STRANDED','detail':'installment_mode\x20\x27'+aj+'\x27\x20holds\x20a\x20buyer\x20payment\x20at\x20state(s)\x20'+dF['map'](dM=>'\x27'+dM+'\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(am!=='none'){const dM=/(commission|affiliate|referr|attribut|partner_?payout)/i,dN=y['some'](dR=>dM['test'](dR['name'])),dO=aC['some'](dR=>dM['test'](dR['value_from']??'')||dM['test'](dR['recipient_key']??''));!dN&&!dO&&k['push']({'code':'AFFILIATE_RAIL_MISSING','detail':'affiliate_mode\x20\x27'+am+'\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—\x20anti-grab-pool)\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 dP=/(post-?lock|clawback|unrecoverable|irrevocab|no\s*(?:revers|recov|clawback)|cannot be reversed|once released|released commission)/i,dQ=(a['build_notes']??[])['some'](dR=>dP['test'](dR));!dQ&&k['push']({'code':'AFFILIATE_CLAWBACK_UNDISCLOSED','detail':'affiliate_mode\x20\x27'+am+'\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—\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(ap!=='none'){const dR=/(releas|settle|funded|disburs|project)/i,dS=/(refund|missed|unmet|return|reimburse)/i,dT=y['some'](e6=>dR['test'](e6['name'])),dU=aC['some'](e6=>e6['track']==='settlement'&&(dR['test'](e6['guard_key']??'')||dR['test'](e6['recipient_key']??''))),dV=y['some'](e6=>dS['test'](e6['name'])),dW=aC['some'](e6=>e6['track']==='refund'||dS['test'](e6['guard_key']??''));!dT&&!dU&&k['push']({'code':'CROWDFUNDING_THRESHOLD_GATE_MISSING','detail':'crowdfunding_mode\x20\x27'+ap+'\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.'});ap==='threshold'&&!dV&&!dW&&k['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(ap==='threshold'){const e6=D['filter'](e9=>e9['host']==='repository'||/repository_write/i['test'](e9['template_id'])),e7=e6['length']>0x0,e8=e6['some'](e9=>{const ea=(e9['policy']?.['id_from']??'')['toLowerCase']();return ea==='signer'||ea==='clock';});if(!e7)k['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\x20declares\x20the\x20contribution\x20rows\x20—\x20with\x20no\x20write-bound\x20policy\x20the\x20total\x20is\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'+'Mount\x20pattern.repository_write_authorization\x20(identity\x20leaf\x20order.owner==Signer\x20/\x20order.agent\x20has\x20Signer)\x20'+'and\x20key\x20the\x20contribution\x20rows\x20by\x20the\x20funder\x27s\x20ORDER\x20(policy\x20id_from\x20unset;\x20row\x20id\x20=\x20the\x20Order\x20address).'});else{if(e8){const e9=e6['filter'](ea=>{const eb=(ea['policy']?.['id_from']??'')['toLowerCase']();return eb==='signer'||eb==='clock';})['map'](ea=>'\x27'+ea['key']+'\x27');k['push']({'code':'CROWDFUNDING_SIGNER_KEYED_ROWS','detail':'crowdfunding_mode\x20\x27threshold\x27\x20gates\x20release\x20on\x20an\x20aggregate\x20funding\x20total,\x20but\x20the\x20contribution\x20'+('policy\x20'+e9['join'](',\x20')+'\x20keys\x20rows\x20by\x20the\x20WALLET\x20(id_from\x20signer/clock)\x20—\x20the\x20OLD\x20pre-migration\x20')+'shape\x20(ksc-tn-261024\x20F-01/F-05).\x20Wallet-keyed\x20rows\x20feed\x20the\x20escrow-bound\x20sum\x20(query\x201179,\x20per-row\x20'+'min(row,\x20order.amount))\x20ZERO\x20—\x20the\x20goal\x20gate\x20silently\x20bricks\x20—\x20and\x20the\x20free-form\x20sum-where\x20(1174)\x20stays\x20'+'self-reported,\x20so\x20a\x20backer\x20can\x20still\x20record\x201.0\x20for\x20a\x200.1\x20pledge.\x20Key\x20the\x20rows\x20by\x20the\x20funder\x27s\x20ORDER\x20'+'instead\x20(policy\x20id_from\x20unset;\x20the\x20backer\x27s\x20tooling\x20submits\x20the\x20row\x20id\x20=\x20their\x20Order\x20address\x20through\x20'+'the\x20passport-bearing\x20data\x20write),\x20pass\x20those\x20ORDER\x20addresses\x20as\x20the\x20aggregate\x27s\x20candidate\x20ids,\x20and\x20pair\x20the\x20gate\x20'+'with\x20the\x20live-escrow\x20leg\x20(allocation.balance\x20query\x201051\x20via\x20convert_witness\x20OrderAllocation\x20109,\x20'+'>=\x20order.amount)\x20so\x20a\x20refunded/never-funded\x20order\x20can\x20neither\x20count\x20toward\x20the\x20goal\x20nor\x20be\x20settled.'});}}}const dX=a['build_notes']??[],dY=/(attest|keeper|aggregate trust|read-?only sum|not a chain-?verified|independent recomputation)/i,dZ=/(not investment|non-?investment|no (?:investment )?return|never promise)/i,e0=/(kyc|aml|securities|money-?transmission|regulatory|cross-border|compliance)/i,e1=/(no-?refund|non-?refundable|keep-?it-?all)/i,e2=dX['some'](ea=>dZ['test'](ea)),e3=dX['some'](ea=>e0['test'](ea)),e4=ap==='threshold'?dX['some'](ea=>dY['test'](ea)):!![],e5=ap==='flexible'?dX['some'](ea=>e1['test'](ea)):!![];if(!e4||!e2||!e3||!e5){const ea=[!e4?'the\x20aggregate-trust\x20boundary\x20(the\x20funding\x20total\x20is\x20a\x20keeper-attested\x20Repository\x20sum,\x20NOT\x20a\x20chain-verified\x20money\x20oracle)':null,!e2?'the\x20L-01\x20non-investment\x20statement\x20(never\x20promise\x20returns\x20/\x20promote\x20coin\x20price;\x20not\x20investment\x20advice\x20or\x20a\x20return\x20promise)':null,!e3?'the\x20L-05\x20KYC/AML\x20+\x20cross-border\x20regulatory\x20caution\x20(HIGH\x20intensity)':null,!e5?'the\x20flexible\x20keep-it-all\x20NO-REFUND\x20posture\x20(contributions\x20non-refundable\x20once\x20the\x20deadline\x20passes;\x20no\x20refunds)':null]['filter'](Boolean);k['push']({'code':'CROWDFUNDING_DISCLOSURE_MISSING','detail':'crowdfunding_mode\x20\x27'+ap+'\x27\x20declares\x20a\x20campaign\x20but\x20no\x20build_note\x20carries:\x20'+ea['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(as!=='none'){const eb=y,ec=eb['some'](ee=>ee['named_operator']!==undefined||(ee['from']??[])['some'](ef=>ef['named_operator']!==undefined));as==='courier'&&!ec&&k['push']({'code':'LOGISTICS_COURIER_RAIL_MISSING','detail':'logistics_mode\x20\x27courier\x27\x20declares\x20per-order\x20dispatched\x20riders,\x20but\x20machine_shape\x20carries\x20NO\x20named_operator\x20'+'rail.\x20A\x20dispatched\x20rider\x20is\x20NEITHER\x20a\x20permission\x20entity\x20NOR\x20the\x20buyer\x20—\x20the\x20ONLY\x20forward\x20they\x20can\x20ever\x20'+'pass\x20is\x20a\x20namedOperator\x20roster\x20rail\x20(the\x20rider\x20namespace\x27s\x20per-order\x20roster,\x20written\x20by\x20the\x20dispatch\x20'+'keeper\x20via\x20permission\x20index\x20221;\x20K-1\x20batch\x20B).\x20Bind\x20the\x20handover\x20forwards\x20(merchant→courier\x20pickup,\x20'+'courier→buyer\x20drop-off)\x20with\x20named_operator\x20\x27<namespace>\x27\x20—\x20and\x20disclose\x20the\x20roster\x20duty\x20in\x20a\x20build_note\x20'+'(the\x20NAMED_OPERATOR_ROSTER_UNDISCLOSED\x20gate\x20and\x20the\x20G6\x20dispatch\x20disclosure\x20below\x20enforce\x20the\x20rest).'});const ed=/(deliver|courier|shipping|freight|ride|dispatch|logistic)/i;if(as==='courier'){const ee=aC['find'](ef=>ef['mode']==='surplus'&&ed['test']((ef['value_from']??'')+'\x20'+(ef['recipient_key']??'')));ee!==undefined&&k['push']({'code':'LOGISTICS_COURIER_FEE_POOLED','detail':'logistics_mode\x20\x27courier\x27\x20has\x20a\x20delivery-fee\x20allocator\x20row\x20in\x20SURPLUS\x20mode\x20'+('(value_from/recipient_key\x20\x27'+(ee['value_from']??ee['recipient_key']??'')+'\x27)\x20—\x20a\x20surplus\x20leg\x20')+'drains\x20the\x20remainder\x20of\x20the\x20pool\x20it\x20hangs\x20on,\x20which\x20for\x20a\x20courier\x20build\x20IS\x20the\x20buyer\x27s\x20goods\x20escrow\x20'+'(the\x20grab-pool\x20shape\x20the\x20affiliate\x20INV-D3\x20family\x20bans).\x20The\x20delivery\x20fee\x20is\x20KNOWN\x20at\x20order\x20time\x20—\x20the\x20'+'buyer\x20sees\x20and\x20pays\x20it\x20before\x20dispatch\x20—\x20so\x20make\x20it\x20an\x20INDEPENDENT\x20leg:\x20a\x20fixed\x20Amount\x20row\x20(or\x20a\x20Rate\x20'+'row\x20off\x20a\x20dedicated\x20delivery-fee\x20pool\x20funded\x20separately),\x20never\x20a\x20Surplus/Rate\x20drain\x20of\x20the\x20goods\x20pool.'});}if(as==='pickup_point'){const ef=D['some'](eh=>eh['template_id']==='pattern.time_lock_absolute'||eh['template_id']==='tpl_time_lock_absolute_ms'),eg=D['some'](eh=>eh['template_id']==='pattern.time_window_upper_bound'||eh['template_id']==='tpl_time_window_upper'||eh['template_id']==='tpl_time_window_upper_absolute_ms');(!ef||!eg)&&k['push']({'code':'LOGISTICS_PICKUP_CUTOFF_MISSING','detail':'logistics_mode\x20\x27pickup_point\x27\x20declares\x20batch\x20consolidation,\x20but\x20the\x20shape\x20is\x20missing\x20'+(''+(!ef?'the\x20ABSOLUTE\x20batch-cutoff\x20release\x20gate\x20(pattern.time_lock_absolute\x20—\x20every\x20funder\x27s/leader\x27s\x20release\x20anchors\x20on\x20the\x20SAME\x20shared\x20cutoff\x20clock,\x20not\x20per-order\x20entry+duration)':''))+(''+(!ef&&!eg?'\x20and\x20':''))+(''+(!eg?'the\x20unclaimed-goods\x20exit\x20window\x20(pattern.time_window_upper_bound\x20—\x20goods\x20never\x20picked\x20up\x20must\x20refund/return\x20at\x20a\x20bounded\x20deadline,\x20never\x20hold\x20open-ended)':''))+'.\x20Both\x20are\x20mandatory:\x20without\x20the\x20shared\x20cutoff\x20the\x20batch\x20is\x20not\x20a\x20batch\x20(each\x20order\x20releases\x20on\x20its\x20own\x20clock),\x20and\x20without\x20the\x20exit\x20window\x20an\x20unclaimed\x20parcel\x20strands\x20in\x20the\x20pickup\x20point\x20forever.'});}if(as==='carrier'){const eh=/(track|shipping evidence|waybill|airbill|carrier record|parcel evidence)/i,ei=D['some'](ej=>ej['host']==='machine'&&eh['test'](ej['key']+'\x20'+ej['purpose']));!ei&&k['push']({'code':'LOGISTICS_CARRIER_EVIDENCE_MISSING','detail':'logistics_mode\x20\x27carrier\x27\x20declares\x20third-party\x20carrier\x20shipment,\x20but\x20NO\x20machine\x20guard\x20binds\x20'+'shipping/tracking\x20evidence.\x20Add\x20a\x20repository_data_check\x20guard\x20on\x20the\x20ship\x20forward\x20keyed\x20to\x20a\x20'+'tracking-hash\x20row\x20(the\x20retail\x20idiom:\x20the\x20evidence\x20Repository\x20row\x20is\x20written\x20by\x20an\x20authorized\x20'+'writer\x20—\x20pattern.repository_write_authorization\x20—\x20and\x20the\x20ship\x20guard\x20reads\x20it),\x20so\x20a\x20dispute\x20has\x20a\x20'+'dispute-ready\x20record\x20of\x20what\x20was\x20shipped\x20and\x20when.'});}{const ej=/(lost|loss|damag|theft)/i,ek=eo=>eo['replace'](/permanently lost/gi,''),el=/(transit loss|lost (?:parcel|package|goods|in transit)|in[- ]transit loss|carrier lost|loss (?:is |)remed|loss route|lost shipment)/i,em=eb['some'](eo=>ej['test'](eo['name'])||ej['test'](eo['role']??''))||D['some'](eo=>eo['host']==='machine'&&ej['test'](ek(eo['key']+'\x20'+eo['purpose']))),en=(a['build_notes']??[])['some'](eo=>el['test'](eo));!em&&!en&&k['push']({'code':'LOGISTICS_TRANSIT_LOSS_UNCOVERED','detail':'logistics_mode\x20\x27'+as+'\x27\x20moves\x20a\x20physical\x20good,\x20but\x20the\x20shape\x20has\x20NO\x20in-transit\x20loss\x20rail\x20'+'(no\x20loss/damage\x20node\x20or\x20machine-guard\x20family)\x20and\x20NO\x20build_note\x20disclosing\x20the\x20loss\x20remedy.\x20Goods\x20can\x20'+'be\x20lost\x20or\x20damaged\x20between\x20handover\x20and\x20acceptance\x20in\x20EVERY\x20physical\x20mode\x20—\x20silence\x20means\x20the\x20buyer\x27s\x20'+'funds\x20strand\x20behind\x20an\x20undeliverable\x20order\x20with\x20no\x20taught\x20route.\x20Either\x20express\x20the\x20loss\x20waypoint\x20(a\x20'+'node\x20like\x20the\x20retail\x20lost-parcel\x20record,\x20or\x20a\x20loss-evidence\x20machine\x20guard)\x20or\x20add\x20a\x20build_note\x20'+'disclosing\x20the\x20remedy\x20route\x20(e.g.\x20\x22transit\x20loss\x20is\x20remedied\x20by\x20the\x20buyer\x27s\x20arbitration\x20route\x20into\x20the\x20'+'refund\x20rail\x20—\x20the\x20ruling\x20pays\x20the\x20buyer;\x20the\x20carrier\x20claim\x20is\x20an\x20off-chain\x20recovery,\x20disclosed\x20as\x20such\x22).'});}if(as==='courier'||as==='pickup_point'){const eo=/(dispatch|schedul|no.{0,24}oracle|no on-chain.{0,24}(dispatch|scheduler)|off-chain keeper|keeper.{0,40}dispatch|roster|named.?operator|permission.{0,12}221)/i,ep=(a['build_notes']??[])['some'](eq=>eo['test'](eq));!ep&&k['push']({'code':'LOGISTICS_DISPATCH_UNDISCLOSED','detail':'logistics_mode\x20\x27'+as+'\x27\x20is\x20a\x20dynamically\x20dispatched\x20fulfillment\x20topology,\x20but\x20no\x20build_note\x20'+'discloses\x20the\x20two\x20🔴\x20SOLE-TRUTH\x20boundaries.\x20①\x20The\x20chain\x20has\x20NO\x20dispatch/scheduling\x20primitive\x20—\x20'+'assignment\x20of\x20riders/pickup\x20batches\x20is\x20an\x20OFF-CHAIN\x20keeper\x20duty\x20(K-4);\x20its\x20only\x20chain\x20footprint\x20is\x20the\x20'+'namedOperator\x20roster\x20written\x20via\x20permission\x20index\x20221.\x20②\x20There\x20is\x20NO\x20distance/weight/weather\x20oracle\x20—\x20'+'ETA,\x20route,\x20and\x20dynamic\x20pricing\x20are\x20NOT\x20chain-verifiable.\x20Add\x20a\x20build_note\x20stating\x20WHO\x20dispatches\x20(the\x20'+'keeper),\x20WHAT\x20the\x20keeper\x20writes\x20(the\x20roster,\x20per\x20order/shift),\x20and\x20that\x20ETA/pricing\x20live\x20off-chain.'});}}if(I!=='none'){const eq=y['some'](ez=>/review/i['test'](ez['name']));I==='review'&&!eq&&k['push']({'code':'REVIEW_NODE_MISSING','detail':'review_mode\x20\x27'+I+'\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 er=D['find'](ez=>ez['host']==='reward'),es=ez=>{const eA=new Set(),eB=ez!==undefined?a1['get'](ez):undefined;if(eB===undefined)return eA;const eC=new Map();for(const eE of eB['table']){typeof eE['identifier']==='number'&&typeof eE['value']==='string'&&eC['set'](eE['identifier'],eE['value']);}const eD=eF=>{if(Array['isArray'](eF)){for(const eH of eF)eD(eH);return;}if(eF===null||typeof eF!=='object')return;const eG=eF;if(Array['isArray'](eG['nodes'])){const [eI,eJ]=eG['nodes'];if(eI?.['query']==='progress.current'&&typeof eJ?.['identifier']==='number'){const eK=eC['get'](eJ['identifier']);if(eK!==undefined)eA['add'](eK);}eD(eG['nodes']);}};return eD(eB['root']),eA;},et=y['find'](ez=>/review/i['test'](ez['name']))?.['name'];let eu,ew,ex=[];if(et!==undefined){const ez=[];for(const eI of y){for(const eJ of eI['from']??[]){const eK=typeof eJ==='string'?{'prev':eJ,'guard_key':undefined}:eJ;ez['push']({'prev':eK['prev'],'guard_key':eK['guard_key'],'target':eI['name']});}}const eA=ez['filter'](eL=>eL['target']===et&&eL['prev']!=='');ex=[...new Set(eA['map'](eL=>eL['prev']))];const eB=[...new Set(eA['flatMap'](eL=>eL['guard_key']!==undefined?[eL['guard_key']]:[]))],eC=eB['length']===0x1?eB[0x0]:eB['length']===0x0?ez['find'](eL=>eL['prev']===et&&eL['guard_key']!==undefined)?.['guard_key']:undefined,eD=es(eC),eE=eD['size']===0x0||eD['size']===0x1&&ex['length']===0x1&&ex[0x0]===[...eD][0x0],eF=eE?eC:undefined,eG=eF!==undefined?F['get'](eF):undefined,eH=eG?.['template_id']==='tpl_review_submit_content_gate';eu=eH?undefined:eG?.['step_id'],ew=eH?undefined:eF;}if(eu===undefined){const eL=[...new Set([...y['filter'](eS=>/review/i['test'](eS['name'])||eS['semantic_role']==='final')['map'](eS=>eS['name']),...ex])],eM={'type':'logic_or','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'order.owner','object':{'identifier':0x0},'parameters':[]},{'type':'context','context':'Signer'}]},{'type':'query','query':'order.agent\x20has','object':{'identifier':0x0},'parameters':[{'type':'context','context':'Signer'}]}]},eN={'type':'logic_equal','nodes':[{'type':'query','query':'order.service','object':{'identifier':0x0},'parameters':[]},{'type':'identifier','identifier':0x1}]},eO=eL['map']((eS,eT)=>({'type':'logic_equal','nodes':[{'type':'query','query':'progress.current','object':{'identifier':0x0,'convert_witness':'OrderProgress'},'parameters':[]},{'type':'identifier','identifier':0x2+eT}]})),eP=eO['length']===0x1?eO[0x0]:eO['length']>0x1?{'type':'logic_or','nodes':eO}:undefined,eQ=y['find'](eS=>eS['semantic_role']==='delivered'&&!/review/i['test'](eS['name']))?.['name'],eR=eQ===undefined?undefined:{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query_progress_history_find','object':{'identifier':0x0,'convert_witness':'OrderProgress'},'where':{'nextNode':eQ},'find':'last'},{'type':'identifier','identifier':0x2+eL['length']}]};l['push']({'op':'create','id':'guard_review_write','object':'guard','params':P({'description':'Review\x20write\x20credential\x20(AR-3,\x20kernel-emitted):\x20the\x20signer\x20owns\x20or\x20administers\x20an\x20order\x20of\x20THIS\x20service'+(eP!==undefined?',\x20anchored\x20on\x20the\x20order\x20having\x20reached\x20'+eL['join']('\x20/\x20'):'')+(eR!==undefined?',\x20and\x20the\x20order\x20must\x20have\x20ENTERED\x20the\x20\x27'+eQ+'\x27\x20node\x20at\x20least\x20once\x20(history\x20probe\x20—\x20a\x20never-delivered\x20order\x20cannot\x20write\x20the\x20rating\x20row,\x20ksk4\x20F-04).\x20':'.\x20')+'Gates\x20the\x20\x27review\x27\x20and\x20\x27rating\x27\x20policies\x20of\x20the\x20plan-created\x20review\x20repository\x20—\x20reads\x20nothing\x20from\x20that\x20repository,\x20so\x20the\x20write\x20path\x20is\x20satisfiable\x20by\x20construction\x20(no\x20credential\x20cycle).','table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'order_being_reviewed'},{'identifier':0x1,'b_submission':![],'value_type':'Address','value':ref('service'),'name':'this_service'},...eL['map']((eS,eT)=>({'identifier':0x2+eT,'b_submission':![],'value_type':'String','value':eS})),...eR!==undefined?[{'identifier':0x2+eL['length'],'b_submission':![],'value_type':'U64','value':'0'}]:[]],'root':{'type':'logic_and','nodes':[...eP!==undefined?[eP]:[],...eR!==undefined?[eR]:[],eM,eN]}}),'notes':'AR-3\x20review\x20write\x20credential\x20(service\x20pinned\x20by\x20plan\x20ref\x20—\x20survives\x20permission\x20rotation).\x20The\x20buyer\x20writes\x20both\x20rows\x20at\x20review\x20time:\x20repository.data_add\x20{name:\x27review\x27|\x27rating\x27,\x20items:[{write_guard:\x27<this\x20guard>\x27,\x20data:[{id:<order\x20address>,\x20data:<stars/text>}]}]}\x20with\x20a\x20passport\x20submission\x20carrying\x20the\x20order.\x20Ordering:\x20pushed\x20BEFORE\x20repository_review\x20(HOST-GRAPH-01\x20—\x20the\x20frozen\x20write_guard\x20ref\x20resolves\x20only\x20if\x20the\x20credential\x20already\x20exists).'}),eu='guard_review_write',ew='review_write';}const ey=b['review_decision_enabled']===!![]&&I==='review_reward'&&er?.['step_id']!==undefined&&eu!==undefined;ey&&l['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(eu!==undefined){const eS=b['buyer_review_enabled']===!![];l['push']({'op':'create','id':'repository_review','object':'repository','params':P({'name':i+'_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'+ew+'\x27).\x20Payload:\x20JSON\x20text\x20{rating,\x20tags?,\x20orderRef?}.','write_guard':[{'guard':ref(eu)}],'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(eu)}],'id_from':'none','value_type':'U64','write_once':!![]},...eS?[{'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':!![]}]:[],...ey?[{'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.'+(ey?'\x20[review_decision\x20policy\x20frozen\x20AFTER\x20its\x20write\x20credential\x20—\x20the\x20guard\x20exists\x20before\x20this\x20create\x20(HOST-GRAPH-01\x20discipline).]':'')}),l['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(I==='review_reward'){const eT=er;if(eT===undefined||eT['step_id']===undefined)k['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 eU=b['reward_funding'],eV=eT['params']?.['reward_claim_amount'];let eW=eV!==undefined&&eV!==null?eV:b['reward_claim_amount'],eX='';if(eW===undefined){const f3=b['review_reward_per_claim'];f3!==undefined&&f3!==null&&Number(f3)>0x0&&(eW=f3,eX='input\x20review_reward_per_claim');}if(eW===undefined){const f4=a['fee_params']?.['review_reward_per_claim'];typeof f4==='number'&&f4>0x0&&(eW=f4,eX='template\x20fee_param\x20review_reward_per_claim\x20(override\x20with\x20the\x20reward_claim_amount\x20input)');}if(eW===undefined){const f5=lowestSalePrice(b['sales']);f5!==undefined&&(eW=String(Math['max'](Math['floor'](f5*0.02),0x1)),eX='derived:\x202%\x20of\x20the\x20cheapest\x20SKU\x20('+f5+'\x20smallest\x20units),\x20floored\x20at\x201\x20(T-02)');}let eY='';if(eW!==undefined){const f6=numericAmount(String(eW)),f7=lowestSalePrice(b['sales']);if(f6!==undefined&&f7!==undefined&&f7>0x0&&f6>0.5*f7){const f8=numericAmount(String(b['reward_funding']??'')),f9=f8!==undefined&&f6>0x0?'\x20the\x20reward_funding\x20pool\x20covers\x20~'+Math['floor'](f8/f6)+'\x20claim(s)':'';eY='\x20⚠\x20T-02\x20SCALE:\x20the\x20per-claim\x20bounty\x20('+f6+')\x20exceeds\x20half\x20the\x20cheapest\x20SKU\x20price\x20('+f7+')\x20—\x20'+('each\x20claimed\x20order\x20pays\x20out\x20more\x20than\x20the\x20sale\x20earns;\x20a\x20low-price\x20SKU\x20makes\x20the\x20rail\x20a\x20bounty-farm\x20target.'+f9);}}const eZ=a1['get'](eT['key']);eZ!==undefined&&!rootHasRewardRecordGate(eZ['root'])&&k['push']({'code':'REVIEW_REWARD_UNARMED','detail':'review_reward\x20claim\x20guard\x20\x27'+eT['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 f0;if(eZ!==undefined&&rootHasRewardRecordGate(eZ['root']))for(const fa of eZ['table']){const fb=fa;if(fb['b_submission']===!![]&&String(fb['value_type']??'')['toLowerCase']()==='address'&&(String(fb['object_type']??'')==='Order'||/order/i['test'](String(fb['name']??'')))){f0=fb['identifier'];break;}}const f1=eT['params']?.['evidence']??b['review_claim_evidence'];let f2;if(f1!==undefined&&f1!==null&&typeof f1==='object'){const fc=f1,fd=toByteVector(fc['key']),fe=toByteVector(fc['predicate']);fd!==undefined&&fe!==undefined&&(f0===undefined?k['push']({'code':'REVIEW_REWARD_EVIDENCE_NO_STAMP','detail':'review_reward\x20resolved\x20an\x20evidence\x20binding\x20request,\x20but\x20the\x20claim\x20guard\x20mount\x20carries\x20no\x20'+'store_from_id\x20stamp\x20slot\x20—\x20the\x20evidence\x20binding\x20reads\x20THE\x20store_from\x20row\x20(the\x20submitted\x20'+'Order\x20address),\x20so\x20the\x20chain\x20refuses\x20the\x20guard\x20at\x20build\x20time\x20(reward::evidence_bind,\x20'+'E_EVIDENCE_NEEDS_STORE_FROM).\x20Give\x20the\x20claim\x20guard\x27s\x20table\x20an\x20address-typed\x20Order\x20'+'submission\x20row\x20(b_submission)\x20so\x20the\x20mount\x20can\x20pin\x20store_from_id,\x20then\x20rebuild.'}):f2={'repo':ref('repository_review'),'key':fd,'predicate':fe});}eW===undefined&&k['push']({'code':'REVIEW_REWARD_AMOUNT_MISSING','detail':'review_mode\x20\x27review_reward\x27\x20resolved\x20a\x20claim\x20guard\x20but\x20no\x20per-claim\x20bounty\x20was\x20provided\x20or\x20derivable.\x20'+'The\x20reward\x20guard_add\x20mount\x20REQUIRES\x20an\x20amount\x20(schema-required)\x20—\x20a\x20plan\x20step\x20emitted\x20without\x20'+'it\x20fails\x20mid-execution.\x20Pass\x20\x27reward_claim_amount\x27\x20(a\x20display\x20string\x20with\x20the\x20token\x20'+'symbol\x20like\x20\x271WOW\x27,\x20or\x20a\x20smallest-unit\x20integer\x20like\x20\x27100000000\x27),\x20set\x20it\x20in\x20the\x20guard\x20'+'spec\x27s\x20params,\x20or\x20include\x20a\x20parseable\x20sales\x20catalog\x20(inputs.sales\x20with\x20numeric\x20prices)\x20so\x20the\x20'+'T-02\x20default\x20applies\x20(2%\x20of\x20the\x20cheapest\x20SKU,\x20floored\x20at\x201\x20smallest\x20unit).'}),l['push']({'op':'configure','id':'reward_review_guard_add','target':ref('reward_review'),'method':'guard_add','params':P({'guard':ref(eT['step_id']),'recipient':{'Signer':'signer'},...eW!==undefined?{'amount':{'type':'Fixed','value':String(eW)}}:{},...f0!==undefined?{'store_from_id':f0}:{},...f2!==undefined?{'evidence':f2}:{}}),'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.'+(eW!==undefined?'\x20AMOUNT\x20(BK15-F09):\x20per-claim\x20bounty\x20pinned\x20at\x20plan\x20time\x20('+String(eW)+')'+(eX?'\x20—\x20'+eX+';\x20override\x20with\x20the\x20reward_claim_amount\x20input':'')+'\x20—\x20no\x20execution-time\x20fill\x20needed.'+eY:'')+(f0!==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).':'')+(f2!==undefined?'\x20EVIDENCE\x20(ksk9d2-tn-261026\x20F-01):\x20the\x20guard\x20carries\x20an\x20evidence\x20binding\x20—\x20at\x20claim\x20the\x20'+'chain\x20counts\x20repository\x20rows\x20under\x20the\x20binding\x27s\x20(repo,\x20key)\x20matching\x20the\x20predicate\x20for\x20'+'THIS\x20claim\x27s\x20own\x20store_from\x20value\x20(the\x20submitted\x20order)\x20and\x20aborts\x2015\x20'+'(E_EVIDENCE_NOT_OWNED)\x20when\x20none:\x20a\x20borrowed\x20foreign\x20row\x20can\x20never\x20satisfy\x20the\x20bounty;\x20'+'the\x20order\x27s\x20attestation\x20row\x20must\x20exist\x20before\x20the\x20claim.'+'\x20PACKAGE\x20AVAILABILITY\x20(ksr-tn-261026\x20Q8-F04):\x20the\x20native\x20evidence-pinning\x20entry\x20is\x20'+'UNAVAILABLE\x20on\x20the\x20currently\x20deployed\x20package\x20—\x20batch\x20guard_add\x20submissions\x20silently\x20'+'DROP\x20the\x20pin\x20and\x20the\x20direct\x20face\x20hard-fails\x20with\x20a\x20missing-entry\x20error\x20(classified\x20'+'capability_unavailable,\x20non-retryable).\x20The\x20reward\x20guard_add\x20read-back\x20contract\x20'+'reports\x20EVIDENCE\x20BINDING\x20VERIFIED\x20/\x20NOT\x20ON\x20CHAIN\x20after\x20the\x20landed\x20call\x20—\x20treat\x20NOT\x20ON\x20'+'CHAIN\x20as\x20the\x20truth:\x20fall\x20back\x20to\x20the\x20repository-floor\x20guard\x20leg\x20and\x20disclose\x20that\x20it\x20'+'proves\x20only\x20\x27a\x20qualifying\x20row\x20exists\x20for\x20this\x20order\x27,\x20not\x20who\x20wrote\x20it.\x20Do\x20not\x20'+'re-send\x20guard_add\x20to\x20\x27fix\x27\x20a\x20dropped\x20pin.':'')}),l['push']({'op':'configure','id':'service_rewards','target':ref('service'),'method':'rewards','params':P({'op':'add','objects':[ref('reward_review')]}),'requires':['service']}),typeof eU==='string'||typeof eU==='number'?l['push']({'op':'configure','id':'reward_review_coin_add','target':ref('reward_review'),'method':'coin_add','params':{'balance':typeof eU==='number'?eU:String(eU)},'requires':['reward_review']}):k['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(a9){l['push']({'op':'create','id':'arbitration','object':'arbitration',...a['arbitration_mode']==='third_party'?{'account':'arb_controller'}:{},'params':P({'name':i+'_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.'}),l['push']({'op':'configure','id':'service_arbitrations','target':ref('service'),'method':'arbitrations','params':P({'op':'add','objects':[ref('arbitration')]})});const ff=b['compensation_fund'];if(typeof ff==='string'||typeof ff==='number')l['push']({'op':'configure','id':'service_compensation','target':ref('service'),'method':'compensation_fund_add','params':{'balance':String(ff)}});else{const fg=y['some'](fh=>{if(fh['semantic_role']!=='final')return![];for(const fi of fh['from']??[]){if(typeof fi==='string')continue;const fj=fi['guard_key']===undefined?undefined:F['get'](fi['guard_key']);if(fj?.['template_id']==='tpl_forward_arb_ruling_won')return!![];}return![];});fg&&k['push']({'code':'COMPENSATION_FUND_REQUIRED','detail':'This\x20build\x20routes\x20a\x20POST-settlement\x20arbitration\x20re-route\x20(an\x20arb-ruling-won\x20guard\x20on\x20an\x20edge\x20'+'leaving\x20a\x20settled\x20terminal):\x20the\x20escrow\x20is\x20already\x20drained\x20when\x20that\x20ruling\x20lands,\x20so\x20the\x20buyer\x27s\x20'+'only\x20remedy\x20is\x20the\x20compensation\x20fund\x20—\x20which\x20this\x20build\x20never\x20creates.\x20Pass\x20'+'inputs.compensation_fund\x20(>=\x20the\x20largest\x20single-order\x20exposure)\x20so\x20the\x20indemnity\x20is\x20real,\x20'+'or\x20rebuild\x20on\x20a\x20template\x20without\x20the\x20post-settlement\x20arb\x20edge.'});}}l['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(z['map'](fh=>fh['guard_key'])['filter'](fh=>typeof fh==='string')),aI=/^0x[0-9a-fA-F]{20,64}$/,aJ=fh=>{const fi=a1['get'](fh);if(fi===undefined)return undefined;for(const fj of fi['table']){const fk=fj;if(fk['b_submission']===!![]||fk['value_type']!=='Address')continue;const fl=fk['value'];if(typeof fl==='string'&&aI['test'](fl))return String(fk['identifier']??'?');}return undefined;};for(const fh of a1['keys']()){if(!a5['has'](fh)&&!aH['has'](fh))continue;const fi=aJ(fh);fi!==undefined&&k['push']({'code':'GUARD_FOREIGN_SERVICE','detail':'guard\x20\x27'+fh+'\x27\x20pins\x20an\x20on-chain\x20address\x20literal\x20(table\x20slot\x20'+fi+')\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 fj=new Map(),fk=new Map();for(const fu of l){if(fu['op']!=='create'||fu['object']!=='repository')continue;const fv=fu['params'],fw=new Set(),fx=new Set(),fy=Array['isArray'](fv['policies'])?fv['policies']:[];for(const fA of fy){if(typeof fA['name']==='string')fw['add'](fA['name']);const fB=Array['isArray'](fA['write_guard'])?fA['write_guard']:[];for(const fC of fB){const fD=fC['guard'];if(typeof fD==='string')fx['add'](fD);else fD!==null&&typeof fD==='object'&&typeof fD['$ref']==='string'&&fx['add'](fD['$ref']);}}const fz={'keys':fw,'writeGuardSteps':fx};fj['set'](fu['id'],fz);if(typeof fv['name']==='string')fk['set'](fv['name'],fz);}const fl=new Map();for(const fE of a1['values']()){if(fE['stepId']!==undefined)fl['set'](fE['stepId'],{'table':fE['table'],'root':fE['root']});}const fm=(fF,fG)=>fG===undefined?undefined:fF['find'](fH=>fH['identifier']===fG),fn=(fF,fG)=>{const fH=fm(fF,fG)?.['value'];if(fH!==null&&typeof fH==='object'&&typeof fH['$ref']==='string')return fj['get'](fH['$ref']);return typeof fH==='string'?fk['get'](fH):undefined;},fo=(fF,fG)=>{const fH=fm(fF,fG)?.['value'];return typeof fH==='string'?fH:undefined;},fq=(fF,fG)=>{const fH=[],fI=fJ=>{if(fJ===null||typeof fJ!=='object')return;if(Array['isArray'](fJ)){for(const fL of fJ)fI(fL);return;}const fK=fJ;if(fK['type']==='query_repository_data_find_where'){const fM=fK['object'],fN=fK['key'],fO=fn(fF,typeof fM?.['identifier']==='number'?fM['identifier']:undefined),fP=fo(fF,typeof fN?.['identifier']==='number'?fN['identifier']:undefined);if(fO!==undefined&&fP!==undefined)fH['push']({'repo':fO,'key':fP});}if(fK['type']==='query'&&typeof fK['query']==='string'&&/^repository\.data\b/i['test'](fK['query'])){const fQ=fK['object'],fR=fn(fF,typeof fQ?.['identifier']==='number'?fQ['identifier']:undefined),fS=Array['isArray'](fK['parameters'])?fK['parameters']:[],fT=fo(fF,typeof fS[0x0]?.['identifier']==='number'?fS[0x0]['identifier']:undefined);if(fR!==undefined&&fT!==undefined)fH['push']({'repo':fR,'key':fT});}if(fK['type']==='query_repository_data'||fK['type']==='query_repository_data_has'){const fU=fK['object'],fV=fn(fF,typeof fU?.['identifier']==='number'?fU['identifier']:undefined),fW=typeof fK['key']==='string'?fK['key']:undefined;if(fV!==undefined&&fW!==undefined)fH['push']({'repo':fV,'key':fW});}for(const fX of Object['keys'](fK))fI(fK[fX]);};return fI(fG),fH;};for(const [fF,fG]of a1){if(fG['stepId']===undefined)continue;for(const fH of fq(fG['table'],fG['root'])){!fH['repo']['keys']['has'](fH['key'])&&k['push']({'code':'POLICY_KEY_UNRESOLVED','detail':'guard\x20\x27'+fF+'\x27\x20reads\x20repository\x20policy\x20key\x20\x27'+fH['key']+'\x27,\x20but\x20NO\x20repository\x20create\x20step\x20in\x20this\x20'+'plan\x20defines\x20that\x20policy\x20—\x20policies\x20freeze\x20at\x20Repository\x20creation\x20(REPO-GATE-KEY-01),\x20so\x20the\x20read\x20'+'is\x20identically\x20ZERO:\x20the\x20gated\x20forward\x20never\x20opens\x20and\x20every\x20order\x20freezes\x20mid-rail\x20(bsx\x20BSX-F01:\x20'+'the\x20delivery\x20gate\x20read\x20\x27license_grant\x27\x20while\x20the\x20repository\x20stored\x20\x27grant\x27).\x20Align\x20the\x20guard\x27s\x20row\x20'+'key\x20with\x20a\x20policy\x20name\x20this\x20plan\x20actually\x20creates.'}),fH['repo']['writeGuardSteps']['has'](fG['stepId'])&&k['push']({'code':'CREDENTIAL_CYCLE','detail':'guard\x20\x27'+fF+'\x27\x20is\x20a\x20write\x20credential\x20of\x20a\x20repository\x20policy\x20it\x20also\x20READS\x20(\x27'+fH['key']+'\x27)\x20—\x20to\x20write\x20'+'the\x20row\x20you\x20must\x20first\x20pass\x20a\x20guard\x20requiring\x20the\x20row.\x20Unsatisfiable\x20by\x20construction\x20(bsn7\x20T-01\x20/\x20'+'bsx\x20BSX-F02:\x20the\x20review\x20write\x20credential\x20fell\x20back\x20to\x20the\x20reward-claim\x20guard,\x20which\x20requires\x20the\x20'+'rating\x20row\x20it\x20gates).\x20The\x20write\x20credential\x20must\x20be\x20an\x20identity/progress\x20credential\x20that\x20reads\x20'+'nothing\x20from\x20that\x20repository.'});}}const fr=(fI,fJ)=>{let fK=![];const fL=fM=>{if(fK||fM===null||typeof fM!=='object')return;if(Array['isArray'](fM)){for(const fO of fM)fL(fO);return;}const fN=fM;if(fN['type']==='context'&&fN['context']===fJ)fK=!![];for(const fP of Object['keys'](fN))fL(fN[fP]);};return fL(fI),fK;},fs=fI=>{let fJ=![];const fK=fL=>{if(fJ||fL===null||typeof fL!=='object')return;if(Array['isArray'](fL)){for(const fN of fL)fK(fN);return;}const fM=fL;fM['type']==='query'&&typeof fM['query']==='string'&&/named_operator|permission|arb\./i['test'](fM['query'])&&(fJ=!![]);for(const fO of Object['keys'](fM))fK(fM[fO]);};return fK(fI),fJ;},ft=(fI,fJ)=>{let fK=![];const fL=(fM,fN,fO)=>{if(fK||fM===null||typeof fM!=='object')return;if(Array['isArray'](fM)){for(const fR of fM)fL(fR,fN,fO);return;}const fP=fM;if(fP['type']==='logic_not'){fL(fP['node'],!![],![]);return;}if(!fN){fO&&fP['type']==='query'&&(fP['query']==='order.claimed_by'||fP['query']==='order.claimed_by\x20some')&&(fK=!![]);if(fP['type']==='logic_equal'&&Array['isArray'](fP['nodes'])){const fS=fP['nodes'],fT=fS['find'](fV=>fV['query']==='order.claimed_by\x20some'),fU=fS['find'](fV=>fV!==fT);if(fT!==undefined&&fU!==undefined){if(fU['value']===!![])fK=!![];if(fU['type']==='identifier'){const fV=fJ['find'](fW=>fW['identifier']===fU['identifier']);if(fV?.['value']===!![])fK=!![];}}}}const fQ=fP['type']==='logic_and'||fP['type']==='logic_or';for(const fW of Object['keys'](fP))fL(fP[fW],fN,fQ);};return fL(fI,![],!![]),fK;};for(const fI of a1['keys']()){if(!aH['has'](fI))continue;const fJ=a1['get'](fI);if(fr(fJ['root'],'Signer'))continue;if(fs(fJ['root']))continue;if(fr(fJ['root'],'Clock'))continue;if(ft(fJ['root'],fJ['table']))continue;k['push']({'code':'MONEY_RAIL_CALLER_LEG_MISSING','detail':'allocator\x20rail\x20\x27'+fI+'\x27\x20has\x20NO\x20caller-authorization\x20leg:\x20alloc_by_guard\x20is\x20NOT\x20a\x20forward\x20—\x20'+'the\x20chain\x20injects\x20the\x20order-holder\x20rail\x20on\x20forward\x20ops\x20only\x20and\x20the\x20allocation\x20op\x20has\x20no\x20'+'chain-side\x20caller\x20check,\x20so\x20this\x20rail\x20is\x20driveable\x20by\x20ANY\x20passport\x20holder\x20(gf30\x20A2\x20'+'settle_BY_OUTSIDER_v2\x20drained\x20o4;\x20rex5\x20T-27\x20rex-buy2\x20drained\x20a\x20third\x20party\x27s\x20escrow).\x20Bind\x20one:\x20'+'order.owner\x20==\x20Signer\x20OR\x20order.agent\x20has\x20Signer\x20(buyer),\x20or\x20the\x20dynamic-permission\x20leg\x20—\x20'+'service.permission\x20==\x20a\x20submitted\x20Permission\x20slot,\x20then\x20permission.owner\x20==\x20Signer\x20OR\x20'+'permission.admin\x20has\x20Signer\x20(merchant\x20or\x20keeper,\x20survives\x20rotation;\x20K-4).\x20State-determined\x20'+'exceptions\x20stay\x20open:\x20context\x20Clock\x20(time\x20gates)\x20and\x20order.claimed_by\x20some\x20==\x20true\x20(the\x20award\x20'+'axis\x20—\x20the\x20arbitration\x20case-conclusion\x20primitive\x20is\x20its\x20only\x20writer);\x20claimed_by\x20==\x20false\x20alone\x20never\x20exempts.'});}}const aK=a2['flatMap'](fK=>{const fL=aH['has'](fK['key'])?'allocator':a5['has'](fK['key'])?'machine_edge':fK['host']==='service'&&fK['key']==='buy'?'service_buy':undefined;return fL?[{'key':fK['key'],'template_id':fK['template_id'],'host':fK['host'],'site':fL,'purpose':fK['purpose']}]:[];});return{'plan':{'version':0x1,'intent':h['intent']??'compile\x20'+a['id'],'templateId':a['id'],'inputs':b,'steps':l,...aK['length']>0x0?{'pending_guards':aK}:{},...q['length']>0x0?{'derived_params':q}:{}},'guardSpecs':D,'unresolved':a2,'blockers':k,'omitted':[...C]};}
|