@wowok/agent-mcp 3.4.2 → 3.4.3

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 (308) hide show
  1. package/dist/.build-stamp.json +5 -0
  2. package/dist/chain-semantics/composition-truth.js +1 -1
  3. package/dist/chain-semantics/eval-order.js +1 -1
  4. package/dist/chain-semantics/field-capability.js +1 -1
  5. package/dist/chain-semantics/freeze-map.js +1 -1
  6. package/dist/chain-semantics/fund-flow.js +1 -1
  7. package/dist/chain-semantics/guard-verbs.js +1 -1
  8. package/dist/chain-semantics/object-graph.js +1 -1
  9. package/dist/composition/audit.js +1 -1
  10. package/dist/composition/compile.d.ts +10 -3
  11. package/dist/composition/compile.js +1 -1
  12. package/dist/composition/emit-phases.d.ts +30 -2
  13. package/dist/composition/emit-phases.js +1 -1
  14. package/dist/composition/guard-fill.d.ts +8 -0
  15. package/dist/composition/guard-fill.js +1 -1
  16. package/dist/composition/inflight.js +1 -1
  17. package/dist/composition/input-normalize.js +1 -1
  18. package/dist/composition/materialize.d.ts +2 -0
  19. package/dist/composition/materialize.js +1 -1
  20. package/dist/composition/mode-gates.js +1 -1
  21. package/dist/composition/param-disclosure.js +1 -1
  22. package/dist/composition/plan-retry-ledger.d.ts +16 -0
  23. package/dist/composition/plan-retry-ledger.js +1 -1
  24. package/dist/composition/plan.d.ts +15 -1
  25. package/dist/composition/plan.js +1 -1
  26. package/dist/config/config-audit.spec.js +1 -1
  27. package/dist/config/judgment.d.ts +5 -0
  28. package/dist/config/judgment.js +1 -1
  29. package/dist/evaluation/builtins/arbitration-score.d.ts +1 -0
  30. package/dist/evaluation/builtins/arbitration-score.js +1 -1
  31. package/dist/evaluation/builtins/demand-match.js +1 -1
  32. package/dist/evaluation/builtins/graph-service.d.ts +8 -0
  33. package/dist/evaluation/builtins/graph-service.js +1 -1
  34. package/dist/evaluation/capability.d.ts +9 -0
  35. package/dist/evaluation/engine.js +1 -1
  36. package/dist/evaluation/extract.d.ts +9 -1
  37. package/dist/evaluation/extract.js +1 -1
  38. package/dist/evaluation/match-operation.js +1 -1
  39. package/dist/evaluation/match-policy.d.ts +5 -3
  40. package/dist/evaluation/match-policy.js +1 -1
  41. package/dist/evaluation/standards.d.ts +1 -0
  42. package/dist/evaluation/standards.js +1 -1
  43. package/dist/evaluation/structured-lines.js +1 -1
  44. package/dist/evaluation/types.d.ts +1 -0
  45. package/dist/extensions/capability.js +1 -1
  46. package/dist/harness/recover.js +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/intent/types.d.ts +1 -1
  49. package/dist/intent/types.js +1 -1
  50. package/dist/knowledge/allocation-ledger.js +1 -1
  51. package/dist/knowledge/allocator-rail-verifier.d.ts +17 -1
  52. package/dist/knowledge/allocator-rail-verifier.js +1 -1
  53. package/dist/knowledge/arb-fund-facts.d.ts +7 -0
  54. package/dist/knowledge/arb-fund-facts.js +1 -1
  55. package/dist/knowledge/arbitration-rail-verifier.d.ts +35 -0
  56. package/dist/knowledge/arbitration-rail-verifier.js +1 -0
  57. package/dist/knowledge/audit-rules.d.ts +11 -0
  58. package/dist/knowledge/audit-rules.js +1 -1
  59. package/dist/knowledge/baselines/judgment-baselines.json +1 -0
  60. package/dist/knowledge/baselines/rules/guard.json +7 -6
  61. package/dist/knowledge/baselines/rules/progress.json +4 -4
  62. package/dist/knowledge/baselines/rules/reward.json +118 -3
  63. package/dist/knowledge/builtin-templates.d.ts +3 -2
  64. package/dist/knowledge/builtin-templates.js +1 -1
  65. package/dist/knowledge/chain-query-registry.d.ts +14 -0
  66. package/dist/knowledge/chain-query-registry.js +1 -0
  67. package/dist/knowledge/event-semantics.js +1 -1
  68. package/dist/knowledge/fee-param-bindings.d.ts +2 -0
  69. package/dist/knowledge/fee-param-bindings.js +1 -1
  70. package/dist/knowledge/getting-started.js +1 -1
  71. package/dist/knowledge/guard-binding-table.js +1 -1
  72. package/dist/knowledge/guard-binding-verifier.d.ts +7 -0
  73. package/dist/knowledge/guard-binding-verifier.js +1 -1
  74. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  75. package/dist/knowledge/guard-design-patterns.js +1 -1
  76. package/dist/knowledge/guard-host-context.js +1 -1
  77. package/dist/knowledge/guard-lint.js +1 -1
  78. package/dist/knowledge/guard-node-gates.d.ts +3 -1
  79. package/dist/knowledge/guard-node-gates.js +1 -1
  80. package/dist/knowledge/guard-puzzle.js +1 -1
  81. package/dist/knowledge/guard-render.js +1 -1
  82. package/dist/knowledge/guard-risk.js +1 -1
  83. package/dist/knowledge/guard-templates.d.ts +2 -1
  84. package/dist/knowledge/guard-templates.js +1 -1
  85. package/dist/knowledge/guard-translation.js +1 -1
  86. package/dist/knowledge/index.d.ts +2 -0
  87. package/dist/knowledge/index.js +1 -1
  88. package/dist/knowledge/industry-registry.js +1 -1
  89. package/dist/knowledge/jsonrpc-enum.js +1 -1
  90. package/dist/knowledge/knob-docs.js +1 -1
  91. package/dist/knowledge/param-schema.d.ts +1 -1
  92. package/dist/knowledge/param-schema.js +1 -1
  93. package/dist/knowledge/param-tiers.d.ts +2 -0
  94. package/dist/knowledge/param-tiers.js +1 -1
  95. package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
  96. package/dist/knowledge/pattern-resolutions.d.ts +2 -0
  97. package/dist/knowledge/pattern-resolutions.js +1 -1
  98. package/dist/knowledge/product-detail-source.d.ts +37 -0
  99. package/dist/knowledge/product-detail-source.js +1 -0
  100. package/dist/knowledge/product-doc-b5.d.ts +16 -0
  101. package/dist/knowledge/product-doc-b5.js +1 -0
  102. package/dist/knowledge/progress-ledger.js +1 -1
  103. package/dist/knowledge/projection.spec.js +1 -1
  104. package/dist/knowledge/publish-gate.d.ts +20 -0
  105. package/dist/knowledge/publish-gate.js +1 -0
  106. package/dist/knowledge/publish-readiness.d.ts +25 -0
  107. package/dist/knowledge/publish-readiness.js +1 -0
  108. package/dist/knowledge/publish-surface-contract.d.ts +16 -0
  109. package/dist/knowledge/publish-surface-contract.js +1 -0
  110. package/dist/knowledge/rail-exit-satisfiability.d.ts +25 -0
  111. package/dist/knowledge/rail-exit-satisfiability.js +1 -0
  112. package/dist/knowledge/reward-ledger.d.ts +1 -1
  113. package/dist/knowledge/reward-ledger.js +1 -1
  114. package/dist/knowledge/reward-risk.d.ts +1 -1
  115. package/dist/knowledge/reward-risk.js +1 -1
  116. package/dist/knowledge/service-ledger.d.ts +3 -1
  117. package/dist/knowledge/service-ledger.js +1 -1
  118. package/dist/knowledge/template-loader.d.ts +41 -2
  119. package/dist/knowledge/template-loader.js +1 -1
  120. package/dist/knowledge/template-registry.js +1 -1
  121. package/dist/knowledge/template-scanner.d.ts +17 -0
  122. package/dist/knowledge/template-scanner.js +1 -1
  123. package/dist/knowledge/workflow-guidance.d.ts +4 -0
  124. package/dist/knowledge/workflow-guidance.js +1 -1
  125. package/dist/monitor/MonitorLoop.js +1 -1
  126. package/dist/monitor/normalize.d.ts +1 -1
  127. package/dist/monitor/normalize.js +1 -1
  128. package/dist/monitor/types.js +1 -1
  129. package/dist/participation/game-context.js +1 -1
  130. package/dist/participation/radar-core.js +1 -1
  131. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  132. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  133. package/dist/playbooks/service-build/merchant-guide.d.ts +28 -3
  134. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  135. package/dist/playbooks/service-build/object-panorama.d.ts +4 -0
  136. package/dist/playbooks/service-build/object-panorama.js +1 -1
  137. package/dist/playbooks/service-build/participation-radar.js +1 -1
  138. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  139. package/dist/playbooks/service-build/service-panorama.js +1 -1
  140. package/dist/playbooks/service-build/service-quote.js +1 -1
  141. package/dist/review/index.js +1 -1
  142. package/dist/review/order.js +1 -1
  143. package/dist/safety/confirm-gate.js +1 -1
  144. package/dist/schema/benchmark-migration/index.d.ts +24 -0
  145. package/dist/schema/benchmark-migration/index.js +1 -1
  146. package/dist/schema/call/allocation.d.ts +11 -7
  147. package/dist/schema/call/allocation.js +1 -1
  148. package/dist/schema/call/arbitration.d.ts +4 -0
  149. package/dist/schema/call/arbitration.js +1 -1
  150. package/dist/schema/call/base.d.ts +28 -0
  151. package/dist/schema/call/base.js +1 -1
  152. package/dist/schema/call/bridge.d.ts +21 -0
  153. package/dist/schema/call/contact.d.ts +4 -0
  154. package/dist/schema/call/demand.d.ts +4 -0
  155. package/dist/schema/call/guard.d.ts +12 -0
  156. package/dist/schema/call/handler.d.ts +1 -0
  157. package/dist/schema/call/handler.js +1 -1
  158. package/dist/schema/call/machine.d.ts +16 -8
  159. package/dist/schema/call/normalize-error.d.ts +1 -0
  160. package/dist/schema/call/normalize-error.js +1 -0
  161. package/dist/schema/call/order.d.ts +7 -3
  162. package/dist/schema/call/order.js +1 -1
  163. package/dist/schema/call/payment.d.ts +7 -3
  164. package/dist/schema/call/permission.d.ts +4 -0
  165. package/dist/schema/call/personal.d.ts +4 -0
  166. package/dist/schema/call/progress.d.ts +4 -0
  167. package/dist/schema/call/progress.js +1 -1
  168. package/dist/schema/call/proof.d.ts +8 -0
  169. package/dist/schema/call/receipt.js +1 -1
  170. package/dist/schema/call/repository.d.ts +4 -0
  171. package/dist/schema/call/reward.d.ts +6 -2
  172. package/dist/schema/call/reward.js +1 -1
  173. package/dist/schema/call/semantic.d.ts +2 -2
  174. package/dist/schema/call/semantic.js +1 -1
  175. package/dist/schema/call/service.d.ts +6 -2
  176. package/dist/schema/call/treasury.d.ts +10 -6
  177. package/dist/schema/common/index.js +1 -1
  178. package/dist/schema/envelope-unify.d.ts +1 -0
  179. package/dist/schema/envelope-unify.js +1 -1
  180. package/dist/schema/evaluation/index.d.ts +43 -0
  181. package/dist/schema/evaluation/index.js +1 -1
  182. package/dist/schema/goal/index.d.ts +14 -2
  183. package/dist/schema/goal/planning.d.ts +18 -0
  184. package/dist/schema/goal/planning.js +1 -1
  185. package/dist/schema/intent-radar/index.d.ts +12 -0
  186. package/dist/schema/intent-radar/index.js +1 -1
  187. package/dist/schema/keeper/index.d.ts +1 -0
  188. package/dist/schema/local/index.d.ts +10 -0
  189. package/dist/schema/local/index.js +1 -1
  190. package/dist/schema/local/wip.js +1 -1
  191. package/dist/schema/messenger/index.d.ts +1 -0
  192. package/dist/schema/messenger/index.js +1 -1
  193. package/dist/schema/operations.d.ts +95 -12
  194. package/dist/schema/operations.js +1 -1
  195. package/dist/schema/persona/index.d.ts +22 -0
  196. package/dist/schema/query/bi.d.ts +28 -2
  197. package/dist/schema/query/bi.js +1 -1
  198. package/dist/schema/query/index.d.ts +67 -61
  199. package/dist/schema/query/index.js +1 -1
  200. package/dist/schema/schema-version.js +1 -1
  201. package/dist/schema/workflow/index.js +1 -1
  202. package/dist/schema-query-impl/index.d.ts +1 -0
  203. package/dist/schema-query-impl/index.js +1 -1
  204. package/dist/schemas/account_operation.output.json +2 -1
  205. package/dist/schemas/benchmark_migration_operation.output.json +74 -0
  206. package/dist/schemas/benchmark_migration_operation.schema.json +32 -0
  207. package/dist/schemas/bridge_operation.output.json +2 -1
  208. package/dist/schemas/bridge_operation.schema.json +40 -0
  209. package/dist/schemas/evaluation_operation.output.json +96 -0
  210. package/dist/schemas/evaluation_operation.schema.json +39 -0
  211. package/dist/schemas/goal_operation.schema.json +32 -0
  212. package/dist/schemas/guard2file.schema.json +8 -0
  213. package/dist/schemas/index.json +1 -1
  214. package/dist/schemas/intent_radar.output.json +10 -2
  215. package/dist/schemas/intent_radar.schema.json +5 -1
  216. package/dist/schemas/keeper_operation.output.json +2 -1
  217. package/dist/schemas/local_cache_operation.output.json +2 -1
  218. package/dist/schemas/local_history_operation.output.json +2 -1
  219. package/dist/schemas/local_info_operation.output.json +2 -1
  220. package/dist/schemas/local_mark_operation.output.json +2 -1
  221. package/dist/schemas/local_mark_operation.schema.json +10 -1
  222. package/dist/schemas/machineNode2file.schema.json +8 -0
  223. package/dist/schemas/messenger_operation.output.json +2 -1
  224. package/dist/schemas/messenger_operation.schema.json +2 -1
  225. package/dist/schemas/monitor_events.output.json +2 -1
  226. package/dist/schemas/monitor_subscription.output.json +2 -1
  227. package/dist/schemas/onchain_events.output.json +206 -13
  228. package/dist/schemas/onchain_events.schema.json +16 -0
  229. package/dist/schemas/onchain_operations.output.json +22 -3
  230. package/dist/schemas/onchain_operations.schema.json +971 -326
  231. package/dist/schemas/onchain_operations_allocation.schema.json +19 -12
  232. package/dist/schemas/onchain_operations_arbitration.schema.json +9 -1
  233. package/dist/schemas/onchain_operations_contact.schema.json +8 -0
  234. package/dist/schemas/onchain_operations_demand.schema.json +8 -0
  235. package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
  236. package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
  237. package/dist/schemas/onchain_operations_guard.schema.json +654 -114
  238. package/dist/schemas/onchain_operations_machine.schema.json +11 -3
  239. package/dist/schemas/onchain_operations_order.schema.json +14 -11
  240. package/dist/schemas/onchain_operations_payment.schema.json +12 -9
  241. package/dist/schemas/onchain_operations_permission.schema.json +8 -0
  242. package/dist/schemas/onchain_operations_personal.schema.json +8 -0
  243. package/dist/schemas/onchain_operations_progress.schema.json +9 -1
  244. package/dist/schemas/onchain_operations_proof.schema.json +8 -0
  245. package/dist/schemas/onchain_operations_repository.schema.json +8 -0
  246. package/dist/schemas/onchain_operations_reward.schema.json +14 -11
  247. package/dist/schemas/onchain_operations_service.schema.json +13 -10
  248. package/dist/schemas/onchain_operations_treasury.schema.json +17 -19
  249. package/dist/schemas/onchain_table_data.output.json +52 -10
  250. package/dist/schemas/persona_operation.output.json +57 -0
  251. package/dist/schemas/persona_operation.schema.json +9 -0
  252. package/dist/schemas/query_toolkit.output.json +325 -22
  253. package/dist/schemas/query_toolkit.schema.json +18 -5
  254. package/dist/schemas/wip_file.output.json +2 -2
  255. package/dist/schemas/wip_file.schema.json +2 -2
  256. package/dist/schemas/workflow_operation.schema.json +1 -1
  257. package/dist/tools/error-catalog.d.ts +17 -0
  258. package/dist/tools/error-catalog.js +1 -0
  259. package/dist/tools/handlers/benchmark-migration.d.ts +20 -8
  260. package/dist/tools/handlers/benchmark-migration.js +1 -1
  261. package/dist/tools/handlers/config.js +1 -1
  262. package/dist/tools/handlers/entry-edge-recipe.d.ts +101 -0
  263. package/dist/tools/handlers/entry-edge-recipe.js +1 -0
  264. package/dist/tools/handlers/escrow-deficit.d.ts +10 -0
  265. package/dist/tools/handlers/escrow-deficit.js +1 -0
  266. package/dist/tools/handlers/evaluation.js +1 -1
  267. package/dist/tools/handlers/fund-rail-recipe.d.ts +10 -0
  268. package/dist/tools/handlers/fund-rail-recipe.js +1 -0
  269. package/dist/tools/handlers/intent-radar.js +1 -1
  270. package/dist/tools/handlers/local.js +1 -1
  271. package/dist/tools/handlers/mark-namespace.d.ts +30 -0
  272. package/dist/tools/handlers/mark-namespace.js +1 -0
  273. package/dist/tools/handlers/messenger.js +1 -1
  274. package/dist/tools/handlers/onchain-name-registration.d.ts +1 -0
  275. package/dist/tools/handlers/onchain-name-registration.js +1 -1
  276. package/dist/tools/handlers/onchain-name-registration.spec.js +1 -1
  277. package/dist/tools/handlers/onchain.d.ts +30 -1
  278. package/dist/tools/handlers/onchain.js +1 -1
  279. package/dist/tools/handlers/publish-binding-echo.d.ts +22 -0
  280. package/dist/tools/handlers/publish-binding-echo.js +1 -0
  281. package/dist/tools/handlers/query.d.ts +1 -1
  282. package/dist/tools/handlers/query.js +1 -1
  283. package/dist/tools/handlers/review-chain.d.ts +1 -0
  284. package/dist/tools/handlers/review-chain.js +1 -1
  285. package/dist/tools/handlers/schema-query.js +1 -1
  286. package/dist/tools/handlers/stale-build-check.d.ts +9 -0
  287. package/dist/tools/handlers/stale-build-check.js +1 -0
  288. package/dist/tools/handlers/submission-assembly.d.ts +55 -0
  289. package/dist/tools/handlers/submission-assembly.js +1 -0
  290. package/dist/tools/handlers/wip.js +1 -1
  291. package/dist/tools/index.d.ts +1 -0
  292. package/dist/tools/index.js +1 -1
  293. package/dist/tools/move-fn-index.gen.js +1 -1
  294. package/dist/tools/publish-gate-state.d.ts +5 -0
  295. package/dist/tools/publish-gate-state.js +1 -0
  296. package/dist/tools/registry/business.js +1 -1
  297. package/dist/tools/registry/onchain.js +1 -1
  298. package/dist/tools/registry/query.js +1 -1
  299. package/dist/tools/retry.js +1 -1
  300. package/dist/tools/runtime-health.js +1 -1
  301. package/dist/tools/shared.js +1 -1
  302. package/dist/tools/upgrade-check.d.ts +1 -0
  303. package/dist/tools/upgrade-check.js +1 -1
  304. package/dist/tools/wip-verify-ledger.d.ts +2 -0
  305. package/dist/tools/wip-verify-ledger.js +1 -1
  306. package/dist/tools/wrap.d.ts +15 -1
  307. package/dist/tools/wrap.js +1 -1
  308. package/package.json +5 -3
@@ -1 +1 @@
1
- import{getGuardHostContext}from'./guard-host-context.js';function isIdentityQuery(a){const b=a['toLowerCase']();if(b['startsWith']('context')||b['includes']('signer'))return!![];return/order\.agent|permission\.(owner|admin)|named.?operator/['test'](b);}function children(a){if(Array['isArray'](a['nodes']))return a['nodes'];if(a['node'])return[a['node']];return[];}function walk(a,b){if(!a||typeof a!=='object')return;const d=a;b(d);for(const e of children(d))walk(e,b);}function deadNamespaces(a){switch(a){case'reward_claim':case'service_buy_guard':case'gen_passport':case'demand_present':case'treasury_external_deposit':case'treasury_external_withdraw':return['order.','progress.'];case'arbitration_usage':return['order.','arb.'];default:return[];}}function deadLegCode(a){switch(a){case'reward_claim':return'RC_NO_ORDER_ANCHOR';case'service_buy_guard':return'SB_NO_ORDER_STATE';case'gen_passport':return'GP_NO_ORDER_AT_ISSUANCE';case'arbitration_usage':return'AU_DEAD_CASE_SCOPES';default:return'BV_DEAD_NAMESPACE_LEG';}}function slotInComparison(a,b){let c=![];return walk(a,d=>{if(c)return;if(!Array['isArray'](d['nodes'])||d['nodes']['length']<0x2)return;if(!/logic_/['test'](d['type']??''))return;for(const e of d['nodes']){if(e?.['type']==='identifier'&&e['identifier']===b){c=!![];return;}}}),c;}export function verifyGuardBinding(a){const b=[],{host:c,root:d,facts:e}=a;if(!d)return b;if(c==='reward_claim'&&e?.['order_submission_declared']){}else{const f=deadNamespaces(c);if(f['length']>0x0){const g=[];walk(d,h=>{if(typeof h['query']==='string')for(const i of f){if(h['query']['startsWith'](i)&&!g['includes'](i))g['push'](i);}});if(g['length']>0x0){const h=getGuardHostContext(c);b['push']({'code':deadLegCode(c),'host':c,'level':'warning','detail':'Query\x20namespace(s)\x20'+g['map'](i=>'\x22'+i+'*\x22')['join'](',\x20')+'\x20cannot\x20resolve\x20in\x20the\x20'+(c+'\x20evaluation\x20context\x20('+(h?.['order_anchor']??'no\x20anchor')+')\x20—\x20these\x20legs\x20are\x20')+'structurally\x20dead\x20here;\x20under\x20an\x20AND\x20scope\x20they\x20brick\x20the\x20branch,\x20negated\x20they\x20'+'short-circuit\x20it.\x20See\x20guard-host-context.ts.'});}}}(c==='treasury_external_withdraw'||c==='treasury_external_deposit')&&e?.['amount_slot']!==undefined&&(!slotInComparison(d,e['amount_slot'])&&(c==='treasury_external_withdraw'?b['push']({'code':'TW_AMOUNT_UNBOUNDED','host':c,'level':'warning','detail':'Amount\x20slot\x20'+e['amount_slot']+'\x20appears\x20only\x20as\x20a\x20submission\x20source,\x20never\x20inside\x20a\x20'+'comparison\x20leg\x20—\x20the\x20withdrawal\x20size\x20is\x20caller-chosen\x20up\x20to\x20the\x20full\x20balance\x20(the\x20'+'chain\x20debits\x20the\x20declared\x20number).\x20Non-open\x20venues\x20must\x20bound\x20the\x20slot.'}):b['push']({'code':'TD_AMOUNT_SLOT_SEMANTICS','host':c,'level':'info','detail':'Amount\x20slot\x20'+e['amount_slot']+'\x20is\x20unconstrained\x20—\x20the\x20depositor\x20sizes\x20the\x20credit\x20'+'(partial\x20deposit,\x20remainder\x20refunded;\x20whole\x20coin\x20when\x20the\x20identifier\x20is\x20omitted).\x20'+'Lower\x20stakes\x20than\x20the\x20withdraw\x20channel;\x20disclosure\x20only.'})));if(c==='machine_forward'&&e?.['declared_slots']){const i=e['declared_slots'],j=[];walk(d,k=>{if(!Array['isArray'](k['nodes'])||k['nodes']['length']<0x2)return;if(!/logic_/['test'](k['type']??''))return;for(const [l,m]of[[k['nodes'][0x0],k['nodes'][0x1]],[k['nodes'][0x1],k['nodes'][0x0]]]){if(typeof l?.['query']==='string'&&isIdentityQuery(l['query'])&&m?.['type']==='identifier'&&m['identifier']!==undefined){if(!i['includes'](m['identifier'])&&!j['includes'](m['identifier']))j['push'](m['identifier']);}}}),j['length']>0x0&&b['push']({'code':'MF_SLOT_IDENTITY_ANCHOR','host':c,'level':'critical','detail':'Identity\x20leg(s)\x20anchored\x20to\x20submission\x20slot(s)\x20'+j['join'](',\x20')+'\x20that\x20the\x20edge\x20does\x20not\x20'+('declare\x20(declared:\x20'+(i['join'](',\x20')||'none')+')\x20—\x20the\x20caller\x20controls\x20those\x20slots,\x20')+'so\x20the\x20identity\x20check\x20reads\x20attacker-chosen\x20data\x20(T10\x20hijack).\x20Anchor\x20to\x20the\x20edge\x27s\x20'+'task-binding\x20slot\x20instead.'});}if(c==='progress_submission'){let k=![];walk(d,l=>{if(typeof l['query']==='string'&&isIdentityQuery(l['query']))k=!![];}),!k&&b['push']({'code':'PS_IDENTITY_REQUIRED','host':c,'level':'info','detail':'No\x20identity\x20leg\x20on\x20this\x20attestation\x20guard\x20—\x20attestations\x20are\x20replayable\x20without\x20one.\x20'+'Acceptable\x20only\x20when\x20the\x20riding\x20edge\x20verifies\x20the\x20submitter\x20upstream.'});}{let l=![];walk(d,m=>{if(typeof m['query']==='string'&&m['query']['startsWith']('repository'))l=!![];}),l&&b['push']({'code':c==='repository_write'?'RW_QUOTE_GUARD_CARRY':'RQ_CARRY_OBLIGATION','host':c,'level':'info','detail':'This\x20tree\x20reads\x20repository\x20data\x20—\x20the\x20consuming\x20passport\x20must\x20declare\x20the\x20governing\x20'+'policy\x27s\x20quote_guard\x20in\x20its\x20impack\x20(QUOTE-GUARD\x20CARRY),\x20or\x20the\x20query\x20fails\x20closed\x20at\x20'+'evaluation\x20time.'});}if(c==='repository_write'){let m=![];walk(d,o=>{typeof o['query']==='string'&&/(sum_where|count_where|find_where)/['test'](o['query'])&&(m=!![]);}),m&&b['push']({'code':'RW_OPEN_WRITE_FEEDS_AGGREGATE','host':c,'level':e?.['open_write_aggregate_rows']===!![]?'critical':'warning','detail':'This\x20write\x20channel\x27s\x20guard\x20reads\x20repository\x20AGGREGATES\x20(row-set\x20sum\x20/\x20count\x20/\x20find)\x20—\x20'+'the\x20aggregate\x20is\x20forgeable\x20by\x20write\x20whenever\x20the\x20rows\x20feeding\x20it\x20can\x20be\x20written\x20through\x20'+'an\x20open\x20(unguarded)\x20channel,\x20and\x20every\x20decision\x20this\x20guard\x20derives\x20from\x20the\x20aggregate\x20is\x20'+'forged\x20with\x20it.\x20Verify\x20every\x20feeding\x20row\x20policy\x20carries\x20a\x20write_guard\x20binding\x20a\x20trusted\x20'+'writer\x20role\x20BEFORE\x20this\x20binding\x20goes\x20live'+(e?.['open_write_aggregate_rows']===!![]?';\x20host\x20facts\x20PROVE\x20at\x20least\x20one\x20feeding\x20row\x20is\x20openly\x20writable\x20—\x20treat\x20as\x20a\x20hard\x20block.':';\x20the\x20feeding\x20policies\x20could\x20not\x20be\x20proven\x20either\x20way\x20at\x20binding\x20time\x20—\x20disclosure.')});}return c==='demand_present'&&(e?.['demand_guard_count']??0x0)>0x1&&b['push']({'code':'DP_MULTI_GUARD_IS_OR','host':c,'level':'info','detail':e['demand_guard_count']+'\x20guards\x20registered\x20on\x20the\x20demand\x20—\x20the\x20presenter\x20passes\x20ANY\x20ONE\x20'+'of\x20them\x20(presenter-chosen\x20OR).\x20A\x20strict\x20gate\x20belongs\x20inside\x20EVERY\x20'+'guard\x20(or\x20one\x20guard),\x20not\x20across\x20the\x20list.'}),b;}export function auditGuardRelies(a){const b=[];if(a['child_count']<=0x0)return b;const c=a['from_host']!==a['to_host'];return b['push']({'code':'GR_CHILD_HOST_REAUDIT','host':'guard_relied','level':c?'warning':'info','detail':a['child_count']+'\x20relied\x20child\x20guard(s)\x20INHERIT\x20the\x20parent\x27s\x20host\x20context.\x20'+(c?'Host\x20change\x20'+(a['from_host']||'(unbound)')+'\x20→\x20'+a['to_host']+':\x20re-audit\x20EVERY\x20child\x20against\x20'+'the\x20new\x20host\x27s\x20signer\x20/\x20order\x20anchor\x20/\x20submission\x20channel\x20(guard-host-context.ts,\x20'+('host\x20\x22'+a['to_host']+'\x22)\x20before\x20binding.'):'Binding\x20host\x20\x22'+a['to_host']+'\x22\x20unchanged\x20—\x20children\x20already\x20audited\x20for\x20this\x20context.')}),b['push']({'code':'GR_CLOSURE_CARRY','host':'guard_relied','level':'info','detail':'Every\x20passport\x20carrying\x20the\x20parent\x20must\x20carry\x20ALL\x20relied\x20children\x20first\x20(E_RELIES_GUARD_NOT_ADDED).\x20'+'Communicate\x20the\x20full\x20carry\x20closure\x20in\x20the\x20passport\x20build\x20steps.'+(a['logic_and']===![]?'\x20relies_logic_and\x20is\x20OR:\x20any\x20passing\x20child\x20satisfies\x20—\x20the\x20acceptance\x20surface\x20is\x20the\x20UNION\x20of\x20the\x20children.':'')}),b;}export function auditQuoteGuardCandidate(a){const b=[];if(a['immutable']===![])b['push']('mutable\x20(immutable\x20flag\x20false)');if(a['rep']===![])b['push']('rep\x20flag\x20false');if((a['relies_count']??0x0)>0x0)b['push']('carries\x20relies\x20(depth\x20must\x20be\x200)');if(b['length']===0x0)return[];return[{'code':'RQ_DEPENDED_ONLY','host':'repository_quote','level':'warning','detail':'Quote-guard\x20candidate\x20is\x20NOT\x20depended:\x20'+b['join'](';\x20')+'\x20—\x20quote-guard\x20binding\x20aborts\x20'+'(E_NEED_DEPENDENT_GUARD;\x20the\x20depended\x20shape\x20=\x20relies\x20empty\x20+\x20immutable\x20+\x20rep).\x20Rebuild\x20the\x20'+'guard\x20as\x20a\x20frozen\x20leaf\x20before\x20binding.'}];}
1
+ import{getGuardHostContext}from'./guard-host-context.js';import{findRegistryDeadLegs}from'./publish-gate.js';function isIdentityQuery(a){const b=a['toLowerCase']();if(b['startsWith']('context')||b['includes']('signer'))return!![];return/order\.agent|permission\.(owner|admin)|named.?operator/['test'](b);}function children(a){if(Array['isArray'](a['nodes']))return a['nodes'];if(a['node'])return[a['node']];return[];}function walk(a,b){if(!a||typeof a!=='object')return;const d=a;b(d);for(const e of children(d))walk(e,b);}function deadNamespaces(a){switch(a){case'reward_claim':case'service_buy_guard':case'gen_passport':case'demand_present':case'treasury_external_deposit':case'treasury_external_withdraw':return['order.','progress.'];case'arbitration_usage':return['order.','arb.'];default:return[];}}function deadLegCode(a){switch(a){case'reward_claim':return'RC_NO_ORDER_ANCHOR';case'service_buy_guard':return'SB_NO_ORDER_STATE';case'gen_passport':return'GP_NO_ORDER_AT_ISSUANCE';case'arbitration_usage':return'AU_DEAD_CASE_SCOPES';default:return'BV_DEAD_NAMESPACE_LEG';}}function slotInComparison(a,b){let c=![];return walk(a,d=>{if(c)return;if(!Array['isArray'](d['nodes'])||d['nodes']['length']<0x2)return;if(!/logic_/['test'](d['type']??''))return;for(const e of d['nodes']){if(e?.['type']==='identifier'&&e['identifier']===b){c=!![];return;}}}),c;}export function verifyGuardBinding(a){const b=[],{host:c,root:d,facts:e}=a;if((e?.['declared_permission_indexes']?.['length']??0x0)>0x0){const h=e['declared_permission_indexes']['filter'](j=>j>=0x3e8)['filter']((j,k,l)=>l['indexOf'](j)===k)['sort']((i,j)=>i-j);if(h['length']>0x0){const i=e?.['host_permission_indexes']!==undefined||e?.['host_permission_entity_count']!==undefined,j=e?.['host_permission_entity_count']===0x0,k=new Set(e?.['host_permission_indexes']??[]),l=i?h['filter'](m=>j||!k['has'](m)):[];if(i&&l['length']>0x0)b['push']({'code':'PERM_INDEX_UNRESOLVED','host':c,'level':'critical','detail':'Edge\x20declares\x20permission\x20index(es)\x20['+l['join'](',\x20')+']\x20with\x20NO\x20entity\x20grant\x20on\x20the\x20'+'host\x20Permission\x20face'+(j?'\x20(entity_count\x20=\x200\x20—\x20the\x20face\x20is\x20EMPTY)':'')+'\x20—\x20no\x20one\x20can\x20execute\x20this\x20edge,\x20so\x20the\x20state\x20track\x20it\x20carries\x20is\x20structurally\x20'+'unreachable.\x20The\x20rex7\x20mainnet\x20o9\x20case\x20awarded\x200.10\x20and\x20the\x20buyer\x20could\x20never\x20push\x20the\x20'+'ArbRefund\x20relief\x20edge\x20(permission_index\x201002,\x20store\x20entity_count\x200):\x20the\x20winning\x20party\x20'+'was\x20locked\x20out\x20of\x20the\x20ruling\x27s\x20remedy.\x20Grant\x20at\x20least\x20one\x20entity\x20per\x20index\x20'+'(permission\x20op\x20\x22add\x20perm\x20by\x20index\x22)\x20BEFORE\x20this\x20binding\x20goes\x20live.'});else!i&&b['push']({'code':'PERM_INDEX_UNRESOLVED','host':c,'level':'warning','detail':'Edge\x20declares\x20permission\x20index(es)\x20['+h['join'](',\x20')+']\x20—\x20the\x20host\x27s\x20Permission\x20face\x20'+'could\x20NOT\x20be\x20read\x20at\x20binding\x20time\x20(host\x20unknown\x20or\x20entity\x20table\x20unreadable),\x20so\x20index\x20'+'reachability\x20is\x20UNVERIFIED.\x20If\x20the\x20host\x20store\x20has\x20no\x20Entity\x20granted\x20these\x20indexes,\x20the\x20'+'edge\x20is\x20un\x20drivable\x20and\x20the\x20track\x20it\x20carries\x20(e.g.\x20the\x20arbitration\x20relief\x20rail)\x20is\x20dead\x20'+'—\x20rex7\x20mainnet\x20o9\x20precedent:\x20ArbRefund\x20declared\x201002,\x20store\x20entity_count\x200,\x20the\x20buyer\x20could\x20'+'never\x20fire\x20the\x20won\x20ruling\x27s\x20refund\x20edge.\x20Verify\x20with\x20onchain_table\x20on\x20the\x20host\x20'+'Permission\x27s\x20perm\x20entries\x20before\x20the\x20binding\x20goes\x20live.'});}}if(!d)return b;{const m=findRegistryDeadLegs(d);m['length']>0x0&&b['push']({'code':'PG-GUARD-INTENT-01','host':c,'level':'critical','detail':'Guard\x20leg\x20query(es)\x20'+m['map'](n=>'\x22'+n+'\x22')['join'](',\x20')+'\x20are\x20NOT\x20in\x20the\x20chain\x20query\x20'+'registry\x20(their\x20namespace\x20is\x20known;\x20the\x20full\x20query\x20is\x20not)\x20—\x20these\x20legs\x20can\x20never\x20evaluate,\x20so\x20the\x20'+'branch\x20they\x20sit\x20in\x20is\x20structurally\x20dead:\x20under\x20AND\x20the\x20guard\x20rejects\x20forever,\x20negated\x20it\x20always\x20'+'passes.\x20Rebuild\x20the\x20guard\x20with\x20registered\x20queries\x20(see\x20chain-query-registry)\x20BEFORE\x20binding\x20—\x20'+'guards\x20are\x20immutable,\x20so\x20the\x20defect\x20goes\x20live\x20the\x20moment\x20this\x20bind\x20lands\x20(gf32\x20F-30\x20class)'});}const g=typeof a['guard_ref']==='string'&&a['guard_ref']['trim']()!==''?a['guard_ref']['trim']():undefined;if(c==='reward_claim'&&e?.['order_submission_declared']){}else{const n=deadNamespaces(c);if(n['length']>0x0){const o=[];walk(d,q=>{if(typeof q['query']==='string')for(const r of n){if(q['query']['startsWith'](r)&&!o['includes'](r))o['push'](r);}});if(o['length']>0x0){const p=getGuardHostContext(c);b['push']({'code':deadLegCode(c),'host':c,'level':'warning','detail':'Query\x20namespace(s)\x20'+o['map'](q=>'\x22'+q+'*\x22')['join'](',\x20')+'\x20cannot\x20resolve\x20in\x20the\x20'+(c+'\x20evaluation\x20context\x20('+(p?.['order_anchor']??'no\x20anchor')+')\x20—\x20these\x20legs\x20are\x20')+'structurally\x20dead\x20here;\x20under\x20an\x20AND\x20scope\x20they\x20brick\x20the\x20branch,\x20negated\x20they\x20'+'short-circuit\x20it.\x20See\x20guard-host-context.ts.'});}}}(c==='treasury_external_withdraw'||c==='treasury_external_deposit')&&e?.['amount_slot']!==undefined&&(!slotInComparison(d,e['amount_slot'])&&(c==='treasury_external_withdraw'?b['push']({'code':'TW_AMOUNT_UNBOUNDED','host':c,'level':'warning','detail':'Amount\x20slot\x20'+e['amount_slot']+'\x20appears\x20only\x20as\x20a\x20submission\x20source,\x20never\x20inside\x20a\x20'+'comparison\x20leg\x20—\x20the\x20withdrawal\x20size\x20is\x20caller-chosen\x20up\x20to\x20the\x20full\x20balance\x20(the\x20'+'chain\x20debits\x20the\x20declared\x20number).\x20Non-open\x20venues\x20must\x20bound\x20the\x20slot.'}):b['push']({'code':'TD_AMOUNT_SLOT_SEMANTICS','host':c,'level':'info','detail':'Amount\x20slot\x20'+e['amount_slot']+'\x20is\x20unconstrained\x20—\x20the\x20depositor\x20sizes\x20the\x20credit\x20'+'(partial\x20deposit,\x20remainder\x20refunded;\x20whole\x20coin\x20when\x20the\x20identifier\x20is\x20omitted).\x20'+'Lower\x20stakes\x20than\x20the\x20withdraw\x20channel;\x20disclosure\x20only.'})));if(c==='machine_forward'&&e?.['declared_slots']){const q=e['declared_slots'],r=[];walk(d,s=>{if(!Array['isArray'](s['nodes'])||s['nodes']['length']<0x2)return;if(!/logic_/['test'](s['type']??''))return;for(const [t,u]of[[s['nodes'][0x0],s['nodes'][0x1]],[s['nodes'][0x1],s['nodes'][0x0]]]){if(typeof t?.['query']==='string'&&isIdentityQuery(t['query'])&&u?.['type']==='identifier'&&u['identifier']!==undefined){if(!q['includes'](u['identifier'])&&!r['includes'](u['identifier']))r['push'](u['identifier']);}}}),r['length']>0x0&&b['push']({'code':'MF_SLOT_IDENTITY_ANCHOR','host':c,'level':'critical','detail':'Identity\x20leg(s)\x20anchored\x20to\x20submission\x20slot(s)\x20'+r['join'](',\x20')+'\x20that\x20the\x20edge\x20does\x20not\x20'+('declare\x20(declared:\x20'+(q['join'](',\x20')||'none')+')\x20—\x20the\x20caller\x20controls\x20those\x20slots,\x20')+'so\x20the\x20identity\x20check\x20reads\x20attacker-chosen\x20data\x20(T10\x20hijack).\x20Anchor\x20to\x20the\x20edge\x27s\x20'+'task-binding\x20slot\x20instead.'});}if(c==='progress_submission'){let s=![];walk(d,t=>{if(typeof t['query']==='string'&&isIdentityQuery(t['query']))s=!![];}),!s&&b['push']({'code':'PS_IDENTITY_REQUIRED','host':c,'level':'info','detail':'No\x20identity\x20leg\x20on\x20this\x20attestation\x20guard\x20—\x20attestations\x20are\x20replayable\x20without\x20one.\x20'+'Acceptable\x20only\x20when\x20the\x20riding\x20edge\x20verifies\x20the\x20submitter\x20upstream.'});}{let t=![];walk(d,u=>{if(typeof u['query']==='string'&&u['query']['startsWith']('repository'))t=!![];}),t&&b['push']({'code':c==='repository_write'?'RW_QUOTE_GUARD_CARRY':'RQ_CARRY_OBLIGATION','host':c,'level':'info','detail':'This\x20tree\x20reads\x20repository\x20data\x20—\x20the\x20consuming\x20passport\x20must\x20declare\x20the\x20governing\x20'+'policy\x27s\x20quote_guard\x20in\x20its\x20impack\x20(QUOTE-GUARD\x20CARRY),\x20or\x20the\x20query\x20fails\x20closed\x20at\x20'+'evaluation\x20time.'});}if(c==='repository_write'){let u=![];walk(d,v=>{typeof v['query']==='string'&&/(sum_where|count_where|find_where)/['test'](v['query'])&&(u=!![]);}),u&&b['push']({'code':'RW_OPEN_WRITE_FEEDS_AGGREGATE','host':c,'level':e?.['open_write_aggregate_rows']===!![]?'critical':'warning','detail':'This\x20write\x20channel\x27s\x20guard\x20reads\x20repository\x20AGGREGATES\x20(row-set\x20sum\x20/\x20count\x20/\x20find)\x20—\x20'+'the\x20aggregate\x20is\x20forgeable\x20by\x20write\x20whenever\x20the\x20rows\x20feeding\x20it\x20can\x20be\x20written\x20through\x20'+'an\x20open\x20(unguarded)\x20channel,\x20and\x20every\x20decision\x20this\x20guard\x20derives\x20from\x20the\x20aggregate\x20is\x20'+'forged\x20with\x20it.\x20Verify\x20every\x20feeding\x20row\x20policy\x20carries\x20a\x20write_guard\x20binding\x20a\x20trusted\x20'+'writer\x20role\x20BEFORE\x20this\x20binding\x20goes\x20live'+(e?.['open_write_aggregate_rows']===!![]?';\x20host\x20facts\x20PROVE\x20at\x20least\x20one\x20feeding\x20row\x20is\x20openly\x20writable\x20—\x20treat\x20as\x20a\x20hard\x20block.':';\x20the\x20feeding\x20policies\x20could\x20not\x20be\x20proven\x20either\x20way\x20at\x20binding\x20time\x20—\x20disclosure.')});}c==='demand_present'&&(e?.['demand_guard_count']??0x0)>0x1&&b['push']({'code':'DP_MULTI_GUARD_IS_OR','host':c,'level':'info','detail':e['demand_guard_count']+'\x20guards\x20registered\x20on\x20the\x20demand\x20—\x20the\x20presenter\x20passes\x20ANY\x20ONE\x20'+'of\x20them\x20(presenter-chosen\x20OR).\x20A\x20strict\x20gate\x20belongs\x20inside\x20EVERY\x20'+'guard\x20(or\x20one\x20guard),\x20not\x20across\x20the\x20list.'});if(c==='machine_forward'&&e?.['source_node']===''&&(e?.['pinned_node_names']?.['length']??0x0)>0x0){const v=e['pinned_node_names']['filter'](w=>w!=='');v['length']>0x0&&b['push']({'code':'MF_INIT_NODE_LITERAL_GATE','host':c,'level':'critical','detail':'This\x20forward\x20leaves\x20the\x20INIT\x20node\x20(source\x20\x22\x22\x20on\x20chain),\x20where\x20progress.current\x20is\x20the\x20'+('EMPTY\x20string\x20—\x20its\x20equality\x20leg(s)\x20pinning\x20['+v['map'](w=>'\x22'+w+'\x22')['join'](',\x20')+']\x20')+'are\x20ALWAYS\x20FALSE,\x20so\x20the\x20forward\x20can\x20never\x20fire:\x20the\x20first\x20order\x20strands\x20forever\x20'+'(nnd3-mn-261103\x20F-NND-02).\x20Delete\x20the\x20leg,\x20pin\x20\x22\x22\x20(the\x20init\x20node\x27s\x20actual\x20name),\x20or\x20'+'rebind\x20the\x20guard\x20to\x20a\x20non-init\x20source\x20forward.'});}if(g!==undefined)for(const w of b){if(w['guard']===undefined)w['guard']=g;}return b;}export function auditGuardRelies(a){const b=[];if(a['child_count']<=0x0)return b;const c=a['from_host']!==a['to_host'];return b['push']({'code':'GR_CHILD_HOST_REAUDIT','host':'guard_relied','level':c?'warning':'info','detail':a['child_count']+'\x20relied\x20child\x20guard(s)\x20INHERIT\x20the\x20parent\x27s\x20host\x20context.\x20'+(c?'Host\x20change\x20'+(a['from_host']||'(unbound)')+'\x20→\x20'+a['to_host']+':\x20re-audit\x20EVERY\x20child\x20against\x20'+'the\x20new\x20host\x27s\x20signer\x20/\x20order\x20anchor\x20/\x20submission\x20channel\x20(guard-host-context.ts,\x20'+('host\x20\x22'+a['to_host']+'\x22)\x20before\x20binding.'):'Binding\x20host\x20\x22'+a['to_host']+'\x22\x20unchanged\x20—\x20children\x20already\x20audited\x20for\x20this\x20context.')}),b['push']({'code':'GR_CLOSURE_CARRY','host':'guard_relied','level':'info','detail':'Every\x20passport\x20carrying\x20the\x20parent\x20must\x20carry\x20ALL\x20relied\x20children\x20first\x20(E_RELIES_GUARD_NOT_ADDED).\x20'+'Communicate\x20the\x20full\x20carry\x20closure\x20in\x20the\x20passport\x20build\x20steps.'+(a['logic_and']===![]?'\x20relies_logic_and\x20is\x20OR:\x20any\x20passing\x20child\x20satisfies\x20—\x20the\x20acceptance\x20surface\x20is\x20the\x20UNION\x20of\x20the\x20children.':'')}),b;}export function auditQuoteGuardCandidate(a){const b=[];if(a['immutable']===![])b['push']('mutable\x20(immutable\x20flag\x20false)');if(a['rep']===![])b['push']('rep\x20flag\x20false');if((a['relies_count']??0x0)>0x0)b['push']('carries\x20relies\x20(depth\x20must\x20be\x200)');if(b['length']===0x0)return[];return[{'code':'RQ_DEPENDED_ONLY','host':'repository_quote','level':'warning','detail':'Quote-guard\x20candidate\x20is\x20NOT\x20depended:\x20'+b['join'](';\x20')+'\x20—\x20quote-guard\x20binding\x20aborts\x20'+'(E_NEED_DEPENDENT_GUARD;\x20the\x20depended\x20shape\x20=\x20relies\x20empty\x20+\x20immutable\x20+\x20rep).\x20Rebuild\x20the\x20'+'guard\x20as\x20a\x20frozen\x20leaf\x20before\x20binding.'}];}
@@ -35,4 +35,4 @@ export declare function suggestPatternForRequirement(requirement: string): {
35
35
  best: GuardDesignPattern;
36
36
  alternatives: GuardDesignPattern[];
37
37
  };
38
- export declare const GUARD_DESIGN_PATTERNS_VERSION = 19;
38
+ export declare const GUARD_DESIGN_PATTERNS_VERSION = 21;