@wowok/agent-mcp 3.2.4 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/composition/blueprint-view.d.ts +64 -0
  2. package/dist/composition/blueprint-view.js +1 -0
  3. package/dist/evaluation/builtins/graph-service.spec.js +1 -1
  4. package/dist/evaluation/engine.js +1 -1
  5. package/dist/experience/realtime-feedback.js +1 -1
  6. package/dist/extensions/industry-pack.d.ts +1 -0
  7. package/dist/extensions/industry-pack.js +1 -1
  8. package/dist/extensions/modes.js +1 -1
  9. package/dist/extensions/registry.d.ts +1 -2
  10. package/dist/extensions/registry.js +1 -1
  11. package/dist/graph/onchain/expand.js +1 -1
  12. package/dist/graph/onchain/exposure.js +1 -1
  13. package/dist/graph/onchain/facts.js +1 -1
  14. package/dist/harness/recover.js +1 -1
  15. package/dist/knowledge/audit-rules.d.ts +2 -0
  16. package/dist/knowledge/audit-rules.js +1 -1
  17. package/dist/knowledge/baselines/rules/allocation.json +5 -5
  18. package/dist/knowledge/baselines/rules/arb.json +1 -1
  19. package/dist/knowledge/baselines/rules/guard.json +9 -9
  20. package/dist/knowledge/baselines/rules/machine.json +5 -5
  21. package/dist/knowledge/baselines/rules/order.json +1 -1
  22. package/dist/knowledge/builtin-templates.d.ts +2 -1
  23. package/dist/knowledge/builtin-templates.js +1 -1
  24. package/dist/knowledge/entity-recipient-guard.js +1 -1
  25. package/dist/knowledge/getting-started.js +1 -1
  26. package/dist/knowledge/guard-design-patterns.js +1 -1
  27. package/dist/knowledge/guard-risk.js +1 -1
  28. package/dist/knowledge/guard-templates.d.ts +1 -1
  29. package/dist/knowledge/guard-templates.js +1 -1
  30. package/dist/knowledge/index.js +1 -1
  31. package/dist/knowledge/industry-generalizer.js +1 -1
  32. package/dist/knowledge/industry-registry.js +1 -1
  33. package/dist/knowledge/jsonrpc-enum.js +1 -1
  34. package/dist/knowledge/order-ledger.js +1 -1
  35. package/dist/knowledge/scenario-modes.d.ts +2 -4
  36. package/dist/knowledge/scenario-modes.js +1 -1
  37. package/dist/knowledge/service-ledger.js +1 -1
  38. package/dist/knowledge/service-templates.js +1 -1
  39. package/dist/knowledge/template-loader.d.ts +7 -2
  40. package/dist/knowledge/template-loader.js +1 -1
  41. package/dist/knowledge/template-registry.js +1 -1
  42. package/dist/knowledge/template-scanner.js +1 -1
  43. package/dist/knowledge/template-validation.d.ts +2 -0
  44. package/dist/knowledge/template-validation.js +1 -0
  45. package/dist/monitor/MonitorLoop.js +1 -1
  46. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  47. package/dist/playbooks/service-build/game-theory.d.ts +2 -2
  48. package/dist/playbooks/service-build/game-theory.js +1 -1
  49. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  50. package/dist/playbooks/service-build/merchant-guide.d.ts +54 -11
  51. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  52. package/dist/playbooks/service-build/mode-actions.js +1 -1
  53. package/dist/playbooks/service-build/object-panorama.js +1 -1
  54. package/dist/playbooks/service-build/participation-radar.js +1 -1
  55. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  56. package/dist/playbooks/service-build/reverse-mapping-nk4.spec.d.ts +1 -0
  57. package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +1 -0
  58. package/dist/playbooks/service-build/reverse-mapping.d.ts +24 -0
  59. package/dist/playbooks/service-build/reverse-mapping.js +1 -1
  60. package/dist/playbooks/service-build/service-panorama.js +1 -1
  61. package/dist/playbooks/service-build/service-quote.js +1 -1
  62. package/dist/playbooks/service-build/workflow-design-assessment.d.ts +2 -2
  63. package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
  64. package/dist/review/index.js +1 -1
  65. package/dist/safety/confirm-gate.js +1 -1
  66. package/dist/schema/call/handler.js +1 -1
  67. package/dist/schema/call/semantic.js +1 -1
  68. package/dist/schema/call/service.d.ts +14 -0
  69. package/dist/schema/call/service.js +1 -1
  70. package/dist/schema/common/index.js +1 -1
  71. package/dist/schema/goal/planning.js +1 -1
  72. package/dist/schema/local/index.js +1 -1
  73. package/dist/schema/operations.d.ts +7 -0
  74. package/dist/schema/schema-version.js +1 -1
  75. package/dist/schema-query-impl/index.js +1 -1
  76. package/dist/schemas/goal_operation.schema.json +1 -1
  77. package/dist/schemas/index.json +1 -1
  78. package/dist/schemas/onchain_operations.schema.json +37 -2
  79. package/dist/schemas/onchain_operations_service.schema.json +37 -2
  80. package/dist/tools/handlers/benchmark-migration.d.ts +2 -13
  81. package/dist/tools/handlers/benchmark-migration.js +1 -1
  82. package/dist/tools/handlers/config.js +1 -1
  83. package/dist/tools/handlers/industry-pack.js +1 -1
  84. package/dist/tools/handlers/onchain.js +1 -1
  85. package/dist/tools/handlers/query.js +1 -1
  86. package/dist/tools/registry/agent.js +1 -1
  87. package/dist/tools/wip-deploy-assist.js +1 -1
  88. package/package.json +2 -2
  89. package/dist/playbooks/service-build/semantic-graph.d.ts +0 -99
  90. package/dist/playbooks/service-build/semantic-graph.js +0 -1
@@ -1 +0,0 @@
1
- import{createHash}from'node:crypto';import{MAX_NAME_LENGTH}from'@wowok/wowok';export function guardObjectName(a,b,c=0x0){const d=c>0x0?'_'+(c+0x1):'',e=(a+'_'+b+d)['replace'](/[^A-Za-z0-9_-]/g,'_');if(Buffer['byteLength'](e,'utf8')<=MAX_NAME_LENGTH)return e;const f=createHash('sha1')['update'](e)['digest']('hex')['slice'](0x0,0x8),g=Math['max'](0x8,MAX_NAME_LENGTH-f['length']-0x1);return e['slice'](0x0,g)+'_'+f;}function resolveNameBase(a,b){if(b?.['nameBase']&&b['nameBase']['trim']())return b['nameBase']['trim']()['toLowerCase']()['replace'](/[^a-z0-9]+/g,'_')['replace'](/^_+|_+$/g,'');const c=a['description']['toLowerCase']()['replace'](/[^a-z0-9]+/g,'_')['replace'](/^_+|_+$/g,'')['slice'](0x0,0x18)['replace'](/_+$/g,'');return c||'service';}export function buildSemanticGraph(a,b,c,d){const e=[],f=[],h=[],j=resolveNameBase(a,d),k=c?.['machine_shape']??[],l=k['filter'](u=>u['operator'])['map'](u=>u['name']+'='+u['operator'])['join'](',\x20'),m=c?.['allocator'],n=!!m&&!d?.['paymentExplicit']&&(m['count']>0x1||m['recipient']!=='signer');e['push']({'id':'main_permission','type':'permission','purpose':'Role-based\x20access\x20control\x20for\x20merchant,\x20customer,\x20and\x20optional\x20arbitrator','derivedFrom':{'intentField':'roles','rationale':'All\x20WOW\x20services\x20require\x20a\x20Permission\x20object\x20for\x20role\x20management'},'config':{'name':{'type':'string','value':j+'_permission','mapsTo':'object.name'}},'expectedState':{'published':!![],'paused':![]}});(a['intent']['startsWith']('sell_')||a['intent']==='rent_asset')&&(e['push']({'id':'main_service','type':'service','purpose':'Main\x20service\x20offering:\x20'+a['description'],'derivedFrom':{'intentField':'description','rationale':'Service\x20is\x20the\x20primary\x20object\x20representing\x20the\x20merchant\x20offering'},'config':{'name':{'type':'string','value':j+'_service','mapsTo':'object.name'},'type_parameter':{'type':'string','value':a['payment']['currency'],'mapsTo':'object.type_parameter'},'permission':{'type':'address_ref','targetId':'main_permission','mapsTo':'object.permission'}},'expectedState':{'published':!![],'paused':![]}}),f['push']({'from':'main_service','to':'main_permission','relation':'requires_permission','required':!![],'derivedFrom':{'intentField':'roles','rationale':'Service\x20must\x20reference\x20its\x20Permission\x20object'}}));(a['payment']['model']==='milestone'||a['deliverables']['length']>0x1||k['length']>0x0)&&(e['push']({'id':'main_machine','type':'machine','purpose':'Workflow\x20controlling\x20deliverable\x20milestones\x20and\x20acceptance','derivedFrom':k['length']>0x0?{'intentField':'industry','rationale':'Mode\x20\x27'+c['name']+'\x27\x20machine_shape\x20prior:\x20'+k['length']+'\x20nodes'}:{'intentField':'deliverables','rationale':'Multiple\x20deliverables\x20or\x20milestone\x20payment\x20requires\x20Machine\x20workflow'},'config':{'name':{'type':'string','value':j+'_machine','mapsTo':'object.name'},'permission':{'type':'address_ref','targetId':'main_permission','mapsTo':'object.permission'},...k['length']>0x0?{'nodes':{'type':'string','value':k['map'](u=>u['name'])['join']('\x20→\x20'),'mapsTo':'machine.nodes'}}:{},...l['length']>0x0?{'operators':{'type':'string','value':l,'mapsTo':'machine.forwards.named_operator'}}:{}},'expectedState':{'published':!![],'paused':![]}}),e['find'](u=>u['id']==='main_service')&&f['push']({'from':'main_service','to':'main_machine','relation':'uses_machine','required':!![],'derivedFrom':{'intentField':'deliverables','rationale':'Service\x20binds\x20to\x20Machine\x20for\x20workflow\x20execution'}}));(a['payment']['model']==='milestone'||a['payment']['model']==='escrow'||a['trust']['escrow']||n)&&(e['push']({'id':'main_allocation','type':'allocation','purpose':'Order\x20fund\x20routing\x20via\x20Service.order_allocators\x20(frozen\x20at\x20publish;\x20settlement\x20fires\x20via\x20alloc_by_guard)','derivedFrom':n&&a['payment']['model']!=='milestone'&&a['payment']['model']!=='escrow'&&!a['trust']['escrow']?{'intentField':'industry','rationale':'Mode\x20\x27'+c['name']+'\x27\x20allocator\x20prior:\x20'+m['description']}:{'intentField':'payment.allocation','rationale':'Escrow/milestone\x20requires\x20Allocation\x20for\x20fund\x20routing'},'config':{'name':{'type':'string','value':j+'_allocation','mapsTo':'object.name'},'type_parameter':{'type':'string','value':a['payment']['currency'],'mapsTo':'object.type_parameter'},'permission':{'type':'address_ref','targetId':'main_permission','mapsTo':'object.permission'},...m?{'allocator_strategy':{'type':'string','value':m['description'],'mapsTo':'allocation.strategy'},...m['rows']?.['length']?{'allocator_rows':{'type':'string','value':m['rows']['map'](u=>u['track']+':'+u['mode']+':'+u['recipient']+(u['recipient_key']?'('+u['recipient_key']+')':'')+(u['value']!==undefined?'='+u['value']:u['value_from']?'<-'+u['value_from']:''))['join']('\x20|\x20'),'mapsTo':'allocation.rows'}}:{'allocator_mode':{'type':'enum','value':m['mode'],'allowed':['amount','rate','surplus'],'mapsTo':'allocation.mode'}},'allocator_recipient_count':{'type':'number','value':m['count'],'mapsTo':'allocation.recipients'},...m['refund_track']?{'allocator_refund_track':{'type':'string','value':m['refund_track'],'mapsTo':'allocation.refund_track'}}:{},...m['once_per_order']!==undefined?{'allocator_once_per_order':{'type':'boolean','value':m['once_per_order'],'mapsTo':'allocation.once_per_order'}}:{}}:{}},'expectedState':{'published':!![],'paused':![]}}),e['find'](u=>u['id']==='main_service')&&f['push']({'from':'main_service','to':'main_allocation','relation':'has_order_allocators','required':!![],'derivedFrom':{'intentField':'payment','rationale':'Service\x20must\x20bind\x20Allocation\x20for\x20order\x20fund\x20routing'}}));a['trust']['arbitration']!=='none'&&(e['push']({'id':'main_arbitration','type':'arb','purpose':'Independent\x20dispute\x20resolution','derivedFrom':{'intentField':'trust.arbitration','rationale':'Arbitration\x20object\x20provides\x20binding\x20dispute\x20resolution'},'config':{'name':{'type':'string','value':j+'_arbitration','mapsTo':'object.name'},'type_parameter':{'type':'string','value':a['payment']['currency'],'mapsTo':'object.type_parameter'}},'expectedState':{'published':!![],'paused':![]}}),e['push']({'id':'arb_permission','type':'permission','purpose':'Independent\x20permission\x20for\x20arbitration\x20(MUST\x20differ\x20from\x20Service.permission)','derivedFrom':{'intentField':'trust.arbitration','rationale':'Contract-enforced:\x20arbitration.permission\x20!=\x20service.permission\x20(E_ARBITRATION_PERMISSION_CONFLICT=33)'},'config':{'name':{'type':'string','value':j+'_arb_permission','mapsTo':'object.name'}},'expectedState':{'published':!![],'paused':![]}}),f['push']({'from':'main_arbitration','to':'arb_permission','relation':'requires_permission','required':!![],'derivedFrom':{'intentField':'trust.arbitration','rationale':'Arbitration\x20requires\x20its\x20own\x20Permission'}}),e['find'](u=>u['id']==='main_service')&&f['push']({'from':'main_service','to':'main_arbitration','relation':'has_arbitration','required':![],'derivedFrom':{'intentField':'trust.arbitration','rationale':'Service\x20references\x20Arbitration\x20in\x20arbitrations\x20list'}}));const o=b['some'](u=>u['id']==='wip_provenance'||u['id']==='subscription_with_proof'||u['id']==='damage_attestation');o&&e['push']({'id':'main_repository','type':'repository','purpose':'Store\x20WIP\x20hashes\x20and\x20delivery\x20evidence','derivedFrom':{'intentField':'deliverables','rationale':'WIP\x20provenance\x20requires\x20Repository\x20for\x20hash\x20commitments'},'config':{'name':{'type':'string','value':j+'_repository','mapsTo':'object.name'},'permission':{'type':'address_ref','targetId':'main_permission','mapsTo':'object.permission'}},'expectedState':{'published':!![],'paused':![]}});for(const u of b){for(const v of u['templateRefs']){if(v['object_type']==='guard')e['push']({'id':'guard_'+u['id'],'type':'guard','purpose':v['purpose'],'derivedFrom':{'intentField':'trust','rationale':'Guard\x20for\x20'+u['name']+'\x20module'},'config':{'name':{'type':'string','value':j+'_'+u['id']+'_guard','mapsTo':'object.name'}},'expectedState':{'published':!![],'paused':![]}});else{if(v['template_id']['startsWith']('supplier-')){const w='supplier_'+u['id']+'_'+v['object_type'];if(e['some'](y=>y['id']===w))continue;e['push']({'id':w,'type':v['object_type'],'purpose':v['purpose'],'derivedFrom':{'intentField':'roles.suppliers','rationale':'Supplier\x20'+v['object_type']+'\x20for\x20'+u['name']+'\x20(B-6\x20two-hop\x20waterfall)'},'config':{'name':{'type':'string','value':j+'_'+u['id']+'_'+v['object_type'],'mapsTo':'object.name'}},'expectedState':{'published':!![],'paused':![]}});const x=e['find'](y=>y['id']==='main_service');x&&f['push']({'from':'main_service','to':w,'relation':'sub_order','required':![],'derivedFrom':{'intentField':'payment.allocation','rationale':'Two-hop\x20waterfall:\x20main\x20order\x20→\x20tier-1\x20allocation\x20→\x20supplier\x20sub-order\x20→\x20tier-2\x20allocation\x20('+u['name']+')'}});}}}}if(a['intent']['startsWith']('sell_')||a['intent']==='rent_asset'){e['push']({'id':'main_contact','type':'contact','purpose':'Public\x20contact/IM\x20channel\x20so\x20customers\x20can\x20reach\x20the\x20merchant\x20before\x20ordering','derivedFrom':{'intentField':'description','rationale':'A\x20discoverable\x20contact\x20object\x20improves\x20customer\x20trust\x20and\x20order\x20conversion'},'config':{'name':{'type':'string','value':j+'_contact','mapsTo':'object.name'},'description':{'type':'string','value':a['description'],'mapsTo':'object.description'}},'expectedState':{'published':!![],'paused':![]}});const y=e['find'](z=>z['id']==='main_service');y&&(y['config']['um']={'type':'address_ref','targetId':'main_contact','mapsTo':'object.um'},f['push']({'from':'main_service','to':'main_contact','relation':'has_contact','required':![],'derivedFrom':{'intentField':'description','rationale':'Service\x20binds\x20Contact\x20via\x20um\x20so\x20customers\x20can\x20reach\x20the\x20merchant'}}));}(a['intent']['startsWith']('sell_')||a['intent']==='rent_asset')&&(e['push']({'id':'main_reward','type':'reward','purpose':'Optional\x20incentive\x20pool\x20(discount/referral)\x20to\x20attract\x20and\x20retain\x20customers','derivedFrom':{'intentField':'payment','rationale':'Rewards\x20lower\x20acquisition\x20cost\x20and\x20boost\x20conversion'},'config':{'name':{'type':'string','value':j+'_reward','mapsTo':'object.name'},'type_parameter':{'type':'string','value':a['payment']['currency'],'mapsTo':'object.type_parameter'},'permission':{'type':'address_ref','targetId':'main_permission','mapsTo':'object.permission'}},'expectedState':{'published':!![],'paused':![]}}),e['find'](z=>z['id']==='main_service')&&f['push']({'from':'main_service','to':'main_reward','relation':'has_rewards','required':![],'derivedFrom':{'intentField':'payment','rationale':'Service\x20can\x20reference\x20Reward\x20in\x20its\x20rewards\x20list'}}));if(c?.['guards']?.['length']){const z=B=>{switch(B){case'service':return e['find'](C=>C['id']==='main_service')?.['id'];case'machine':return e['find'](C=>C['id']==='main_machine')?.['id'];case'reward':return e['find'](C=>C['id']==='main_reward')?.['id'];case'repository':return e['find'](C=>C['id']==='main_repository')?.['id'];case'arbitration':return e['find'](C=>C['id']==='main_arbitration')?.['id'];default:return undefined;}},A=new Map();for(const B of c['guards']){const C=A['get'](B['template_id'])??0x0;A['set'](B['template_id'],C+0x1);const D=C===0x0?'guard_'+B['template_id']:'guard_'+B['template_id']+'_'+(C+0x1);if(e['some'](F=>F['id']===D))continue;const E=z(B['host']);if(!E)continue;e['push']({'id':D,'type':'guard','purpose':B['purpose'],'derivedFrom':{'intentField':'industry','rationale':'Mode\x20\x27'+c['name']+'\x27\x20guard\x20prior\x20('+B['host']+'\x20host,\x20instance\x20'+(C+0x1)+')'},'config':{'name':{'type':'string','value':guardObjectName(j,B['template_id'],C),'mapsTo':'object.name'},'template':{'type':'string','value':B['template_id'],'mapsTo':'guard.template'}},'expectedState':{'published':!![],'paused':![]}}),f['push']({'from':E,'to':D,'relation':'has_guard','required':![],'derivedFrom':{'intentField':'industry','rationale':'Mode\x20\x27'+c['name']+'\x27\x20attaches\x20'+B['template_id']+'\x20to\x20'+B['host']}});}}if(c?.['config_overrides'])for(const [F,G]of Object['entries'](c['config_overrides'])){for(const H of e){if(H['type']!==F)continue;for(const [I,J]of Object['entries'](G)){if(H['config'][I]!==undefined)continue;if(typeof J==='string')H['config'][I]={'type':'string','value':J,'mapsTo':'object.'+I};else{if(typeof J==='number')H['config'][I]={'type':'number','value':J,'mapsTo':'object.'+I};else typeof J==='boolean'&&(H['config'][I]={'type':'boolean','value':J,'mapsTo':'object.'+I});}}}}h['push']({'id':'service_permission_bound','level':'hard','description':'Service\x20must\x20be\x20bound\x20to\x20a\x20Permission\x20object','source':{'layer':'contract','reference':'permission\x20field\x20is\x20required'},'fixSuggestion':'Create\x20Permission\x20object\x20first,\x20then\x20reference\x20it\x20in\x20Service.object.permission'});a['trust']['arbitration']!=='none'&&h['push']({'id':'arbitration_permission_independent','level':'hard','description':'Arbitration.permission\x20MUST\x20be\x20different\x20from\x20Service.permission','source':{'layer':'contract','reference':'E_ARBITRATION_PERMISSION_CONFLICT=33'},'fixSuggestion':'Create\x20a\x20dedicated\x20Permission\x20object\x20for\x20Arbitration,\x20do\x20NOT\x20reuse\x20Service.permission'});a['payment']['model']==='milestone'&&h['push']({'id':'machine_bound_before_publish','level':'hard','description':'Machine\x20must\x20be\x20published\x20and\x20bound\x20to\x20Service\x20before\x20Service.publish','source':{'layer':'contract','reference':'machine\x20is\x20IMMUTABLE\x20after\x20publish'},'fixSuggestion':'Create\x20and\x20publish\x20Machine\x20before\x20calling\x20Service.publish.\x20Machine\x20cannot\x20be\x20changed\x20after\x20Service\x20is\x20published.'});if(c){h['push']({'id':'mode_key_risk','level':'info','description':'['+c['display_name']+']\x20key\x20risk:\x20'+c['key_risk'],'source':{'layer':'industry_mode','reference':c['name']},'fixSuggestion':c['build_notes']?.[0x0]??'Adopt\x20the\x20mode\x27s\x20guard/allocator\x20priors\x20when\x20materializing\x20objects'});for(let K=0x0;K<(c['build_notes']??[])['length'];K++){h['push']({'id':'mode_build_note_'+K,'level':'info','description':'['+c['display_name']+']\x20'+c['build_notes'][K],'source':{'layer':'industry_mode','reference':c['name']},'fixSuggestion':'Apply\x20this\x20note\x20during\x20object\x20materialization'});}c['risk_constraints']['require_arbitration']&&a['trust']['arbitration']==='none'&&h['push']({'id':'mode_requires_arbitration','level':'soft','description':'Mode\x20\x27'+c['display_name']+'\x27\x20requires\x20arbitration,\x20but\x20intent\x20trust.arbitration\x20is\x20\x27none\x27','source':{'layer':'industry_mode','reference':c['name']+'.risk_constraints.require_arbitration'},'fixSuggestion':'Set\x20guide_confirm.trust.arbitration\x20to\x20a\x20dispute\x20resolution\x20mode,\x20or\x20the\x20plan\x20ships\x20without\x20the\x20mode\x27s\x20safety\x20net'});}const p=calculateModuleScoreBoost(b),q=Math['min'](0x64,0x28+Object['values'](p)['reduce']((L,M)=>L+M,0x0)/0x2),r=Math['min'](0x64,0x32+(p['trust']??0x0)+(p['fund_safety']??0x0)),s=Math['min'](0x64,0x1e+b['length']*0x8),t={'estimatedRiskScore':q,'estimatedTrustScore':r,'estimatedCompletenessScore':s,'keyRisks':[...c?['['+c['display_name']+']\x20'+c['key_risk']]:[],...a['trust']['arbitration']==='none'?['No\x20arbitration\x20configured\x20—\x20disputes\x20have\x20no\x20resolution\x20path']:[],...a['payment']['model']==='upfront'&&a['trust']['refundPolicy']==='no_refund'?['Full\x20upfront\x20+\x20no\x20refund\x20=\x20high\x20user\x20risk']:[]],'strengths':[...b['map'](L=>L['name']+':\x20'+L['description']['slice'](0x0,0x3c)+'...'),...(c?.['expected_benefits']??[])['map'](L=>L['metric']+':\x20'+L['expected_value']+'\x20('+L['evidence']+')')],'moduleBoosts':p};return{'nodes':e,'edges':f,'constraints':h,'evaluationPreview':t,'adoptedModules':b['map'](L=>L['id']),'businessIntent':a};}function calculateModuleScoreBoost(a){const b={};for(const c of a){for(const d of c['evaluationImpact']){const e=d['effect']==='required'?0xf:d['effect']==='boost'?0x8:0x3;b[d['dimension']]=(b[d['dimension']]??0x0)+e;}}return b;}export function validateGraph(a){const b=[],c=[],d=[];for(const e of a['constraints']){if(e['id']==='service_permission_bound'){const f=a['nodes']['some'](h=>h['type']==='service'),g=a['edges']['some'](h=>h['relation']==='requires_permission'&&h['from']['startsWith']('main_service'));f&&!g&&b['push'](e);}if(e['id']==='arbitration_permission_independent'){const h=a['nodes']['find'](j=>j['id']==='main_service'),i=a['nodes']['find'](j=>j['id']==='main_arbitration');if(h&&i){const j=a['edges']['find'](l=>l['from']==='main_service'&&l['relation']==='requires_permission')?.['to'],k=a['edges']['find'](l=>l['from']==='main_arbitration'&&l['relation']==='requires_permission')?.['to'];j&&k&&j===k&&b['push'](e);}}if(e['level']==='soft')c['push'](e);else e['level']==='info'&&d['push'](e);}return{'valid':b['length']===0x0,'hardViolations':b,'softViolations':c,'infoNotes':d};}