agentic-qe 3.14.7 → 3.15.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.
Files changed (428) hide show
  1. package/.claude/helpers/.helpers-version +1 -1
  2. package/.claude/helpers/auto-memory-hook.mjs +18 -9
  3. package/.claude/helpers/helpers.manifest.json +6 -5
  4. package/.claude/helpers/hook-handler.cjs +40 -12
  5. package/.claude/helpers/memory.cjs +86 -0
  6. package/.claude/helpers/router.cjs +105 -0
  7. package/.claude/helpers/session.cjs +166 -0
  8. package/.claude/helpers/statusline.cjs +73 -621
  9. package/.claude/skills/release/SKILL.md +6 -0
  10. package/.claude/skills/skills-manifest.json +1 -1
  11. package/CHANGELOG.md +275 -0
  12. package/README.md +143 -366
  13. package/assets/readme/credit-ruflo.svg +1 -0
  14. package/assets/readme/credit-ruvector.svg +1 -0
  15. package/assets/readme/project-header.svg +1 -0
  16. package/assets/readme/quality-loop.svg +1 -0
  17. package/assets/skills/skills-manifest.json +1 -1
  18. package/dist/adapters/a2a/notifications/retry-queue.js +10 -1
  19. package/dist/adapters/ag-ui/json-patch.js +14 -7
  20. package/dist/adapters/ag-ui/state-delta-cache.js +20 -12
  21. package/dist/adapters/claude-flow/pretrain-bridge.js +3 -2
  22. package/dist/agents/claim-verifier/verifiers/file-verifier.js +3 -2
  23. package/dist/cli/bundle.js +6 -6
  24. package/dist/cli/chunks/adapter-D7G5MIDQ.js +2 -0
  25. package/dist/cli/chunks/{agent-booster-wasm-AK2W76RG.js → agent-booster-wasm-GDHJ6QUN.js} +2 -2
  26. package/dist/cli/chunks/{agent-handler-MGZCWHIY.js → agent-handler-MPYYQ2RZ.js} +2 -2
  27. package/dist/cli/chunks/{agent-memory-branch-JZ54MCSP.js → agent-memory-branch-QBSHKLA2.js} +2 -2
  28. package/dist/cli/chunks/aqe-learning-engine-G6TUFGHC.js +2 -0
  29. package/dist/cli/chunks/{arena-YSWTKBCL.js → arena-UJE2FROF.js} +4 -4
  30. package/dist/cli/chunks/{arena-CUVH3V7H.js → arena-WIGSL37B.js} +2 -2
  31. package/dist/cli/chunks/{audit-LVU76QGA.js → audit-VT7Y2Z7V.js} +3 -3
  32. package/dist/cli/chunks/base-B45BOC7E.js +2 -0
  33. package/dist/cli/chunks/{better-sqlite3-DB3LOJQU.js → better-sqlite3-DSL7LFRK.js} +2 -2
  34. package/dist/cli/chunks/{brain-handler-SD63KOQ6.js → brain-handler-N3C2MDMK.js} +4 -4
  35. package/dist/cli/chunks/{branch-enumerator-4MNOPUC7.js → branch-enumerator-B6NSQ3PZ.js} +2 -2
  36. package/dist/cli/chunks/{browser-OLPNTWQE.js → browser-KQ3YNRGW.js} +2 -2
  37. package/dist/cli/chunks/browser-workflow-MIBU4XMV.js +2 -0
  38. package/dist/cli/chunks/{chunk-ZWEKAEEV.js → chunk-2ORTL5WG.js} +1 -1
  39. package/dist/cli/chunks/{chunk-KD2BLA5Y.js → chunk-2ZEV3O24.js} +1 -1
  40. package/dist/cli/chunks/{chunk-25P6JA6V.js → chunk-32YSI6OT.js} +1 -1
  41. package/dist/cli/chunks/{chunk-A5MA7A23.js → chunk-3DKYBHNA.js} +6 -6
  42. package/dist/cli/chunks/{chunk-JOZ47MV6.js → chunk-3Y24VTZ3.js} +1 -1
  43. package/dist/cli/chunks/{chunk-2G63VIJE.js → chunk-4BWDCUZZ.js} +1 -1
  44. package/dist/cli/chunks/{chunk-36VKMAMN.js → chunk-4DCDIKBX.js} +2 -2
  45. package/dist/cli/chunks/chunk-4EEY23JS.js +4 -0
  46. package/dist/cli/chunks/{chunk-BD7FEUN3.js → chunk-4FOKHGP5.js} +3 -3
  47. package/dist/cli/chunks/{chunk-MQZ53OR3.js → chunk-4OQSAUKR.js} +2 -2
  48. package/dist/cli/chunks/{chunk-EYXE2XKP.js → chunk-4YPL3OXS.js} +2 -2
  49. package/dist/cli/chunks/{chunk-PCJQCEBA.js → chunk-5DJGP4TA.js} +2 -2
  50. package/dist/cli/chunks/{chunk-RC2A4JZ5.js → chunk-5KN4QL3G.js} +2 -2
  51. package/dist/cli/chunks/chunk-5LN7FQZI.js +2 -0
  52. package/dist/cli/chunks/{chunk-LU2EDWQK.js → chunk-5PNRUMRV.js} +2 -2
  53. package/dist/cli/chunks/{chunk-YRHTQZU4.js → chunk-62IEVKN3.js} +2 -2
  54. package/dist/cli/chunks/{chunk-DOBKEXMJ.js → chunk-6GTIJNRO.js} +1 -1
  55. package/dist/cli/chunks/{chunk-O5V7RHVG.js → chunk-6MN4L6BS.js} +2 -2
  56. package/dist/cli/chunks/{chunk-6PJPQGF4.js → chunk-7D6NVIGP.js} +6 -6
  57. package/dist/cli/chunks/{chunk-B2YGVSOP.js → chunk-7JABIXP3.js} +2 -2
  58. package/dist/cli/chunks/chunk-7JC3LHA6.js +742 -0
  59. package/dist/cli/chunks/{chunk-P7XSPP5D.js → chunk-7WUHVGGT.js} +2 -2
  60. package/dist/cli/chunks/{chunk-RKI3IQKQ.js → chunk-A37YYHUD.js} +3 -3
  61. package/dist/cli/chunks/{chunk-UBJG3IHT.js → chunk-AAQNRZKT.js} +2 -2
  62. package/dist/cli/chunks/{chunk-ND4QTZOL.js → chunk-AGYPPPXR.js} +2 -2
  63. package/dist/cli/chunks/chunk-AIE6OKCD.js +2 -0
  64. package/dist/cli/chunks/{chunk-JHJUSSAU.js → chunk-ANUZGOLQ.js} +2 -2
  65. package/dist/cli/chunks/{chunk-RLW25X66.js → chunk-AQZSF32Y.js} +2 -2
  66. package/dist/cli/chunks/{chunk-OIDWDGLG.js → chunk-ATXAMGVE.js} +2 -2
  67. package/dist/cli/chunks/{chunk-GLGKQX2V.js → chunk-AV3RX2L5.js} +2 -2
  68. package/dist/cli/chunks/{chunk-7QYOTUOX.js → chunk-AW5OWYQ4.js} +2 -2
  69. package/dist/cli/chunks/{chunk-B4I43GE2.js → chunk-B6QTNTCU.js} +2 -2
  70. package/dist/cli/chunks/{chunk-P2UPYSDJ.js → chunk-BAPMEDWC.js} +1 -1
  71. package/dist/cli/chunks/{chunk-Y6AKKQIQ.js → chunk-BH2SQQ2N.js} +1 -1
  72. package/dist/cli/chunks/{chunk-O6MO5KMR.js → chunk-C6M27NQE.js} +2 -2
  73. package/dist/cli/chunks/{chunk-XBYQ2BS4.js → chunk-CMYZWIXS.js} +2 -2
  74. package/dist/cli/chunks/{chunk-DYTQHRUS.js → chunk-CZWWC7GC.js} +1 -1
  75. package/dist/cli/chunks/{chunk-WF6UISKW.js → chunk-D7NOHASX.js} +4 -4
  76. package/dist/cli/chunks/{chunk-H5RQPO3X.js → chunk-DGRE6ZAA.js} +2 -2
  77. package/dist/cli/chunks/{chunk-53BXTTRO.js → chunk-DSGRXW6K.js} +3 -3
  78. package/dist/cli/chunks/{chunk-A2VUCUTT.js → chunk-DXA7RLYU.js} +2 -2
  79. package/dist/cli/chunks/{chunk-GVVFTFMB.js → chunk-DZHIE5UW.js} +2 -2
  80. package/dist/cli/chunks/{chunk-MZB2UV2O.js → chunk-EBK6CUBD.js} +1 -1
  81. package/dist/cli/chunks/{chunk-WIH522AP.js → chunk-EPEKEUCF.js} +1 -1
  82. package/dist/cli/chunks/{chunk-SRPLERER.js → chunk-EQ4SDE4L.js} +25 -25
  83. package/dist/cli/chunks/{chunk-EGOIIUBD.js → chunk-EZPWSS3B.js} +2 -2
  84. package/dist/cli/chunks/{chunk-EADSQN5T.js → chunk-F76SYOBT.js} +1 -1
  85. package/dist/cli/chunks/{chunk-XL5KIYE3.js → chunk-F7JVDLOI.js} +2 -2
  86. package/dist/cli/chunks/{chunk-QGOWNVVG.js → chunk-FCSETOWZ.js} +4 -4
  87. package/dist/cli/chunks/{chunk-A3DK3XNZ.js → chunk-FFE4XAQA.js} +1 -1
  88. package/dist/cli/chunks/{chunk-7EZ2Z2CK.js → chunk-FPTZP7W5.js} +1 -1
  89. package/dist/cli/chunks/{chunk-GV4DYPJP.js → chunk-FTFIA4I5.js} +2 -2
  90. package/dist/cli/chunks/{chunk-SM2YJ2AL.js → chunk-FTS6NGBP.js} +2 -2
  91. package/dist/cli/chunks/{chunk-XWYELBZS.js → chunk-FZ3TQAPW.js} +1 -1
  92. package/dist/cli/chunks/{chunk-HPWWYT67.js → chunk-G35KP72N.js} +2 -2
  93. package/dist/cli/chunks/{chunk-HZY42OVU.js → chunk-GCHDMO5V.js} +2 -2
  94. package/dist/cli/chunks/{chunk-23CX7JNL.js → chunk-GRN47ANK.js} +2 -2
  95. package/dist/cli/chunks/{chunk-HYFQUWNB.js → chunk-GV7P5JYF.js} +2 -2
  96. package/dist/cli/chunks/{chunk-YO4ESCB4.js → chunk-GX5RFGW2.js} +1 -1
  97. package/dist/cli/chunks/{chunk-TFK2AYIN.js → chunk-H77AUJNW.js} +2 -2
  98. package/dist/cli/chunks/{chunk-NBLDBVAW.js → chunk-HBIV7PQH.js} +1 -1
  99. package/dist/cli/chunks/{chunk-VYDVI6FZ.js → chunk-HOPXHZA3.js} +2 -2
  100. package/dist/cli/chunks/{chunk-HYOPJHHW.js → chunk-I3BH3KIF.js} +1 -1
  101. package/dist/cli/chunks/{chunk-ZELWDJXT.js → chunk-ILKMNDUM.js} +2 -2
  102. package/dist/cli/chunks/{chunk-C3FXFU2T.js → chunk-IRHBR56R.js} +1 -1
  103. package/dist/cli/chunks/{chunk-FYPX5WBJ.js → chunk-ISAMM7QA.js} +1 -1
  104. package/dist/cli/chunks/{chunk-V5AK56DA.js → chunk-ISGFAMHZ.js} +2 -2
  105. package/dist/cli/chunks/{chunk-KUHLTVWC.js → chunk-J46XGXPS.js} +1 -1
  106. package/dist/cli/chunks/{chunk-ZS4XVJGV.js → chunk-J4XCBOPA.js} +2 -2
  107. package/dist/cli/chunks/{chunk-BEFTQVEW.js → chunk-JIWMFLHV.js} +2 -2
  108. package/dist/cli/chunks/{chunk-UFSVUBTR.js → chunk-JJ7WAU4I.js} +2 -2
  109. package/dist/cli/chunks/{chunk-WOV6XI3A.js → chunk-JLPNYHJJ.js} +1 -1
  110. package/dist/cli/chunks/{chunk-77QZHIVX.js → chunk-JO2YLIZH.js} +2 -2
  111. package/dist/cli/chunks/{chunk-J7AQZLIH.js → chunk-JSYNSJDQ.js} +4 -4
  112. package/dist/cli/chunks/{chunk-OAZX6WFU.js → chunk-JYRBOSOF.js} +2 -2
  113. package/dist/cli/chunks/{chunk-EJ6MMYLK.js → chunk-KEZ4PXVF.js} +1 -1
  114. package/dist/cli/chunks/{chunk-N5XOXPHZ.js → chunk-KLGFEHEN.js} +2 -2
  115. package/dist/cli/chunks/{chunk-7MIOK72I.js → chunk-KU4WLKDK.js} +7 -7
  116. package/dist/cli/chunks/{chunk-Z4Q5PCRZ.js → chunk-KUTMQBV4.js} +4 -4
  117. package/dist/cli/chunks/{chunk-VW6FRMLW.js → chunk-L6PUBB6L.js} +2 -2
  118. package/dist/cli/chunks/{chunk-OEPNNLR4.js → chunk-LDJ5DZT5.js} +1 -1
  119. package/dist/cli/chunks/{chunk-QQFQDEUE.js → chunk-LLS6JYPN.js} +2 -2
  120. package/dist/cli/chunks/{chunk-UOI6ULCH.js → chunk-LPCFIFZF.js} +2 -2
  121. package/dist/cli/chunks/{chunk-6RD44SCE.js → chunk-M5EKZA7Q.js} +1 -1
  122. package/dist/cli/chunks/chunk-MEYSIVMP.js +2 -0
  123. package/dist/cli/chunks/{chunk-YMW57PEL.js → chunk-MFGLRMO4.js} +1 -1
  124. package/dist/cli/chunks/{chunk-BE4KALTE.js → chunk-MM57SD2F.js} +1 -1
  125. package/dist/cli/chunks/{chunk-FW4DJ4FJ.js → chunk-MO3QXLF2.js} +1 -1
  126. package/dist/cli/chunks/{chunk-QFETNCNN.js → chunk-MRIZY6HB.js} +2 -2
  127. package/dist/cli/chunks/{chunk-RT6O2HW2.js → chunk-N2MDNEF7.js} +2 -2
  128. package/dist/cli/chunks/{chunk-UA7TDVL7.js → chunk-N5ZHIQAV.js} +4 -4
  129. package/dist/cli/chunks/{chunk-Q6NTEICT.js → chunk-NZ556KZN.js} +2 -2
  130. package/dist/cli/chunks/{chunk-CVOQ6ESD.js → chunk-O5AUOBGU.js} +2 -2
  131. package/dist/cli/chunks/{chunk-5D7ZFWDS.js → chunk-OBSX3I4Y.js} +2 -2
  132. package/dist/cli/chunks/{chunk-NOHWJOBS.js → chunk-OLD2CIDI.js} +1 -1
  133. package/dist/cli/chunks/{chunk-5U6N4V5M.js → chunk-OTJ22IO2.js} +4 -4
  134. package/dist/cli/chunks/{chunk-5GFKTJ65.js → chunk-OYVDTD3A.js} +2 -2
  135. package/dist/cli/chunks/{chunk-LY7MFGBD.js → chunk-P2PPJUGD.js} +147 -150
  136. package/dist/cli/chunks/{chunk-OZGIOKEA.js → chunk-P4FRYNHL.js} +1 -1
  137. package/dist/cli/chunks/{chunk-X7ADKL7T.js → chunk-P4WE6VRR.js} +2 -2
  138. package/dist/cli/chunks/{chunk-ZUB5YOCM.js → chunk-P725KXHX.js} +2 -2
  139. package/dist/cli/chunks/{chunk-74IOEOMH.js → chunk-P7MNF2SK.js} +2 -2
  140. package/dist/cli/chunks/{chunk-TXSPBLBT.js → chunk-PJU5HVWV.js} +2 -2
  141. package/dist/cli/chunks/{chunk-MT7UNBZ7.js → chunk-PN3FYSQ6.js} +2 -2
  142. package/dist/cli/chunks/{chunk-F2OPFVQH.js → chunk-PPFW3H7E.js} +1 -1
  143. package/dist/cli/chunks/{chunk-IEJ7ZV3M.js → chunk-Q4RCUCHD.js} +1 -1
  144. package/dist/cli/chunks/{chunk-IAENZ2DR.js → chunk-QRALXNNX.js} +2 -2
  145. package/dist/cli/chunks/{chunk-AJUBT4NP.js → chunk-QVX22EIM.js} +3 -3
  146. package/dist/cli/chunks/chunk-R6CZCMKD.js +2 -0
  147. package/dist/cli/chunks/chunk-ROK5YQ5P.js +3 -0
  148. package/dist/cli/chunks/{chunk-ON2UTP2U.js → chunk-S2GNFAOC.js} +2 -2
  149. package/dist/cli/chunks/{chunk-HXXHMLJ5.js → chunk-S644OORE.js} +1 -1
  150. package/dist/cli/chunks/{chunk-XYLQZWF6.js → chunk-S7CROKX4.js} +2 -2
  151. package/dist/cli/chunks/{chunk-T77GZF4B.js → chunk-S7QUHLXV.js} +1 -1
  152. package/dist/cli/chunks/{chunk-RDGPXENG.js → chunk-UGYXUPGN.js} +2 -2
  153. package/dist/cli/chunks/{chunk-QVH5Y7AP.js → chunk-URRPJ3M7.js} +1 -1
  154. package/dist/cli/chunks/{chunk-AEUEMVJK.js → chunk-URUOTHPO.js} +2 -2
  155. package/dist/cli/chunks/{chunk-VXKWNRGA.js → chunk-VCYOFWMG.js} +2 -2
  156. package/dist/cli/chunks/{chunk-6EGS77BB.js → chunk-VQVFGFYK.js} +1 -1
  157. package/dist/cli/chunks/{chunk-NHUGHAY6.js → chunk-VT5SMBEM.js} +1 -1
  158. package/dist/cli/chunks/{chunk-ROVZSZCS.js → chunk-VTGRGYY4.js} +3 -3
  159. package/dist/cli/chunks/{chunk-QPLSYEWJ.js → chunk-VWCFXCSV.js} +2 -2
  160. package/dist/cli/chunks/{chunk-ENK44A6Q.js → chunk-VY4557VF.js} +2 -2
  161. package/dist/cli/chunks/{chunk-5FSLMYAC.js → chunk-VYERAOQL.js} +2 -2
  162. package/dist/cli/chunks/{chunk-EIGRV3J6.js → chunk-W6H2SOIK.js} +2 -2
  163. package/dist/cli/chunks/{chunk-CBONQM5D.js → chunk-WBR4VRQE.js} +2 -2
  164. package/dist/cli/chunks/{chunk-JZT7BU44.js → chunk-WDV6CBED.js} +2 -2
  165. package/dist/cli/chunks/{chunk-G367W7XR.js → chunk-WO7NPGUD.js} +19 -19
  166. package/dist/cli/chunks/{chunk-4INST4ZL.js → chunk-WPOYFV4X.js} +1 -1
  167. package/dist/cli/chunks/{chunk-3M7J4U74.js → chunk-WPSGMTI4.js} +4 -4
  168. package/dist/cli/chunks/{chunk-RKUAWQOF.js → chunk-WQMXQO3O.js} +2 -2
  169. package/dist/cli/chunks/{chunk-Q3NSU24F.js → chunk-WR54SKKL.js} +2 -2
  170. package/dist/cli/chunks/{chunk-UYUJT6QO.js → chunk-X4OESN7M.js} +2 -2
  171. package/dist/cli/chunks/{chunk-ZUOVNFXK.js → chunk-X5RELRY7.js} +2 -2
  172. package/dist/cli/chunks/{chunk-BLG7SH4A.js → chunk-X7JEBPEW.js} +1 -1
  173. package/dist/cli/chunks/{chunk-FSSR6WBE.js → chunk-XEABMIUH.js} +2 -2
  174. package/dist/cli/chunks/{chunk-ONR2NXXD.js → chunk-XELFJC77.js} +3 -3
  175. package/dist/cli/chunks/{chunk-MM56VPNE.js → chunk-XPUY3ZKD.js} +3 -3
  176. package/dist/cli/chunks/{chunk-QUORH2MG.js → chunk-XZDPR6I2.js} +8 -8
  177. package/dist/cli/chunks/{chunk-MZMG6CUJ.js → chunk-Y63DADOR.js} +2 -2
  178. package/dist/cli/chunks/{chunk-CQNMGK6Y.js → chunk-YFRZVNE4.js} +2 -2
  179. package/dist/cli/chunks/{chunk-3QJU4Q4R.js → chunk-YIDZ3TEN.js} +2 -2
  180. package/dist/cli/chunks/{chunk-4EKV7PHB.js → chunk-Z6CRROLU.js} +2 -2
  181. package/dist/cli/chunks/{chunk-IWFFO6VT.js → chunk-ZPH2YT3J.js} +2 -2
  182. package/dist/cli/chunks/{chunk-PYKY22GC.js → chunk-ZV7LJPSI.js} +5 -5
  183. package/dist/cli/chunks/chunk-ZXIIB3QE.js +2 -0
  184. package/dist/cli/chunks/ci-63JINRNB.js +82 -0
  185. package/dist/cli/chunks/{ci-output-RLS32FUY.js → ci-output-CRFWLUAA.js} +2 -2
  186. package/dist/cli/chunks/{circuit-breaker-MRCC7WCM.js → circuit-breaker-PJLG3WYL.js} +2 -2
  187. package/dist/cli/chunks/{claude-flow-setup-LIZCEKDF.js → claude-flow-setup-UKHSQMJU.js} +2 -2
  188. package/dist/cli/chunks/client-A4FTITK3.js +2 -0
  189. package/dist/cli/chunks/{cline-installer-T7H6R2RC.js → cline-installer-PYQ27AS3.js} +2 -2
  190. package/dist/cli/chunks/{code-XMBLI7OF.js → code-K7VGLZ3W.js} +3 -3
  191. package/dist/cli/chunks/{code-index-extractor-QS7BYLEX.js → code-index-extractor-NNWAVWSL.js} +2 -2
  192. package/dist/cli/chunks/{codex-installer-6PGT5FM6.js → codex-installer-U4VJIKRN.js} +2 -2
  193. package/dist/cli/chunks/{completions-2A3WRXY2.js → completions-DOCI3P4W.js} +2 -2
  194. package/dist/cli/chunks/{complexity-analyzer-23HOOGJ7.js → complexity-analyzer-RFW2QRFR.js} +2 -2
  195. package/dist/cli/chunks/{continuedev-installer-4FSF7B3N.js → continuedev-installer-S5WXXOBU.js} +2 -2
  196. package/dist/cli/chunks/{copilot-installer-A5GRQQUU.js → copilot-installer-AAQ6YLVJ.js} +2 -2
  197. package/dist/cli/chunks/core-handlers-FO3QTNWI.js +2 -0
  198. package/dist/cli/chunks/{cost-tracker-Z4STQ5VB.js → cost-tracker-R4VOHTWQ.js} +2 -2
  199. package/dist/cli/chunks/{coverage-NUPP6KZZ.js → coverage-P54HPCLV.js} +3 -3
  200. package/dist/cli/chunks/cross-domain-router-LIV6SRWF.js +2 -0
  201. package/dist/cli/chunks/{cursor-installer-FVJ7ROPJ.js → cursor-installer-VHBWZE5A.js} +2 -2
  202. package/dist/cli/chunks/{daemon-D662EX5N.js → daemon-BTRSWNB4.js} +4 -4
  203. package/dist/cli/chunks/{daemon-7ZZA2MMN.js → daemon-JLH5TTWZ.js} +4 -4
  204. package/dist/cli/chunks/{dag-attention-scheduler-IB4TQ2KA.js → dag-attention-scheduler-5Z6DCRFK.js} +2 -2
  205. package/dist/cli/chunks/{detect-LGLBZN4I.js → detect-NWGASRJJ.js} +2 -2
  206. package/dist/cli/chunks/{dist-node-Z3OL42YE.js → dist-node-XMNNSEFJ.js} +2 -2
  207. package/dist/cli/chunks/{domain-handler-L3CLNL7U.js → domain-handler-BWVBZTNR.js} +2 -2
  208. package/dist/cli/chunks/{domain-plugins-GQ3V5X6L.js → domain-plugins-YAD4USA4.js} +2 -2
  209. package/dist/cli/chunks/domain-transfer-Z3MRPZEZ.js +2 -0
  210. package/dist/cli/chunks/dream-DNLGHYXY.js +2 -0
  211. package/dist/cli/chunks/{embed-and-insert-pattern-UGD6USYH.js → embed-and-insert-pattern-5CCO45WC.js} +2 -2
  212. package/dist/cli/chunks/{eval-3B7UIYGY.js → eval-JEMLTGY4.js} +2 -2
  213. package/dist/cli/chunks/{experience-capture-middleware-3RQ4NYY3.js → experience-capture-middleware-FKVYBBAN.js} +4 -4
  214. package/dist/cli/chunks/{fast-paths-QOSAEPYD.js → fast-paths-TFL32H3C.js} +2 -2
  215. package/dist/cli/chunks/{feature-flags-3S5TH6P4.js → feature-flags-CNGAUUMT.js} +2 -2
  216. package/dist/cli/chunks/{feature-flags-TLF4NKOH.js → feature-flags-OHGD2NCW.js} +2 -2
  217. package/dist/cli/chunks/{file-discovery-AEVMJRNB.js → file-discovery-IHGDYW34.js} +2 -2
  218. package/dist/cli/chunks/{fleet-E6WTXWFL.js → fleet-OGTSDGJ2.js} +4 -4
  219. package/dist/cli/chunks/{gnn-wrapper-MCKH3AUU.js → gnn-wrapper-QYTTKNCE.js} +2 -2
  220. package/dist/cli/chunks/{heartbeat-handler-U7XENHRR.js → heartbeat-handler-R5OD2SKN.js} +4 -4
  221. package/dist/cli/chunks/heartbeat-scheduler-DL4LXXJF.js +2 -0
  222. package/dist/cli/chunks/hnsw-adapter-Y64M43J4.js +2 -0
  223. package/dist/cli/chunks/hnsw-index-5V6DDMTA.js +2 -0
  224. package/dist/cli/chunks/{hnsw-legacy-bridge-5GW4SAEI.js → hnsw-legacy-bridge-ULJWYXBQ.js} +2 -2
  225. package/dist/cli/chunks/{hnswlib-node-7BLZBK5T.js → hnswlib-node-SYKJXGE2.js} +2 -2
  226. package/dist/cli/chunks/{hooks-F3O2SB6H.js → hooks-XAJXPXTU.js} +10 -10
  227. package/dist/cli/chunks/hybrid-backend-JWT2V4FQ.js +2 -0
  228. package/dist/cli/chunks/{hypergraph-engine-PV4EKXHB.js → hypergraph-engine-GIBPGW4N.js} +2 -2
  229. package/dist/cli/chunks/{hypergraph-handler-VOWO5ZTW.js → hypergraph-handler-ENFK6IDN.js} +3 -3
  230. package/dist/cli/chunks/impact-analyzer-XUZQSZZC.js +2 -0
  231. package/dist/cli/chunks/{init-handler-ENJ5ONJX.js → init-handler-CSA62LGT.js} +6 -6
  232. package/dist/cli/chunks/init-wizard-KDJKHEPN.js +2 -0
  233. package/dist/cli/chunks/kernel-MUDYPGFR.js +2 -0
  234. package/dist/cli/chunks/{kilocode-installer-HNNJOOPE.js → kilocode-installer-YXFIRTSA.js} +2 -2
  235. package/dist/cli/chunks/{kiro-installer-UZBIQ3IC.js → kiro-installer-JW3BG2MQ.js} +2 -2
  236. package/dist/cli/chunks/knowledge-graph-GR52N7PU.js +2 -0
  237. package/dist/cli/chunks/{learning-YMLCVFUT.js → learning-BDBZ7ZVG.js} +4 -4
  238. package/dist/cli/chunks/{llm-router-YWTARCCT.js → llm-router-CCX2DYTC.js} +4 -4
  239. package/dist/cli/chunks/llm-router-service-QL6LVKZ4.js +2 -0
  240. package/dist/cli/chunks/{load-DKE3F3IP.js → load-UJTTEOOK.js} +2 -2
  241. package/dist/cli/chunks/load-test-76V75WZ5.js +2 -0
  242. package/dist/cli/chunks/{mcp-5PSGIUCW.js → mcp-2NAJYREC.js} +2 -2
  243. package/dist/cli/chunks/{memory-3L3O6JMM.js → memory-C3UQSN5F.js} +5 -5
  244. package/dist/cli/chunks/memory-backend-SMQRS5QN.js +2 -0
  245. package/dist/cli/chunks/memory-handlers-ESFIJENU.js +2 -0
  246. package/dist/cli/chunks/{multi-model-executor-AEEO7IA4.js → multi-model-executor-SIHSHAD7.js} +2 -2
  247. package/dist/cli/chunks/{opencode-installer-ABBO355U.js → opencode-installer-KDYHUGPG.js} +2 -2
  248. package/dist/cli/chunks/{orchestrator-E36Q7MKE.js → orchestrator-MJHIQEHD.js} +6 -6
  249. package/dist/cli/chunks/pattern-null-store-MWAJMOYU.js +2 -0
  250. package/dist/cli/chunks/{pattern-usage-recorder-H4XKSID4.js → pattern-usage-recorder-OLBE4UIF.js} +2 -2
  251. package/dist/cli/chunks/{pipeline-BGFEHXIN.js → pipeline-IOK2CV3U.js} +2 -2
  252. package/dist/cli/chunks/{platform-GK7ZVDJI.js → platform-53JQ7JXN.js} +2 -2
  253. package/dist/cli/chunks/{plugin-CAH2CKI6.js → plugin-L5SDIWDI.js} +2 -2
  254. package/dist/cli/chunks/{prime-radiant-advanced-wasm-M5EYRONA.js → prime-radiant-advanced-wasm-2DS67JFS.js} +2 -2
  255. package/dist/cli/chunks/{project-root-BSNZC243.js → project-root-LQMOFO2Z.js} +2 -2
  256. package/dist/cli/chunks/protocol-executor-32X3GAJT.js +2 -0
  257. package/dist/cli/chunks/{protocol-handler-JDSSC2SF.js → protocol-handler-NXG2M43B.js} +2 -2
  258. package/dist/cli/chunks/{prove-ANPTOZJE.js → prove-7K7PFSSX.js} +2 -2
  259. package/dist/cli/chunks/qe-reasoning-bank-KAFV3TGI.js +2 -0
  260. package/dist/cli/chunks/{quality-SXWGYRQR.js → quality-ATILUGMJ.js} +2 -2
  261. package/dist/cli/chunks/quality-gate-MPZMDPIZ.js +7 -0
  262. package/dist/cli/chunks/queen-coordinator-L3SODGRX.js +2 -0
  263. package/dist/cli/chunks/{real-embeddings-WSRYAOZM.js → real-embeddings-VZN3KIAI.js} +2 -2
  264. package/dist/cli/chunks/{ref-validation-AZ3LRWEK.js → ref-validation-EUATPVXX.js} +2 -2
  265. package/dist/cli/chunks/{roocode-installer-2QKGFIEU.js → roocode-installer-7M2GOUNZ.js} +2 -2
  266. package/dist/cli/chunks/router-DDCSSXYQ.js +2 -0
  267. package/dist/cli/chunks/routing-feedback-RFASKYCD.js +2 -0
  268. package/dist/cli/chunks/{routing-handler-UYDC5MMD.js → routing-handler-VWANE652.js} +2 -2
  269. package/dist/cli/chunks/{ruvector-commands-QXADPVEY.js → ruvector-commands-B2YIPGOV.js} +2 -2
  270. package/dist/cli/chunks/rvf-dual-writer-HCIF2G56.js +2 -0
  271. package/dist/cli/chunks/rvf-migration-adapter-UVAHQ7SV.js +2 -0
  272. package/dist/cli/chunks/{rvf-migration-coordinator-GD4NBFKT.js → rvf-migration-coordinator-RQXOQJ5T.js} +2 -2
  273. package/dist/cli/chunks/rvf-native-adapter-F2I5FFHK.js +2 -0
  274. package/dist/cli/chunks/{rvf-store-integrity-7SXG66IL.js → rvf-store-integrity-7P5YDXRH.js} +2 -2
  275. package/dist/cli/chunks/safe-db-6ZAA4S23.js +2 -0
  276. package/dist/cli/chunks/schedule-SM5Q6UVP.js +2 -0
  277. package/dist/cli/chunks/scheduler-4EYP4EZ6.js +2 -0
  278. package/dist/cli/chunks/{security-YKB622PK.js → security-VJ7TVSQF.js} +3 -3
  279. package/dist/cli/chunks/{shared-rvf-adapter-KMLAV7JK.js → shared-rvf-adapter-63NXQFBX.js} +2 -2
  280. package/dist/cli/chunks/{shared-rvf-dual-writer-OYY27DFV.js → shared-rvf-dual-writer-JQRP7P5A.js} +2 -2
  281. package/dist/cli/chunks/sqlite-persistence-KLN2K266.js +2 -0
  282. package/dist/cli/chunks/{standalone-memory-2DOABVLC.js → standalone-memory-WJ72PH5P.js} +2 -2
  283. package/dist/cli/chunks/{status-handler-EXRKETV7.js → status-handler-G72ZSLAX.js} +2 -2
  284. package/dist/cli/chunks/{structural-health-2SKK6DU6.js → structural-health-HYBGP4BD.js} +2 -2
  285. package/dist/cli/chunks/{sync-DQ2YUNI6.js → sync-5YMZZIF4.js} +2 -2
  286. package/dist/cli/chunks/{sync-UW7SX7GO.js → sync-O5FQAHT7.js} +2 -2
  287. package/dist/cli/chunks/{task-handler-LYQ6WYUY.js → task-handler-E6IFNHZG.js} +2 -2
  288. package/dist/cli/chunks/{task-handlers-DIJO232S.js → task-handlers-P3GC2L5L.js} +3 -3
  289. package/dist/cli/chunks/{test-WRHZMUCW.js → test-OU6ERW67.js} +6 -6
  290. package/dist/cli/chunks/{test-scheduling-HI23RXFK.js → test-scheduling-3HY4I3HY.js} +7 -7
  291. package/dist/cli/chunks/{token-bootstrap-23SA6SWZ.js → token-bootstrap-A5QA4CWK.js} +2 -2
  292. package/dist/cli/chunks/{token-usage-M7RRDPXO.js → token-usage-MUNQVPFT.js} +2 -2
  293. package/dist/cli/chunks/{transformers-4TC35KKS.js → transformers-IEO25W5V.js} +2 -2
  294. package/dist/cli/chunks/{tree-sitter-wasm-parser-F4LTKAWD.js → tree-sitter-wasm-parser-T2EQHEAY.js} +2 -2
  295. package/dist/cli/chunks/{types-NBXV6LXQ.js → types-ODCPGCID.js} +2 -2
  296. package/dist/cli/chunks/unified-memory-B5IA2KKQ.js +2 -0
  297. package/dist/cli/chunks/unified-memory-hnsw-YF74LL3Z.js +2 -0
  298. package/dist/cli/chunks/unified-persistence-VZMGNGWY.js +2 -0
  299. package/dist/cli/chunks/{upgrade-4BGOU5RM.js → upgrade-4DN6EIW2.js} +2 -2
  300. package/dist/cli/chunks/{validate-EDWAR63H.js → validate-TBNAPDE3.js} +2 -2
  301. package/dist/cli/chunks/{validate-swarm-VI72CPR7.js → validate-swarm-ZN7XXUY4.js} +2 -2
  302. package/dist/cli/chunks/visual-security-ZV3BLLSH.js +2 -0
  303. package/dist/cli/chunks/{web-tree-sitter-Y5XBRQXF.js → web-tree-sitter-DWAWVD2X.js} +2 -2
  304. package/dist/cli/chunks/{windsurf-installer-VEX23WAF.js → windsurf-installer-U6EROS5S.js} +2 -2
  305. package/dist/cli/chunks/{witness-chain-3YNL6YGY.js → witness-chain-EQEJS2P4.js} +2 -2
  306. package/dist/cli/chunks/witness-chain-OA24MQWX.js +2 -0
  307. package/dist/cli/chunks/{witness-chain-repair-MJZGZRWT.js → witness-chain-repair-KBXDRXS3.js} +2 -2
  308. package/dist/cli/chunks/{witness-chain-verifier-TTJYXTBE.js → witness-chain-verifier-HSQGZ4R4.js} +2 -2
  309. package/dist/cli/chunks/{witness-key-manager-EM6YXYOY.js → witness-key-manager-RAODG73T.js} +2 -2
  310. package/dist/cli/chunks/{workflow-2RBDOM7V.js → workflow-KNFJNNKG.js} +4 -4
  311. package/dist/cli/chunks/workflow-orchestrator-IMX2LSVE.js +2 -0
  312. package/dist/cli/chunks/{wrappers-5OTAVVOV.js → wrappers-NIJBA22T.js} +2 -2
  313. package/dist/cli/commands/ci.js +17 -6
  314. package/dist/cli/commands/quality-gate.js +6 -1
  315. package/dist/cli/index.js +7 -2
  316. package/dist/cli/process-store-cleanup.d.ts +7 -0
  317. package/dist/cli/process-store-cleanup.js +27 -0
  318. package/dist/cli/utils/ci-config.d.ts +3 -3
  319. package/dist/cli/utils/ci-config.js +202 -68
  320. package/dist/cli/utils/workflow-parser.js +73 -57
  321. package/dist/domains/code-intelligence/services/metric-collector/test-counter.d.ts +1 -1
  322. package/dist/domains/code-intelligence/services/metric-collector/test-counter.js +17 -15
  323. package/dist/domains/quality-assessment/quality-evidence.d.ts +3 -1
  324. package/dist/domains/quality-assessment/quality-evidence.js +7 -2
  325. package/dist/domains/test-execution/services/retry-handler.js +38 -16
  326. package/dist/domains/test-execution/services/test-executor.d.ts +3 -3
  327. package/dist/domains/test-execution/services/test-executor.js +66 -22
  328. package/dist/governance/ab-benchmarking.d.ts +5 -1
  329. package/dist/governance/ab-benchmarking.js +64 -29
  330. package/dist/init/fleet-integration.js +3 -2
  331. package/dist/init/init-wizard-steps.js +3 -2
  332. package/dist/init/phases/06-code-intelligence.js +6 -4
  333. package/dist/integrations/ruvector/sona-persistence.d.ts +1 -0
  334. package/dist/integrations/ruvector/sona-persistence.js +74 -20
  335. package/dist/integrations/ruvector/sona-wrapper.d.ts +2 -0
  336. package/dist/integrations/ruvector/sona-wrapper.js +13 -0
  337. package/dist/kernel/memory-backend.js +5 -4
  338. package/dist/kernel/unified-memory.js +3 -2
  339. package/dist/learning/aqe-learning-engine.js +3 -2
  340. package/dist/mcp/bundle.js +474 -471
  341. package/dist/mcp/connection-pool.d.ts +2 -0
  342. package/dist/mcp/connection-pool.js +13 -2
  343. package/dist/mcp/handlers/memory-handlers.d.ts +1 -0
  344. package/dist/mcp/handlers/memory-handlers.js +16 -6
  345. package/dist/mcp/protocol-server.js +29 -8
  346. package/dist/mcp/security/rate-limiter.d.ts +1 -0
  347. package/dist/mcp/security/rate-limiter.js +22 -5
  348. package/dist/mcp/services/session-store.js +17 -17
  349. package/dist/mcp/tools/planning/goap-status.d.ts +2 -0
  350. package/dist/mcp/tools/planning/goap-status.js +8 -2
  351. package/dist/mcp/types.d.ts +2 -0
  352. package/dist/optimization/session-cache.js +13 -11
  353. package/dist/planning/goap-planner.d.ts +3 -0
  354. package/dist/planning/goap-planner.js +80 -37
  355. package/dist/plugins/cache.js +10 -3
  356. package/dist/shared/embeddings/embedding-cache.js +5 -5
  357. package/dist/shared/embeddings/nomic-embedder.js +17 -7
  358. package/dist/shared/embeddings/ollama-client.js +5 -3
  359. package/dist/shared/git/git-analyzer.js +31 -30
  360. package/dist/shared/http/http-client.js +20 -13
  361. package/dist/shared/io/file-reader.js +11 -8
  362. package/dist/shared/llm/cache.d.ts +8 -29
  363. package/dist/shared/llm/cache.js +12 -11
  364. package/dist/shared/llm/cost-tracker.js +2 -1
  365. package/dist/shared/llm/provider-manager.js +4 -22
  366. package/dist/shared/llm/providers/gemini.d.ts +1 -0
  367. package/dist/shared/llm/providers/gemini.js +14 -5
  368. package/dist/shared/llm/providers/openrouter.js +6 -3
  369. package/dist/shared/metrics/code-metrics.js +1 -1
  370. package/dist/shared/metrics/system-metrics.js +8 -2
  371. package/dist/shared/retry-engine.js +6 -12
  372. package/dist/shared/test-runner-process.d.ts +10 -0
  373. package/dist/shared/test-runner-process.js +210 -0
  374. package/dist/test-scheduling/executors/vitest-executor.js +26 -17
  375. package/dist/validation/quality-verdict.js +3 -2
  376. package/dist/workers/quality-daemon/priority-queue.js +4 -1
  377. package/package.json +6 -4
  378. package/dist/cli/chunks/adapter-TVQKH65T.js +0 -2
  379. package/dist/cli/chunks/aqe-learning-engine-ULGTVVWE.js +0 -2
  380. package/dist/cli/chunks/base-W42BURDL.js +0 -2
  381. package/dist/cli/chunks/browser-workflow-HKGHFFFT.js +0 -2
  382. package/dist/cli/chunks/chunk-2IMSJ7IO.js +0 -2
  383. package/dist/cli/chunks/chunk-FBZC4IGB.js +0 -2
  384. package/dist/cli/chunks/chunk-LXZMP3VX.js +0 -736
  385. package/dist/cli/chunks/chunk-MNQN7UZX.js +0 -4
  386. package/dist/cli/chunks/chunk-OXHF3L2T.js +0 -2
  387. package/dist/cli/chunks/chunk-PELENDDQ.js +0 -2
  388. package/dist/cli/chunks/chunk-TW3SR4TS.js +0 -2
  389. package/dist/cli/chunks/chunk-V6RE4YRQ.js +0 -2
  390. package/dist/cli/chunks/chunk-ZQZD55MN.js +0 -3
  391. package/dist/cli/chunks/ci-J3TDK5RA.js +0 -81
  392. package/dist/cli/chunks/client-3BD2DI4N.js +0 -2
  393. package/dist/cli/chunks/core-handlers-C3H2ZCS2.js +0 -2
  394. package/dist/cli/chunks/cross-domain-router-JCQ7SWDP.js +0 -2
  395. package/dist/cli/chunks/domain-transfer-MFCI76IY.js +0 -2
  396. package/dist/cli/chunks/dream-FTP33IJB.js +0 -2
  397. package/dist/cli/chunks/heartbeat-scheduler-HXBJVJL2.js +0 -2
  398. package/dist/cli/chunks/hnsw-adapter-TU6WG2ME.js +0 -2
  399. package/dist/cli/chunks/hnsw-index-MS5KODD7.js +0 -2
  400. package/dist/cli/chunks/hybrid-backend-HT45LBHC.js +0 -2
  401. package/dist/cli/chunks/impact-analyzer-AP4AGTG5.js +0 -2
  402. package/dist/cli/chunks/init-wizard-I5DFZUQL.js +0 -2
  403. package/dist/cli/chunks/kernel-MISPSPPA.js +0 -2
  404. package/dist/cli/chunks/knowledge-graph-L26JESGE.js +0 -2
  405. package/dist/cli/chunks/llm-router-service-MWGC43ZA.js +0 -2
  406. package/dist/cli/chunks/load-test-H5ISNNM5.js +0 -2
  407. package/dist/cli/chunks/memory-backend-HWDNOBKW.js +0 -2
  408. package/dist/cli/chunks/memory-handlers-ZFDVQZM5.js +0 -2
  409. package/dist/cli/chunks/pattern-null-store-GQP6ICWK.js +0 -2
  410. package/dist/cli/chunks/protocol-executor-AD5A4DAI.js +0 -2
  411. package/dist/cli/chunks/qe-reasoning-bank-W3Z2PKTR.js +0 -2
  412. package/dist/cli/chunks/quality-gate-GYNCA4ZY.js +0 -7
  413. package/dist/cli/chunks/queen-coordinator-HQRHLIJX.js +0 -2
  414. package/dist/cli/chunks/router-MTP5LH4H.js +0 -2
  415. package/dist/cli/chunks/routing-feedback-GWETVB4L.js +0 -2
  416. package/dist/cli/chunks/rvf-dual-writer-4UE5S7WP.js +0 -2
  417. package/dist/cli/chunks/rvf-migration-adapter-PHH3HF4Q.js +0 -2
  418. package/dist/cli/chunks/rvf-native-adapter-KTLZBUWV.js +0 -2
  419. package/dist/cli/chunks/safe-db-FWWGAPVE.js +0 -2
  420. package/dist/cli/chunks/schedule-TPA4V4D5.js +0 -2
  421. package/dist/cli/chunks/scheduler-5ZTEPNDD.js +0 -2
  422. package/dist/cli/chunks/sqlite-persistence-HPTT624C.js +0 -2
  423. package/dist/cli/chunks/unified-memory-OVFEPRPS.js +0 -2
  424. package/dist/cli/chunks/unified-memory-hnsw-KKRSCZHR.js +0 -2
  425. package/dist/cli/chunks/unified-persistence-7GLR4RI3.js +0 -2
  426. package/dist/cli/chunks/visual-security-2FUM5GLI.js +0 -2
  427. package/dist/cli/chunks/witness-chain-MH6GA5L6.js +0 -2
  428. package/dist/cli/chunks/workflow-orchestrator-H6G65YKU.js +0 -2
@@ -56,6 +56,7 @@ declare class ConnectionPoolImpl {
56
56
  private readonly config;
57
57
  private healthCheckInterval;
58
58
  private initialized;
59
+ private initializationPromise;
59
60
  private totalRequests;
60
61
  private cacheHits;
61
62
  private acquisitionTimes;
@@ -67,6 +68,7 @@ declare class ConnectionPoolImpl {
67
68
  * Initialize the connection pool with minConnections
68
69
  */
69
70
  initialize(): Promise<void>;
71
+ private initializeOnce;
70
72
  /**
71
73
  * Acquire a connection from the pool (O(1) operation)
72
74
  * Uses semaphore pattern to prevent race conditions
@@ -27,6 +27,7 @@ class ConnectionPoolImpl {
27
27
  config;
28
28
  healthCheckInterval = null;
29
29
  initialized = false;
30
+ initializationPromise = null;
30
31
  // Performance tracking
31
32
  totalRequests = 0;
32
33
  cacheHits = 0;
@@ -45,6 +46,14 @@ class ConnectionPoolImpl {
45
46
  if (this.initialized) {
46
47
  return;
47
48
  }
49
+ if (!this.initializationPromise) {
50
+ this.initializationPromise = this.initializeOnce().finally(() => {
51
+ this.initializationPromise = null;
52
+ });
53
+ }
54
+ return this.initializationPromise;
55
+ }
56
+ async initializeOnce() {
48
57
  // Pre-warm minimum connections
49
58
  const warmupPromises = [];
50
59
  for (let i = 0; i < this.config.minConnections; i++) {
@@ -115,7 +124,7 @@ class ConnectionPoolImpl {
115
124
  // O(1) acquisition from idle set
116
125
  for (const connId of this.idleConnections) {
117
126
  const conn = this.connections.get(connId);
118
- if (conn && conn.isHealthy) {
127
+ if (conn && conn.isHealthy && !conn.inUse) {
119
128
  // Mark as in use and remove from idle set
120
129
  conn.inUse = true;
121
130
  conn.lastUsedAt = Date.now();
@@ -134,6 +143,7 @@ class ConnectionPoolImpl {
134
143
  const newConn = this.createConnectionSync();
135
144
  if (newConn) {
136
145
  newConn.inUse = true;
146
+ this.idleConnections.delete(newConn.id);
137
147
  this.cacheHits++;
138
148
  const elapsed = performance.now() - startTime;
139
149
  this.trackAcquisitionTime(elapsed);
@@ -224,7 +234,7 @@ class ConnectionPoolImpl {
224
234
  const pruned = [];
225
235
  for (const [id, conn] of this.connections.entries()) {
226
236
  // Prune if unhealthy or idle for too long
227
- if (!conn.isHealthy || (now - conn.lastUsedAt > this.config.idleTimeoutMs)) {
237
+ if (!conn.inUse && (!conn.isHealthy || (now - conn.lastUsedAt > this.config.idleTimeoutMs))) {
228
238
  pruned.push(id);
229
239
  }
230
240
  }
@@ -252,6 +262,7 @@ class ConnectionPoolImpl {
252
262
  * Shutdown the pool
253
263
  */
254
264
  async shutdown() {
265
+ await this.initializationPromise;
255
266
  if (this.healthCheckInterval) {
256
267
  clearInterval(this.healthCheckInterval);
257
268
  this.healthCheckInterval = null;
@@ -21,6 +21,7 @@ interface MemoryQueryResult {
21
21
  score?: number;
22
22
  timestamp?: string;
23
23
  }>;
24
+ /** Matching candidates fetched, including the look-ahead; not a corpus-wide count. */
24
25
  total: number;
25
26
  hasMore: boolean;
26
27
  searchType: 'pattern' | 'semantic';
@@ -5,6 +5,7 @@
5
5
  * ADR-058: Integrated with MemoryWriteGate for contradiction detection
6
6
  * and ComplianceReporter for violation tracking.
7
7
  */
8
+ import { randomUUID } from 'node:crypto';
8
9
  import { getFleetState, isFleetInitialized } from './core-handlers.js';
9
10
  // ADR-058: Governance integration for memory writes
10
11
  import { toErrorMessage } from '../../shared/error-utils.js';
@@ -199,8 +200,15 @@ export async function handleMemoryQuery(params) {
199
200
  }
200
201
  try {
201
202
  const namespace = params.namespace || 'default';
202
- const limit = params.limit || 100;
203
- const offset = params.offset || 0;
203
+ const limit = params.limit ?? 100;
204
+ const offset = params.offset ?? 0;
205
+ if (!Number.isSafeInteger(limit) || limit < 0 ||
206
+ !Number.isSafeInteger(offset) || offset < 0 ||
207
+ !Number.isSafeInteger(limit + offset + 1)) {
208
+ return { success: false, error: 'Memory query limit and offset must be non-negative safe integers with a safe combined page size.' };
209
+ }
210
+ // One extra candidate proves whether another page exists without scanning all memory.
211
+ const fetchLimit = limit + offset + 1;
204
212
  // Determine if we should use semantic (HNSW vector) search
205
213
  const useSemantic = params.semantic === true ||
206
214
  (params.semantic !== false && params.pattern && isNaturalLanguageQuery(params.pattern));
@@ -209,8 +217,9 @@ export async function handleMemoryQuery(params) {
209
217
  try {
210
218
  // Generate real 384-dim transformer embedding for accurate cosine similarity search
211
219
  const embedding = await computeRealEmbedding(params.pattern);
212
- const keyPrefix = namespace !== 'default' ? `${namespace}:` : undefined;
213
- const filtered = await memory.vectorSearch(embedding, limit + offset, keyPrefix);
220
+ // Semantic queries have the same namespace boundary as pattern queries.
221
+ const keyPrefix = `${namespace}:`;
222
+ const filtered = await memory.vectorSearch(embedding, fetchLimit, keyPrefix);
214
223
  const paginatedResults = filtered.slice(offset, offset + limit);
215
224
  const entries = paginatedResults.map(r => {
216
225
  const parts = r.key.split(':');
@@ -240,7 +249,7 @@ export async function handleMemoryQuery(params) {
240
249
  const pattern = params.pattern
241
250
  ? `${namespace}:${params.pattern}`
242
251
  : `${namespace}:*`;
243
- const keys = await memory.search(pattern, limit + offset);
252
+ const keys = await memory.search(pattern, fetchLimit);
244
253
  // Apply pagination
245
254
  const paginatedKeys = keys.slice(offset, offset + limit);
246
255
  const entries = paginatedKeys.map((key) => {
@@ -353,7 +362,8 @@ export async function handleMemoryShare(params) {
353
362
  }
354
363
  try {
355
364
  // Store shared knowledge for each target agent
356
- const sharedKey = `shared:${params.knowledgeDomain}:${Date.now()}`;
365
+ // Concurrent agents can publish several findings within the same millisecond.
366
+ const sharedKey = `shared:${params.knowledgeDomain}:${Date.now()}:${randomUUID()}`;
357
367
  const sharedContent = {
358
368
  source: params.sourceAgentId,
359
369
  targets: params.targetAgentIds,
@@ -417,6 +417,7 @@ export class MCPProtocolServer {
417
417
  const startTime = performance.now();
418
418
  let success = false;
419
419
  let cacheable;
420
+ let invalidatesCache = false;
420
421
  // Emit AG-UI progress event for tool start
421
422
  const stepId = `${name}-${Date.now()}`;
422
423
  this.eventAdapter.adapt({
@@ -461,14 +462,13 @@ export class MCPProtocolServer {
461
462
  // IMP-00: Execute pre-tool-call middleware
462
463
  const processedCtx = await this.middlewareChain.executePreHooks(ctx);
463
464
  // Issue #473: Session-cache lookup for read-only tools.
464
- // Concurrency-safe tools are idempotent in practice — same input yields
465
- // the same output, so we can short-circuit repeated calls with an O(1)
466
- // fingerprint lookup. Tools without isConcurrencySafe (writes, scans,
467
- // executions) always re-run.
468
- // Explicit quality gates depend on current measured evidence and its age,
469
- // not just arguments. A cached approval can outlive or contradict evidence.
465
+ // Concurrency safety does not imply stable output: status and metrics
466
+ // can change in the background without another MCP mutation. Live reads
467
+ // opt out of reuse while retaining their concurrency-safe scheduling hint.
468
+ // Explicit quality gates also depend on current measured evidence/age.
470
469
  const measuredQualityGate = name === 'quality_assess' && processedCtx.params?.runGate === true;
471
- cacheable = tool.definition.isConcurrencySafe === true && !measuredQualityGate;
470
+ invalidatesCache = tool.definition.isConcurrencySafe !== true || measuredQualityGate;
471
+ cacheable = !invalidatesCache && tool.definition.isCacheable !== false;
472
472
  let cacheFingerprint = null;
473
473
  let cacheGeneration = null;
474
474
  if (cacheable && process.env.AQE_SESSION_CACHE !== 'off') {
@@ -592,7 +592,7 @@ export class MCPProtocolServer {
592
592
  // Tool names and success flags do not prove whether state changed.
593
593
  // Unknown cross-domain effects require a global flush, including after
594
594
  // a handler throws or reports failure following a partial effect.
595
- if (cacheable === false && process.env.AQE_SESSION_CACHE !== 'off') {
595
+ if (invalidatesCache && process.env.AQE_SESSION_CACHE !== 'off') {
596
596
  try {
597
597
  const { getSessionCache } = await import('../optimization/session-cache.js');
598
598
  getSessionCache().invalidateAll();
@@ -631,6 +631,7 @@ export class MCPProtocolServer {
631
631
  description: 'Get fleet status: agents, tasks, health, and learning stats. Example: fleet_status({ verbose: true })',
632
632
  category: 'core',
633
633
  isConcurrencySafe: true,
634
+ isCacheable: false,
634
635
  parameters: [
635
636
  { name: 'verbose', type: 'boolean', description: 'Include detailed information', default: false },
636
637
  ],
@@ -643,6 +644,7 @@ export class MCPProtocolServer {
643
644
  description: 'Check fleet and per-domain health status with load metrics. Example: fleet_health({ domain: "test-generation" })',
644
645
  category: 'core',
645
646
  isConcurrencySafe: true,
647
+ isCacheable: false,
646
648
  parameters: [
647
649
  { name: 'domain', type: 'string', description: 'Specific domain to check' },
648
650
  ],
@@ -670,6 +672,7 @@ export class MCPProtocolServer {
670
672
  description: 'List tasks with optional status/limit filtering. Example: task_list({ status: "running", limit: 10 })',
671
673
  category: 'task',
672
674
  isConcurrencySafe: true,
675
+ isCacheable: false,
673
676
  parameters: [
674
677
  { name: 'status', type: 'string', description: 'Filter by status' },
675
678
  { name: 'limit', type: 'number', description: 'Maximum results', default: 50 },
@@ -683,6 +686,7 @@ export class MCPProtocolServer {
683
686
  description: 'Get detailed status, progress, and result of a specific task. Example: task_status({ taskId: "abc-123" })',
684
687
  category: 'task',
685
688
  isConcurrencySafe: true,
689
+ isCacheable: false,
686
690
  parameters: [
687
691
  { name: 'taskId', type: 'string', description: 'Task ID', required: true },
688
692
  ],
@@ -719,6 +723,7 @@ export class MCPProtocolServer {
719
723
  description: 'List all active agents, optionally filtered by domain. Example: agent_list({ domain: "test-generation" })',
720
724
  category: 'agent',
721
725
  isConcurrencySafe: true,
726
+ isCacheable: false,
722
727
  parameters: [
723
728
  { name: 'domain', type: 'string', description: 'Filter by domain' },
724
729
  ],
@@ -743,6 +748,7 @@ export class MCPProtocolServer {
743
748
  description: 'Get CPU, memory, and task performance metrics for agents. Example: agent_metrics({ agentId: "agent-1" })',
744
749
  category: 'agent',
745
750
  isConcurrencySafe: true,
751
+ isCacheable: false,
746
752
  parameters: [
747
753
  { name: 'agentId', type: 'string', description: 'Specific agent ID', required: true },
748
754
  ],
@@ -755,6 +761,7 @@ export class MCPProtocolServer {
755
761
  description: 'Get detailed status and current task of a specific agent. Example: agent_status({ agentId: "agent-1" })',
756
762
  category: 'agent',
757
763
  isConcurrencySafe: true,
764
+ isCacheable: false,
758
765
  parameters: [
759
766
  { name: 'agentId', type: 'string', description: 'Agent ID', required: true },
760
767
  ],
@@ -768,6 +775,7 @@ export class MCPProtocolServer {
768
775
  description: 'List all active domain teams and their agent counts. Example: team_list({ domain: "coverage-analysis" })',
769
776
  category: 'agent',
770
777
  isConcurrencySafe: true,
778
+ isCacheable: false,
771
779
  parameters: [
772
780
  { name: 'domain', type: 'string', description: 'Filter by domain' },
773
781
  ],
@@ -780,6 +788,7 @@ export class MCPProtocolServer {
780
788
  description: 'Get team health, agent utilization, and consensus status for a domain. Example: team_health({ domain: "security-compliance" })',
781
789
  category: 'agent',
782
790
  isConcurrencySafe: true,
791
+ isCacheable: false,
783
792
  parameters: [
784
793
  { name: 'domain', type: 'string', description: 'Domain to check', required: true },
785
794
  ],
@@ -1024,6 +1033,8 @@ export class MCPProtocolServer {
1024
1033
  { name: 'pattern', type: 'string', description: 'Key pattern (glob) or natural language query (for semantic search)' },
1025
1034
  { name: 'namespace', type: 'string', description: 'Memory namespace' },
1026
1035
  { name: 'semantic', type: 'boolean', description: 'Use HNSW vector search instead of pattern matching. Auto-detected when pattern contains spaces and no wildcards.' },
1036
+ { name: 'limit', type: 'number', description: 'Maximum entries in the page (non-negative safe integer)', default: 100 },
1037
+ { name: 'offset', type: 'number', description: 'Number of entries to skip (non-negative safe integer)', default: 0 },
1027
1038
  ],
1028
1039
  },
1029
1040
  handler: (params) => handleMemoryQuery(params),
@@ -1046,6 +1057,7 @@ export class MCPProtocolServer {
1046
1057
  description: 'Get memory usage statistics: entry counts, namespaces, and storage size. Example: memory_usage({})',
1047
1058
  category: 'memory',
1048
1059
  isConcurrencySafe: true,
1060
+ isCacheable: false,
1049
1061
  parameters: [],
1050
1062
  },
1051
1063
  handler: () => handleMemoryUsage(),
@@ -1089,6 +1101,7 @@ export class MCPProtocolServer {
1089
1101
  description: 'Get model routing statistics: tier distribution, cost savings, and routing log. Example: routing_metrics({ includeLog: true, logLimit: 20 })',
1090
1102
  category: 'routing',
1091
1103
  isConcurrencySafe: true,
1104
+ isCacheable: false,
1092
1105
  parameters: [
1093
1106
  { name: 'includeLog', type: 'boolean', description: 'Include routing log entries', default: false },
1094
1107
  { name: 'logLimit', type: 'number', description: 'Max log entries to return', default: 100 },
@@ -1102,6 +1115,7 @@ export class MCPProtocolServer {
1102
1115
  description: 'Get economic routing report: tier efficiency, budget status, cost-per-quality analysis, and savings opportunities. Example: routing_economics({ taskComplexity: 0.5 })',
1103
1116
  category: 'routing',
1104
1117
  isConcurrencySafe: true,
1118
+ isCacheable: false,
1105
1119
  parameters: [
1106
1120
  { name: 'taskComplexity', type: 'number', description: 'Task complexity score 0-1 for tier scoring (default: 0.5)', default: 0.5 },
1107
1121
  ],
@@ -1115,6 +1129,7 @@ export class MCPProtocolServer {
1115
1129
  description: 'Get infrastructure self-healing status: detected failures, recovery stats, and failing services. Example: infra_healing_status({ verbose: true })',
1116
1130
  category: 'infra-healing',
1117
1131
  isConcurrencySafe: true,
1132
+ isCacheable: false,
1118
1133
  parameters: [
1119
1134
  { name: 'verbose', type: 'boolean', description: 'Include detailed observation data', default: false },
1120
1135
  ],
@@ -1215,6 +1230,7 @@ export class MCPProtocolServer {
1215
1230
  description: 'Get cross-phase memory statistics (total signals, by loop, by namespace)',
1216
1231
  category: 'cross-phase',
1217
1232
  isConcurrencySafe: true,
1233
+ isCacheable: false,
1218
1234
  parameters: [],
1219
1235
  },
1220
1236
  handler: () => handleCrossPhaseStats(),
@@ -1307,6 +1323,7 @@ export class MCPProtocolServer {
1307
1323
  description: 'List all loaded YAML pipelines. Example: pipeline_list({})',
1308
1324
  category: 'coordination',
1309
1325
  isConcurrencySafe: true,
1326
+ isCacheable: false,
1310
1327
  parameters: [],
1311
1328
  },
1312
1329
  handler: (params) => handlePipelineList(params),
@@ -1346,6 +1363,7 @@ export class MCPProtocolServer {
1346
1363
  description: 'Get session operation cache statistics: hit rate, cache size, tokens saved via O(1) fingerprint reuse. Example: session_cache_stats({})',
1347
1364
  category: 'learning',
1348
1365
  isConcurrencySafe: true,
1366
+ isCacheable: false,
1349
1367
  parameters: [],
1350
1368
  },
1351
1369
  handler: async () => {
@@ -1380,6 +1398,7 @@ export class MCPProtocolServer {
1380
1398
  description: 'Check AQE server health: returns status, loaded domains, memory stats, HNSW index status, and pattern count. Example: aqe_health({})',
1381
1399
  category: 'core',
1382
1400
  isConcurrencySafe: true,
1401
+ isCacheable: false,
1383
1402
  parameters: [],
1384
1403
  },
1385
1404
  handler: () => handleAQEHealth(),
@@ -1391,6 +1410,7 @@ export class MCPProtocolServer {
1391
1410
  description: 'Get RVF migration status: current stage, metrics, consistency, and gate evaluation. Example: migration_status({})',
1392
1411
  category: 'persistence',
1393
1412
  isConcurrencySafe: true,
1413
+ isCacheable: false,
1394
1414
  parameters: [],
1395
1415
  },
1396
1416
  handler: () => handleMigrationStatus(),
@@ -1401,6 +1421,7 @@ export class MCPProtocolServer {
1401
1421
  description: 'Run a consistency check comparing SQLite and RVF search results. Samples random patterns and reports divergences. Example: migration_check({})',
1402
1422
  category: 'persistence',
1403
1423
  isConcurrencySafe: true,
1424
+ isCacheable: false,
1404
1425
  parameters: [],
1405
1426
  },
1406
1427
  handler: () => handleMigrationCheck(),
@@ -135,6 +135,7 @@ export declare class RateLimiter {
135
135
  private createBucket;
136
136
  private getBucket;
137
137
  private getEndpointKey;
138
+ private matchesEndpoint;
138
139
  private getConfig;
139
140
  private refillBucket;
140
141
  private buildHeaders;
@@ -86,6 +86,9 @@ export class RateLimiter {
86
86
  * Consume tokens (blocks if not available in sync mode)
87
87
  */
88
88
  consume(clientId, endpoint, tokens = 1) {
89
+ if (!Number.isFinite(tokens) || tokens < 0) {
90
+ throw new RangeError('Token cost must be finite and nonnegative');
91
+ }
89
92
  this.stats.totalRequests++;
90
93
  const now = Date.now();
91
94
  // Get configuration (endpoint-specific or default)
@@ -144,7 +147,10 @@ export class RateLimiter {
144
147
  * Reset a client's bucket
145
148
  */
146
149
  resetClient(clientId) {
147
- this.clientBuckets.delete(clientId);
150
+ for (const key of this.clientBuckets.keys()) {
151
+ if (JSON.parse(key)[0] === clientId)
152
+ this.clientBuckets.delete(key);
153
+ }
148
154
  }
149
155
  /**
150
156
  * Reset all buckets
@@ -177,7 +183,7 @@ export class RateLimiter {
177
183
  * Get client-specific statistics
178
184
  */
179
185
  getClientStats(clientId) {
180
- const bucket = this.clientBuckets.get(clientId);
186
+ const bucket = this.clientBuckets.get(JSON.stringify([clientId, null]));
181
187
  return bucket ? { ...bucket } : null;
182
188
  }
183
189
  /**
@@ -209,7 +215,8 @@ export class RateLimiter {
209
215
  }
210
216
  // Create a composite key for client + endpoint-specific limits
211
217
  const endpointKey = this.getEndpointKey(endpoint);
212
- const bucketKey = endpointKey ? `${clientId}:${endpointKey}` : clientId;
218
+ // Encode boundaries so an endpoint bucket cannot alias another client ID.
219
+ const bucketKey = JSON.stringify([clientId, endpointKey]);
213
220
  let bucket = this.clientBuckets.get(bucketKey);
214
221
  if (!bucket) {
215
222
  bucket = {
@@ -231,19 +238,29 @@ export class RateLimiter {
231
238
  const pattern = typeof limit.pattern === 'string'
232
239
  ? createSafeRegex(limit.pattern)
233
240
  : limit.pattern;
234
- if (pattern && pattern.test(endpoint)) {
241
+ if (pattern && this.matchesEndpoint(pattern, endpoint)) {
235
242
  return `ep${i}`;
236
243
  }
237
244
  }
238
245
  return null;
239
246
  }
247
+ matchesEndpoint(pattern, endpoint) {
248
+ const previousIndex = pattern.lastIndex;
249
+ try {
250
+ pattern.lastIndex = 0;
251
+ return pattern.test(endpoint);
252
+ }
253
+ finally {
254
+ pattern.lastIndex = previousIndex;
255
+ }
256
+ }
240
257
  getConfig(endpoint) {
241
258
  if (endpoint) {
242
259
  for (const limit of this.endpointLimits) {
243
260
  const pattern = typeof limit.pattern === 'string'
244
261
  ? createSafeRegex(limit.pattern)
245
262
  : limit.pattern;
246
- if (pattern && pattern.test(endpoint)) {
263
+ if (pattern && this.matchesEndpoint(pattern, endpoint)) {
247
264
  return {
248
265
  tokensPerSecond: limit.tokensPerSecond,
249
266
  maxBurst: limit.maxBurst,
@@ -80,26 +80,26 @@ export class SessionStore {
80
80
  uuid,
81
81
  parentUuid: this.lastUuid,
82
82
  };
83
+ // Database-free mode keeps bookkeeping without serialization or disk I/O.
84
+ if (!this.persistDisabled) {
85
+ const line = JSON.stringify(fullEntry) + '\n';
86
+ if (!this.fileCreated) {
87
+ // First write: synchronous for write-ahead guarantee
88
+ this.ensureDirectory();
89
+ fs.appendFileSync(this.filePath, line, 'utf-8');
90
+ this.fileCreated = true;
91
+ }
92
+ else {
93
+ // Subsequent writes: buffer and batch
94
+ this.writeBuffer.push(line);
95
+ this.scheduleBatchFlush();
96
+ }
97
+ }
98
+ // Only advance the chain and metadata after the entry has been accepted.
83
99
  this.lastUuid = uuid;
84
100
  this.entryCount++;
85
101
  this.lastActivityAt = fullEntry.timestamp;
86
102
  this.currentState = fullEntry.state;
87
- // Database-free mode: bookkeeping done above; skip all disk I/O.
88
- if (this.persistDisabled) {
89
- return uuid;
90
- }
91
- const line = JSON.stringify(fullEntry) + '\n';
92
- if (!this.fileCreated) {
93
- // First write: synchronous for write-ahead guarantee
94
- this.ensureDirectory();
95
- fs.appendFileSync(this.filePath, line, 'utf-8');
96
- this.fileCreated = true;
97
- }
98
- else {
99
- // Subsequent writes: buffer and batch
100
- this.writeBuffer.push(line);
101
- this.scheduleBatchFlush();
102
- }
103
103
  return uuid;
104
104
  }
105
105
  /**
@@ -112,8 +112,8 @@ export class SessionStore {
112
112
  }
113
113
  if (this.writeBuffer.length > 0 && this.filePath && this.fileCreated) {
114
114
  const batch = this.writeBuffer.join('');
115
- this.writeBuffer = [];
116
115
  fs.appendFileSync(this.filePath, batch, 'utf-8');
116
+ this.writeBuffer = [];
117
117
  }
118
118
  }
119
119
  /**
@@ -109,6 +109,8 @@ export interface PlansResult {
109
109
  createdAt?: string;
110
110
  }>;
111
111
  count: number;
112
+ /** Stored rows omitted from this page because their action sequence is invalid. */
113
+ invalidPlanIds?: string[];
112
114
  reuseStats?: {
113
115
  totalPlans: number;
114
116
  reusedPlans: number;
@@ -11,6 +11,7 @@ import { MCPToolBase, } from '../base.js';
11
11
  import { toErrorMessage } from '../../../shared/error-utils.js';
12
12
  import { getSharedGOAPPlanner, createMockExecutor, getAllQEActions, } from '../../../planning/index.js';
13
13
  import { detectWorldState, defaultedFields, } from './world-state.js';
14
+ const PLAN_STATUSES = ['pending', 'executing', 'completed', 'failed', 'cancelled'];
14
15
  // ============================================================================
15
16
  // Tool Implementation
16
17
  // ============================================================================
@@ -54,7 +55,8 @@ export class GOAPStatusTool extends MCPToolBase {
54
55
  },
55
56
  status: {
56
57
  type: 'string',
57
- description: 'Filter plans by status (pending, executing, completed, failed)',
58
+ description: 'Filter plans by status (pending, executing, completed, failed, cancelled)',
59
+ enum: [...PLAN_STATUSES],
58
60
  },
59
61
  limit: {
60
62
  type: 'number',
@@ -252,8 +254,11 @@ export class GOAPStatusTool extends MCPToolBase {
252
254
  * Get plans
253
255
  */
254
256
  async getPlans(status, limit = 20) {
257
+ if (status !== undefined && !PLAN_STATUSES.includes(status)) {
258
+ return { success: false, error: `filter.status must be one of: ${PLAN_STATUSES.join(', ')}` };
259
+ }
255
260
  const planner = await this.getPlanner();
256
- const [{ plans, count }, reuseStats] = await Promise.all([
261
+ const [{ plans, count, invalidPlanIds }, reuseStats] = await Promise.all([
257
262
  planner.listPlanSummaries(status, limit),
258
263
  planner.getPlanReuseStats(),
259
264
  ]);
@@ -265,6 +270,7 @@ export class GOAPStatusTool extends MCPToolBase {
265
270
  data: {
266
271
  plans,
267
272
  count,
273
+ ...(invalidPlanIds ? { invalidPlanIds } : {}),
268
274
  reuseStats: {
269
275
  totalPlans: reuseStats.totalPlans,
270
276
  reusedPlans: reuseStats.reusedPlans,
@@ -42,6 +42,8 @@ export interface ToolDefinition {
42
42
  domain?: DomainName;
43
43
  lazyLoad?: boolean;
44
44
  isConcurrencySafe?: boolean;
45
+ /** False for live reads whose results must not be reused by the session cache. */
46
+ isCacheable?: boolean;
45
47
  annotations?: ToolAnnotations;
46
48
  }
47
49
  /**
@@ -40,17 +40,19 @@ export const DEFAULT_SESSION_CACHE_CONFIG = {
40
40
  * Ensures identical logical objects always produce the same fingerprint.
41
41
  */
42
42
  function canonicalStringify(value) {
43
- if (value === null || value === undefined)
44
- return JSON.stringify(value);
45
- if (typeof value !== 'object')
46
- return JSON.stringify(value);
47
- if (Array.isArray(value)) {
48
- return '[' + value.map(v => canonicalStringify(v)).join(',') + ']';
43
+ // Honor JSON's array holes, undefined fields and toJSON (for example Date)
44
+ // before ordering keys. Hand-built fragments can conflate distinct inputs.
45
+ const normalized = JSON.parse(JSON.stringify(value));
46
+ function encode(item) {
47
+ if (item === null || typeof item !== 'object')
48
+ return JSON.stringify(item);
49
+ if (Array.isArray(item))
50
+ return '[' + item.map(encode).join(',') + ']';
51
+ const obj = item;
52
+ return '{' + Object.keys(obj).sort()
53
+ .map(key => JSON.stringify(key) + ':' + encode(obj[key])).join(',') + '}';
49
54
  }
50
- const obj = value;
51
- const sortedKeys = Object.keys(obj).sort();
52
- const pairs = sortedKeys.map(k => JSON.stringify(k) + ':' + canonicalStringify(obj[k]));
53
- return '{' + pairs.join(',') + '}';
55
+ return encode(normalized);
54
56
  }
55
57
  // ============================================================================
56
58
  // Implementation
@@ -114,7 +116,7 @@ export class SessionOperationCache {
114
116
  if (!this.config.enabled)
115
117
  return;
116
118
  // Evict oldest if at capacity
117
- if (this.cache.size >= this.config.maxEntries) {
119
+ if (!this.cache.has(fingerprint) && this.cache.size >= this.config.maxEntries) {
118
120
  this.evictOldest();
119
121
  }
120
122
  const entry = {
@@ -75,6 +75,8 @@ export declare class GOAPPlanner {
75
75
  * bindings on already-seeded databases without requiring a full re-seed.
76
76
  */
77
77
  private backfillActionMethodBindings;
78
+ /** Restore missing estimates only for unchanged legacy library definitions. */
79
+ private backfillActionDurationEstimates;
78
80
  /**
79
81
  * Find an optimal plan using A* search
80
82
  *
@@ -222,6 +224,7 @@ export declare class GOAPPlanner {
222
224
  createdAt: string;
223
225
  }>;
224
226
  count: number;
227
+ invalidPlanIds?: string[];
225
228
  }>;
226
229
  /**
227
230
  * Find a similar plan by goal conditions