@oscharko-dev/keiko 0.2.0-beta.7 → 0.2.0-beta.9

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 (314) hide show
  1. package/dist/ui/csp-hashes.json +14 -14
  2. package/dist/ui/static/404.html +1 -1
  3. package/dist/ui/static/__next.__PAGE__.txt +2 -2
  4. package/dist/ui/static/__next._full.txt +3 -3
  5. package/dist/ui/static/__next._head.txt +1 -1
  6. package/dist/ui/static/__next._index.txt +2 -2
  7. package/dist/ui/static/__next._tree.txt +2 -2
  8. package/dist/ui/static/_next/static/chunks/06-q1ntr51v8r.js +1 -0
  9. package/dist/ui/static/_next/static/chunks/0y9qlvrxsyign.js +109 -0
  10. package/dist/ui/static/_next/static/chunks/1h0v66-p9cx19.css +1 -0
  11. package/dist/ui/static/_next/static/chunks/3ewv4mguqzooj.js +1 -0
  12. package/dist/ui/static/_not-found/__next._full.txt +2 -2
  13. package/dist/ui/static/_not-found/__next._head.txt +1 -1
  14. package/dist/ui/static/_not-found/__next._index.txt +2 -2
  15. package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
  16. package/dist/ui/static/_not-found/__next._not-found.txt +1 -1
  17. package/dist/ui/static/_not-found/__next._tree.txt +2 -2
  18. package/dist/ui/static/_not-found.html +1 -1
  19. package/dist/ui/static/_not-found.txt +2 -2
  20. package/dist/ui/static/fonts/OFL.txt +93 -0
  21. package/dist/ui/static/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  22. package/dist/ui/static/index.html +1 -1
  23. package/dist/ui/static/index.txt +3 -3
  24. package/dist/ui/static/launch/__next._full.txt +3 -3
  25. package/dist/ui/static/launch/__next._head.txt +1 -1
  26. package/dist/ui/static/launch/__next._index.txt +2 -2
  27. package/dist/ui/static/launch/__next._tree.txt +2 -2
  28. package/dist/ui/static/launch/__next.launch.__PAGE__.txt +2 -2
  29. package/dist/ui/static/launch/__next.launch.txt +1 -1
  30. package/dist/ui/static/launch.html +1 -1
  31. package/dist/ui/static/launch.txt +3 -3
  32. package/dist/ui/static/local-knowledge/__next._full.txt +3 -3
  33. package/dist/ui/static/local-knowledge/__next._head.txt +1 -1
  34. package/dist/ui/static/local-knowledge/__next._index.txt +2 -2
  35. package/dist/ui/static/local-knowledge/__next._tree.txt +2 -2
  36. package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +2 -2
  37. package/dist/ui/static/local-knowledge/__next.local-knowledge.txt +1 -1
  38. package/dist/ui/static/local-knowledge/capsule/__next._full.txt +3 -3
  39. package/dist/ui/static/local-knowledge/capsule/__next._head.txt +1 -1
  40. package/dist/ui/static/local-knowledge/capsule/__next._index.txt +2 -2
  41. package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +2 -2
  42. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +2 -2
  43. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.txt +1 -1
  44. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.txt +1 -1
  45. package/dist/ui/static/local-knowledge/capsule.html +1 -1
  46. package/dist/ui/static/local-knowledge/capsule.txt +3 -3
  47. package/dist/ui/static/local-knowledge.html +1 -1
  48. package/dist/ui/static/local-knowledge.txt +3 -3
  49. package/dist/ui/static/memoriaviva/__next._full.txt +2 -2
  50. package/dist/ui/static/memoriaviva/__next._head.txt +1 -1
  51. package/dist/ui/static/memoriaviva/__next._index.txt +2 -2
  52. package/dist/ui/static/memoriaviva/__next._tree.txt +2 -2
  53. package/dist/ui/static/memoriaviva/__next.memoriaviva.__PAGE__.txt +1 -1
  54. package/dist/ui/static/memoriaviva/__next.memoriaviva.txt +1 -1
  55. package/dist/ui/static/memoriaviva/consolidation/__next._full.txt +2 -2
  56. package/dist/ui/static/memoriaviva/consolidation/__next._head.txt +1 -1
  57. package/dist/ui/static/memoriaviva/consolidation/__next._index.txt +2 -2
  58. package/dist/ui/static/memoriaviva/consolidation/__next._tree.txt +2 -2
  59. package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.consolidation.__PAGE__.txt +1 -1
  60. package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.consolidation.txt +1 -1
  61. package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.txt +1 -1
  62. package/dist/ui/static/memoriaviva/consolidation.html +1 -1
  63. package/dist/ui/static/memoriaviva/consolidation.txt +2 -2
  64. package/dist/ui/static/memoriaviva/detail/__next._full.txt +2 -2
  65. package/dist/ui/static/memoriaviva/detail/__next._head.txt +1 -1
  66. package/dist/ui/static/memoriaviva/detail/__next._index.txt +2 -2
  67. package/dist/ui/static/memoriaviva/detail/__next._tree.txt +2 -2
  68. package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.detail.__PAGE__.txt +1 -1
  69. package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.detail.txt +1 -1
  70. package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.txt +1 -1
  71. package/dist/ui/static/memoriaviva/detail.html +1 -1
  72. package/dist/ui/static/memoriaviva/detail.txt +2 -2
  73. package/dist/ui/static/memoriaviva/review-queue/__next._full.txt +2 -2
  74. package/dist/ui/static/memoriaviva/review-queue/__next._head.txt +1 -1
  75. package/dist/ui/static/memoriaviva/review-queue/__next._index.txt +2 -2
  76. package/dist/ui/static/memoriaviva/review-queue/__next._tree.txt +2 -2
  77. package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.review-queue.__PAGE__.txt +1 -1
  78. package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.review-queue.txt +1 -1
  79. package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.txt +1 -1
  80. package/dist/ui/static/memoriaviva/review-queue.html +1 -1
  81. package/dist/ui/static/memoriaviva/review-queue.txt +2 -2
  82. package/dist/ui/static/memoriaviva.html +1 -1
  83. package/dist/ui/static/memoriaviva.txt +2 -2
  84. package/dist/ui/static/sw.js +7 -3
  85. package/node_modules/@oscharko-dev/keiko-cli/dist/.tsbuildinfo +1 -1
  86. package/node_modules/@oscharko-dev/keiko-cli/dist/memory.d.ts.map +1 -1
  87. package/node_modules/@oscharko-dev/keiko-cli/dist/memory.js +4 -5
  88. package/node_modules/@oscharko-dev/keiko-cli/package.json +1 -1
  89. package/node_modules/@oscharko-dev/keiko-contracts/dist/.tsbuildinfo +1 -1
  90. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +2 -2
  91. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts.map +1 -1
  92. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +1 -1
  93. package/node_modules/@oscharko-dev/keiko-contracts/dist/qualityIntelligence/bffWire.d.ts +36 -4
  94. package/node_modules/@oscharko-dev/keiko-contracts/dist/qualityIntelligence/bffWire.d.ts.map +1 -1
  95. package/node_modules/@oscharko-dev/keiko-contracts/dist/qualityIntelligence/index.d.ts +1 -1
  96. package/node_modules/@oscharko-dev/keiko-contracts/dist/qualityIntelligence/index.d.ts.map +1 -1
  97. package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
  98. package/node_modules/@oscharko-dev/keiko-evaluations/dist/.tsbuildinfo +1 -1
  99. package/node_modules/@oscharko-dev/keiko-evaluations/package.json +1 -1
  100. package/node_modules/@oscharko-dev/keiko-evidence/dist/.tsbuildinfo +1 -1
  101. package/node_modules/@oscharko-dev/keiko-evidence/dist/index.d.ts +1 -1
  102. package/node_modules/@oscharko-dev/keiko-evidence/dist/index.d.ts.map +1 -1
  103. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/schema.d.ts +15 -0
  104. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/schema.d.ts.map +1 -1
  105. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/schema.js +13 -3
  106. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/store.d.ts +13 -0
  107. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/store.d.ts.map +1 -1
  108. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/store.js +46 -2
  109. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/index.d.ts +2 -2
  110. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/index.d.ts.map +1 -1
  111. package/node_modules/@oscharko-dev/keiko-evidence/package.json +1 -1
  112. package/node_modules/@oscharko-dev/keiko-harness/dist/.tsbuildinfo +1 -1
  113. package/node_modules/@oscharko-dev/keiko-harness/package.json +1 -1
  114. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/.tsbuildinfo +1 -1
  115. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/pdf-parser.d.ts.map +1 -1
  116. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/pdf-parser.js +0 -10
  117. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/types.d.ts +2 -2
  118. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/types.d.ts.map +1 -1
  119. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/types.js +3 -3
  120. package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +1 -1
  121. package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +1 -1
  122. package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +1 -1
  123. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/.tsbuildinfo +1 -1
  124. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/index.d.ts +1 -1
  125. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/index.d.ts.map +1 -1
  126. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/index.js +1 -1
  127. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/maintenance.d.ts +2 -16
  128. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/maintenance.d.ts.map +1 -1
  129. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/maintenance.js +49 -48
  130. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/retention.d.ts +2 -1
  131. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/retention.d.ts.map +1 -1
  132. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/retention.js +15 -0
  133. package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +1 -1
  134. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/.tsbuildinfo +1 -1
  135. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/decay.d.ts +2 -0
  136. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/decay.d.ts.map +1 -0
  137. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/decay.js +22 -0
  138. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/diversity.d.ts +8 -0
  139. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/diversity.d.ts.map +1 -0
  140. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/diversity.js +87 -0
  141. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/index.d.ts +4 -2
  142. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/index.d.ts.map +1 -1
  143. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/index.js +4 -1
  144. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/ranking.d.ts +5 -1
  145. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/ranking.d.ts.map +1 -1
  146. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/ranking.js +140 -21
  147. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/recency.d.ts.map +1 -1
  148. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/recency.js +4 -10
  149. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/retrieve.d.ts.map +1 -1
  150. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/retrieve.js +11 -1
  151. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/strength.d.ts +9 -0
  152. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/strength.d.ts.map +1 -0
  153. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/strength.js +51 -0
  154. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/types.d.ts +11 -0
  155. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/types.d.ts.map +1 -1
  156. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/types.js +7 -0
  157. package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +1 -1
  158. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/.tsbuildinfo +1 -1
  159. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/access.d.ts +3 -0
  160. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/access.d.ts.map +1 -1
  161. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/access.js +31 -1
  162. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.d.ts +1 -1
  163. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.d.ts.map +1 -1
  164. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.js +16 -1
  165. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/types.d.ts +1 -0
  166. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/types.d.ts.map +1 -1
  167. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault.d.ts.map +1 -1
  168. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault.js +4 -1
  169. package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +1 -1
  170. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/.tsbuildinfo +1 -1
  171. package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +1 -1
  172. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/.tsbuildinfo +1 -1
  173. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/figma/screenIrTestBaseline.d.ts +8 -0
  174. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/figma/screenIrTestBaseline.d.ts.map +1 -1
  175. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/figma/screenIrTestBaseline.js +9 -5
  176. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testDesignModel.d.ts +6 -0
  177. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testDesignModel.d.ts.map +1 -1
  178. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testDesignModel.js +116 -21
  179. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testQualityRubric.d.ts +6 -0
  180. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testQualityRubric.d.ts.map +1 -1
  181. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testQualityRubric.js +12 -0
  182. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/validation.d.ts.map +1 -1
  183. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/validation.js +8 -7
  184. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/generation/parseGeneratedCandidates.d.ts.map +1 -1
  185. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/generation/parseGeneratedCandidates.js +29 -7
  186. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/generation/prompt.d.ts.map +1 -1
  187. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/generation/prompt.js +61 -24
  188. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/index.d.ts +1 -1
  189. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/index.d.ts.map +1 -1
  190. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/index.js +1 -1
  191. package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +1 -1
  192. package/node_modules/@oscharko-dev/keiko-sdk/dist/.tsbuildinfo +1 -1
  193. package/node_modules/@oscharko-dev/keiko-sdk/package.json +1 -1
  194. package/node_modules/@oscharko-dev/keiko-security/dist/.tsbuildinfo +1 -1
  195. package/node_modules/@oscharko-dev/keiko-security/package.json +1 -1
  196. package/node_modules/@oscharko-dev/keiko-server/dist/.tsbuildinfo +1 -1
  197. package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts.map +1 -1
  198. package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.js +44 -65
  199. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-prompt.d.ts.map +1 -1
  200. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-prompt.js +2 -0
  201. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts +2 -0
  202. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
  203. package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +1 -0
  204. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
  205. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +333 -70
  206. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.d.ts +1 -0
  207. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.d.ts.map +1 -1
  208. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.js +410 -18
  209. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.d.ts.map +1 -1
  210. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.js +1 -0
  211. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts.map +1 -1
  212. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.js +7 -5
  213. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.js +4 -3
  214. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts +1 -0
  215. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts.map +1 -1
  216. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +4 -1
  217. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts +1 -0
  218. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts.map +1 -1
  219. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.js +8 -3
  220. package/node_modules/@oscharko-dev/keiko-server/dist/memory-conv-handlers.d.ts.map +1 -1
  221. package/node_modules/@oscharko-dev/keiko-server/dist/memory-conv-handlers.js +34 -5
  222. package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.d.ts +12 -2
  223. package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.d.ts.map +1 -1
  224. package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.js +127 -0
  225. package/node_modules/@oscharko-dev/keiko-server/dist/memory-handlers.d.ts.map +1 -1
  226. package/node_modules/@oscharko-dev/keiko-server/dist/memory-handlers.js +40 -11
  227. package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.d.ts +16 -3
  228. package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.d.ts.map +1 -1
  229. package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.js +72 -50
  230. package/node_modules/@oscharko-dev/keiko-server/dist/memory-retrieval-signals.d.ts +12 -0
  231. package/node_modules/@oscharko-dev/keiko-server/dist/memory-retrieval-signals.d.ts.map +1 -0
  232. package/node_modules/@oscharko-dev/keiko-server/dist/memory-retrieval-signals.js +84 -0
  233. package/node_modules/@oscharko-dev/keiko-server/dist/memory-salience.d.ts.map +1 -1
  234. package/node_modules/@oscharko-dev/keiko-server/dist/memory-salience.js +11 -6
  235. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaConnector.d.ts.map +1 -1
  236. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaConnector.js +9 -4
  237. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaScopedPagination.d.ts +6 -5
  238. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaScopedPagination.d.ts.map +1 -1
  239. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaScopedPagination.js +10 -9
  240. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotBuilder.d.ts +2 -1
  241. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotBuilder.d.ts.map +1 -1
  242. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotBuilder.js +62 -26
  243. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotHash.d.ts +2 -0
  244. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotHash.d.ts.map +1 -1
  245. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotHash.js +6 -3
  246. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotTypes.d.ts +14 -0
  247. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotTypes.d.ts.map +1 -1
  248. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts +33 -0
  249. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts.map +1 -1
  250. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.js +263 -5
  251. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotScreenIds.d.ts +19 -0
  252. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotScreenIds.d.ts.map +1 -0
  253. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotScreenIds.js +75 -0
  254. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.d.ts.map +1 -1
  255. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.js +13 -12
  256. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelSelection.d.ts +6 -6
  257. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelSelection.d.ts.map +1 -1
  258. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelSelection.js +12 -7
  259. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/reCheckRoutes.d.ts.map +1 -1
  260. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/reCheckRoutes.js +34 -3
  261. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runIngestion.d.ts +4 -2
  262. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runIngestion.d.ts.map +1 -1
  263. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runIngestion.js +222 -35
  264. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.d.ts +7 -0
  265. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.d.ts.map +1 -1
  266. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.js +68 -16
  267. package/node_modules/@oscharko-dev/keiko-server/dist/routes.d.ts.map +1 -1
  268. package/node_modules/@oscharko-dev/keiko-server/dist/routes.js +7 -1
  269. package/node_modules/@oscharko-dev/keiko-server/package.json +1 -1
  270. package/node_modules/@oscharko-dev/keiko-tools/dist/.tsbuildinfo +1 -1
  271. package/node_modules/@oscharko-dev/keiko-tools/package.json +1 -1
  272. package/node_modules/@oscharko-dev/keiko-verification/dist/.tsbuildinfo +1 -1
  273. package/node_modules/@oscharko-dev/keiko-verification/package.json +1 -1
  274. package/node_modules/@oscharko-dev/keiko-workflows/dist/.tsbuildinfo +1 -1
  275. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.d.ts.map +1 -1
  276. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.js +45 -0
  277. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.d.ts +2 -0
  278. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.d.ts.map +1 -1
  279. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.js +1 -0
  280. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.d.ts +8 -0
  281. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.d.ts.map +1 -0
  282. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.js +140 -0
  283. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.d.ts +2 -0
  284. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.d.ts.map +1 -1
  285. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.js +21 -5
  286. package/node_modules/@oscharko-dev/keiko-workflows/dist/qualityIntelligence/modelRoutedTestDesign.d.ts.map +1 -1
  287. package/node_modules/@oscharko-dev/keiko-workflows/dist/qualityIntelligence/modelRoutedTestDesign.js +86 -40
  288. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/rank.d.ts.map +1 -1
  289. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/rank.js +9 -0
  290. package/node_modules/@oscharko-dev/keiko-workflows/package.json +1 -1
  291. package/node_modules/@oscharko-dev/keiko-workspace/dist/.tsbuildinfo +1 -1
  292. package/node_modules/@oscharko-dev/keiko-workspace/dist/index.d.ts +1 -0
  293. package/node_modules/@oscharko-dev/keiko-workspace/dist/index.d.ts.map +1 -1
  294. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.d.ts +3 -0
  295. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.d.ts.map +1 -1
  296. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.js +23 -6
  297. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.d.ts +1 -1
  298. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.d.ts.map +1 -1
  299. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.js +24 -3
  300. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.d.ts +34 -0
  301. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.d.ts.map +1 -0
  302. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.js +342 -0
  303. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.d.ts +6 -1
  304. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.d.ts.map +1 -1
  305. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.js +57 -9
  306. package/node_modules/@oscharko-dev/keiko-workspace/package.json +1 -1
  307. package/package.json +2 -1
  308. package/dist/ui/static/_next/static/chunks/0-qhhdvxg2j_y.js +0 -1
  309. package/dist/ui/static/_next/static/chunks/0ke4ratkgvcxo.css +0 -1
  310. package/dist/ui/static/_next/static/chunks/3vf3oh2-sl2nc.js +0 -1
  311. package/dist/ui/static/_next/static/chunks/3wmd4-2vznp2g.js +0 -106
  312. /package/dist/ui/static/_next/static/{frhs0YcUqCPLHal-wHjDP → a5sUbXeTgQ9A2LRTMu_Q_}/_buildManifest.js +0 -0
  313. /package/dist/ui/static/_next/static/{frhs0YcUqCPLHal-wHjDP → a5sUbXeTgQ9A2LRTMu_Q_}/_clientMiddlewareManifest.js +0 -0
  314. /package/dist/ui/static/_next/static/{frhs0YcUqCPLHal-wHjDP → a5sUbXeTgQ9A2LRTMu_Q_}/_ssgManifest.js +0 -0
@@ -6,8 +6,10 @@
6
6
  // 2. Run consolidation on the accepted subset; persist auto-applicable relationship edges and
7
7
  // return unresolved review items for MemoriaViva or CLI operators. Conflict and merge review
8
8
  // items are NEVER auto-applied here.
9
- // 3. Compute the maintenance plan and apply it: promote (-> accepted), reinforce / decay
10
- // (confidence patch), archive (-> archived), forget (vault delete + tombstone + reason).
9
+ // 3. Compute the maintenance plan and apply it: promote (-> accepted), archive (-> archived),
10
+ // forget (vault delete + tombstone + reason). Confidence is immutable provenance and is never
11
+ // patched here (O-V2): reuse strengthens memories live in retrieval ranking, and disuse-decay
12
+ // is computed on the fly via the strength curve that gates archive/forget.
11
13
  // 4. Emit one audit event per applied effect and return the counts.
12
14
  //
13
15
  // CSRF: the server dispatch layer enforces x-keiko-csrf for POST, so this route is guarded without
@@ -21,8 +23,6 @@ import { recordMemoryAudit } from "./memory-audit-handler.js";
21
23
  function emptyCounts() {
22
24
  return {
23
25
  promoted: 0,
24
- reinforced: 0,
25
- decayed: 0,
26
26
  archived: 0,
27
27
  forgotten: 0,
28
28
  superseded: 0,
@@ -44,24 +44,20 @@ function resolveVault(deps) {
44
44
  }
45
45
  return deps.memoryVault;
46
46
  }
47
- function emitAudit(evidenceStore, kind, surface, summary, extra) {
47
+ function emitAudit(evidenceStore, nowMs, kind, surface, summary, extra) {
48
48
  if (evidenceStore === undefined)
49
49
  return;
50
50
  const event = {
51
51
  schemaVersion: "1",
52
52
  kind,
53
53
  eventId: randomUUID(),
54
- occurredAt: Date.now(),
54
+ occurredAt: nowMs,
55
55
  initiatorSurface: surface,
56
56
  summary,
57
57
  ...extra,
58
58
  };
59
59
  recordMemoryAudit({ evidenceStore }, event);
60
60
  }
61
- // Patch a record's confidence by rebuilding the provenance envelope (confidence lives there).
62
- function patchConfidence(vault, record, confidence) {
63
- vault.updateMemory(record.id, { provenance: { ...record.provenance, confidence } }, Date.now());
64
- }
65
61
  function recordsById(records) {
66
62
  const map = new Map();
67
63
  for (const record of records)
@@ -82,9 +78,9 @@ function applyEdges(vault, edges) {
82
78
  }
83
79
  return created;
84
80
  }
85
- function runConsolidationPass(vault, records, counts) {
81
+ function runConsolidationPass(vault, nowMs, records, counts) {
86
82
  const result = runConsolidation(records, {
87
- nowMs: Date.now(),
83
+ nowMs,
88
84
  newEdgeId: () => randomUUID(),
89
85
  newReviewItemId: () => randomUUID(),
90
86
  });
@@ -94,48 +90,41 @@ function runConsolidationPass(vault, records, counts) {
94
90
  counts.reviewItems.push(...result.reviewItems);
95
91
  }
96
92
  // ─── Plan application ──────────────────────────────────────────────────────────
97
- // Applies the reinforce / decay / archive / forget effects on the post-consolidation snapshot.
98
- // Promotions are applied SEPARATELY and BEFORE consolidation (see runMemoryMaintenance) so that
99
- // freshly-accepted memories are visible to conflict detection within the same maintenance pass.
100
- function applyDecayEffects(vault, evidenceStore, plan, byId, counts) {
101
- applyConfidencePatches(vault, plan.reinforce, byId, (n) => (counts.reinforced += n));
102
- applyConfidencePatches(vault, plan.decay, byId, (n) => (counts.decayed += n));
103
- applyArchives(vault, evidenceStore, plan.archive, byId, counts);
104
- applyForgets(vault, evidenceStore, plan.forget, byId, counts);
105
- }
106
- function applyPromotions(vault, evidenceStore, ids, byId, counts) {
93
+ // Applies the archive / forget effects on the post-consolidation snapshot. Promotions are applied
94
+ // SEPARATELY and BEFORE consolidation (see runMemoryMaintenance) so that freshly-accepted memories
95
+ // are visible to conflict detection within the same maintenance pass.
96
+ //
97
+ // Confidence is NEVER mutated here (#204, O-V2): reinforcement-on-reuse is realised live in
98
+ // retrieval ranking, and disuse-decay is computed on the fly via the strength curve that already
99
+ // gates archive/forget so provenance stays intact and every run is idempotent.
100
+ function applyFadeEffects(vault, evidenceStore, nowMs, plan, byId, counts) {
101
+ applyArchives(vault, evidenceStore, nowMs, plan.archive, byId, counts);
102
+ applyForgets(vault, evidenceStore, nowMs, plan.forget, byId, counts);
103
+ }
104
+ function applyPromotions(vault, evidenceStore, nowMs, ids, byId, counts) {
107
105
  for (const id of ids) {
108
106
  const record = byId.get(id);
109
107
  if (record === undefined)
110
108
  continue;
111
- vault.updateMemory(id, { status: "accepted" }, Date.now());
109
+ vault.updateMemory(id, { status: "accepted" }, nowMs);
112
110
  counts.promoted += 1;
113
- emitAudit(evidenceStore, "memory:accepted", "memory-center", "Promoted a strong proposed memory.", { memoryId: id, scope: record.scope });
114
- }
115
- }
116
- function applyConfidencePatches(vault, patches, byId, bump) {
117
- for (const patch of patches) {
118
- const record = byId.get(patch.id);
119
- if (record === undefined)
120
- continue;
121
- patchConfidence(vault, record, patch.confidence);
122
- bump(1);
111
+ emitAudit(evidenceStore, nowMs, "memory:accepted", "memory-center", "Promoted a strong proposed memory.", { memoryId: id, scope: record.scope });
123
112
  }
124
113
  }
125
- function applyArchives(vault, evidenceStore, ids, byId, counts) {
114
+ function applyArchives(vault, evidenceStore, nowMs, ids, byId, counts) {
126
115
  for (const id of ids) {
127
116
  const record = byId.get(id);
128
117
  if (record === undefined)
129
118
  continue;
130
- vault.updateMemory(id, { status: "archived" }, Date.now());
119
+ vault.updateMemory(id, { status: "archived" }, nowMs);
131
120
  counts.archived += 1;
132
- emitAudit(evidenceStore, "memory:archived", "retention", "Archived a faded memory.", {
121
+ emitAudit(evidenceStore, nowMs, "memory:archived", "retention", "Archived a faded memory.", {
133
122
  memoryId: id,
134
123
  scope: record.scope,
135
124
  });
136
125
  }
137
126
  }
138
- function applyForgets(vault, evidenceStore, forgets, byId, counts) {
127
+ function applyForgets(vault, evidenceStore, nowMs, forgets, byId, counts) {
139
128
  for (const forget of forgets) {
140
129
  const record = byId.get(forget.id);
141
130
  if (record === undefined)
@@ -144,20 +133,21 @@ function applyForgets(vault, evidenceStore, forgets, byId, counts) {
144
133
  tombstone: true,
145
134
  forgetterSurface: "memory-maintenance",
146
135
  reason: forget.reason,
147
- nowMs: Date.now(),
136
+ nowMs,
148
137
  });
149
138
  counts.forgotten += 1;
150
- emitAudit(evidenceStore, "memory:forgotten", "retention", `Forgot a memory (${forget.reason}).`, {
139
+ emitAudit(evidenceStore, nowMs, "memory:forgotten", "retention", `Forgot a memory (${forget.reason}).`, {
151
140
  memoryId: forget.id,
152
141
  scope: record.scope,
153
142
  tombstoned: true,
154
143
  });
155
144
  }
156
145
  }
157
- // Reusable maintenance core. Drives consolidation + the governance plan against a vault, emitting
158
- // audit events when an evidence store is supplied. Exported so both the BFF route handler and the
159
- // `keiko memory maintain` CLI run the SAME pass no duplicated orchestration.
160
- export function runMemoryMaintenance(vault, evidenceStore) {
146
+ export function runMemoryMaintenance(vault, evidenceStore, options) {
147
+ // ONE clock for the whole pass: both plan phases and every vault write / audit timestamp use the
148
+ // same nowMs, so selection is consistent within a run and fully replay-stable when nowMs is
149
+ // injected (the deterministic-verification invariant the rest of the stack honours).
150
+ const nowMs = options?.nowMs ?? Date.now();
161
151
  const counts = emptyCounts();
162
152
  // Phase 1 — promote strong `proposed` memories FIRST. Consolidation and conflict detection only
163
153
  // inspect `accepted` records, so without this a vault full of freshly-captured `proposed`
@@ -165,22 +155,54 @@ export function runMemoryMaintenance(vault, evidenceStore) {
165
155
  // resolved. Promoting up front makes a single "Run maintenance" fully effective.
166
156
  const beforePromote = vault.listMemories({ includeExpired: true });
167
157
  const promoteStats = vault.getAccessStats();
168
- const promotePlan = planMemoryMaintenance(beforePromote, promoteStats, { nowMs: Date.now() });
169
- applyPromotions(vault, evidenceStore, promotePlan.promote, recordsById(beforePromote), counts);
158
+ const promotePlan = planMemoryMaintenance(beforePromote, promoteStats, { nowMs });
159
+ applyPromotions(vault, evidenceStore, nowMs, promotePlan.promote, recordsById(beforePromote), counts);
170
160
  // Phase 2 — consolidate the now-accepted set: link safe near-duplicate metadata and surface
171
161
  // conflicts / merges as explicit review items. Status mutations require a later governed review.
172
162
  const accepted = vault
173
163
  .listMemories({ includeExpired: true })
174
164
  .filter((record) => record.status === "accepted");
175
- runConsolidationPass(vault, accepted, counts);
176
- // Phase 3 — reinforce / decay / archive / forget on the post-consolidation snapshot. The access
177
- // stats feed the strength model.
165
+ runConsolidationPass(vault, nowMs, accepted, counts);
166
+ // Phase 3 — archive / forget on the post-consolidation snapshot. The access stats feed the
167
+ // strength model; confidence itself is never mutated (O-V2).
178
168
  const all = vault.listMemories({ includeExpired: true });
179
169
  const accessStats = vault.getAccessStats();
180
- const plan = planMemoryMaintenance(all, accessStats, { nowMs: Date.now() });
181
- applyDecayEffects(vault, evidenceStore, plan, recordsById(all), counts);
170
+ const plan = planMemoryMaintenance(all, accessStats, { nowMs });
171
+ applyFadeEffects(vault, evidenceStore, nowMs, plan, recordsById(all), counts);
182
172
  return counts;
183
173
  }
174
+ // ─── Bounded autonomous maintenance (#204, O-V4) ───────────────────────────────
175
+ // The strength/decay/forget pass only "lives" if it actually runs. Rather than a free-running
176
+ // background loop (forbidden by the no-unbounded-hidden-activity invariant), maintenance is fired
177
+ // opportunistically — once memory is used — and rate-limited to at most once per interval. The pass
178
+ // itself is already bounded (maxForgetPerRun) and audited, so an autonomous fire is governed.
179
+ export const MEMORY_AUTO_MAINTENANCE_MIN_INTERVAL_MS = 6 * 60 * 60 * 1000; // 6 hours
180
+ // Pure: due iff never run, or the interval has elapsed. A non-finite/negative interval is treated as
181
+ // "never auto-run" so a misconfiguration can only DISABLE, never spin.
182
+ export function isMaintenanceDue(lastRunAtMs, nowMs, minIntervalMs = MEMORY_AUTO_MAINTENANCE_MIN_INTERVAL_MS) {
183
+ if (!Number.isFinite(minIntervalMs) || minIntervalMs <= 0)
184
+ return false;
185
+ if (lastRunAtMs === undefined)
186
+ return true;
187
+ return nowMs - lastRunAtMs >= minIntervalMs;
188
+ }
189
+ // Runs ONE bounded maintenance pass iff enabled AND due, advancing the cursor BEFORE running so a
190
+ // re-entrant call within the same tick cannot double-fire. Returns the result, or null when skipped.
191
+ // Never throws: a maintenance fault must not break the caller (e.g. a chat turn); it is swallowed
192
+ // after advancing the cursor so a persistently-failing pass cannot hot-loop.
193
+ export function maybeRunAutoMaintenance(vault, evidenceStore, state, options) {
194
+ if (!options.enabled)
195
+ return null;
196
+ if (!isMaintenanceDue(state.lastRunAtMs, options.nowMs, options.minIntervalMs))
197
+ return null;
198
+ state.lastRunAtMs = options.nowMs;
199
+ try {
200
+ return runMemoryMaintenance(vault, evidenceStore, { nowMs: options.nowMs });
201
+ }
202
+ catch {
203
+ return null;
204
+ }
205
+ }
184
206
  export function handleRunMaintenance(ctx, deps) {
185
207
  void ctx;
186
208
  const vault = resolveVault(deps);
@@ -0,0 +1,12 @@
1
+ import type { MemoryId, MemoryScope } from "@oscharko-dev/keiko-contracts/memory";
2
+ import { type RankingFusionMode } from "@oscharko-dev/keiko-memory-retrieval";
3
+ import type { MemoryVaultStore } from "@oscharko-dev/keiko-memory-vault";
4
+ import type { UiHandlerDeps } from "./deps.js";
5
+ export declare function conversationFusionMode(deps: UiHandlerDeps): RankingFusionMode;
6
+ export interface ConversationRetrievalSignals {
7
+ readonly semanticById?: ReadonlyMap<MemoryId, number> | undefined;
8
+ readonly strengthById: ReadonlyMap<MemoryId, number>;
9
+ readonly embeddingById: ReadonlyMap<MemoryId, Float32Array>;
10
+ }
11
+ export declare function buildConversationRetrievalSignals(deps: UiHandlerDeps, vault: MemoryVaultStore, queryText: string | undefined, scopes: readonly MemoryScope[], nowMs: number, safeForSecondaryModel: boolean): Promise<ConversationRetrievalSignals>;
12
+ //# sourceMappingURL=memory-retrieval-signals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-retrieval-signals.d.ts","sourceRoot":"","sources":["../src/memory-retrieval-signals.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAgB,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAE7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAwD/C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,aAAa,GAAG,iBAAiB,CAE7E;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAClE,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAIrD,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;CAC7D;AAED,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,gBAAgB,EACvB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,SAAS,WAAW,EAAE,EAC9B,KAAK,EAAE,MAAM,EACb,qBAAqB,EAAE,OAAO,GAC7B,OAAO,CAAC,4BAA4B,CAAC,CAkBvC"}
@@ -0,0 +1,84 @@
1
+ // Shared conversation-retrieval signal builder (#204, O-F4).
2
+ //
3
+ // Both conversation retrieval surfaces — the desktop chat path (chat-handlers) and the BFF
4
+ // /api/memory/context route (memory-conv-handlers) — need the same two model/usage-derived ranking
5
+ // signals on top of the pure lexical ranker:
6
+ // - semanticById: per-memory cosine of the query embedding to each candidate's stored vector
7
+ // (embedding-based recall), gated by the secondary-model egress check.
8
+ // - strengthById: per-memory reinforcement strength from the vault's access counters (O-P1).
9
+ // Previously only the chat path built them; the BFF route silently ran lexical-only. Centralising
10
+ // them here keeps the two surfaces from drifting (the same class of duplication C3 guards for
11
+ // suppression) and gives any future consumer of the route the stronger embedding signal by default.
12
+ //
13
+ // Pure of policy: the caller decides whether the query is egress-safe and passes that in. Graceful:
14
+ // no embedding model => semanticById undefined (byte-identical lexical fallback); empty access
15
+ // history => strengthById empty (the ranker zeroes its weight).
16
+ import { buildStrengthById, DEFAULT_LIST_BY_SCOPE_MAX_RESULTS, DEFAULT_STALE_CONFIDENCE_THRESHOLD, isMemorySuppressed, } from "@oscharko-dev/keiko-memory-retrieval";
17
+ import { cosineSimilarity, embedMemoryText } from "./memory-embedding.js";
18
+ // A candidate is worth scoring iff the ranker could surface it. A superset of the ranked set is
19
+ // harmless: ids the ranker filters out simply never read their semantic score.
20
+ function isSemanticRetrievalCandidate(record, nowMs) {
21
+ if (record.status === "superseded")
22
+ return false;
23
+ return !isMemorySuppressed(record, nowMs, DEFAULT_STALE_CONFIDENCE_THRESHOLD).suppressed;
24
+ }
25
+ function gatherCandidateIds(vault, scopes, nowMs) {
26
+ const ids = [];
27
+ const seen = new Set();
28
+ for (const scope of scopes) {
29
+ for (const record of vault.listMemoriesByScope(scope, {
30
+ includeExpired: true,
31
+ limit: DEFAULT_LIST_BY_SCOPE_MAX_RESULTS,
32
+ })) {
33
+ if (!isSemanticRetrievalCandidate(record, nowMs))
34
+ continue;
35
+ if (seen.has(record.id))
36
+ continue;
37
+ seen.add(record.id);
38
+ ids.push(record.id);
39
+ }
40
+ }
41
+ return ids;
42
+ }
43
+ // Per-memory semantic score map for the candidate set, or undefined when no embedding model is
44
+ // configured (query embedding null) — that undefined drives the byte-identical lexical fallback in
45
+ // the ranker. A candidate whose stored vector is missing is omitted (semantic subscore 0 for it).
46
+ // Query-cosine scores for the candidate set, computed from the already-fetched embeddings. Gated by
47
+ // the egress check (it embeds the query). Returns undefined when no model / no query embedding.
48
+ async function semanticScoresFrom(deps, queryText, candidateIds, embeddings) {
49
+ const queryEmbedding = await embedMemoryText(deps, queryText);
50
+ if (queryEmbedding === null)
51
+ return undefined;
52
+ const scores = new Map();
53
+ for (const id of candidateIds) {
54
+ const stored = embeddings.get(id);
55
+ if (stored === undefined)
56
+ continue;
57
+ scores.set(id, cosineSimilarity(queryEmbedding.vector, stored.vector));
58
+ }
59
+ return scores;
60
+ }
61
+ // Signal-fusion mode for the conversation retrieval surfaces (#204, O-F2). Opt-in via env to keep
62
+ // the release on the byte-identical weighted-sum default; set KEIKO_MEMORY_FUSION=rrf to enable
63
+ // rank-based Reciprocal Rank Fusion across both the chat and BFF paths.
64
+ export function conversationFusionMode(deps) {
65
+ return deps.env.KEIKO_MEMORY_FUSION === "rrf" ? "rrf" : "weighted-sum";
66
+ }
67
+ export async function buildConversationRetrievalSignals(deps, vault, queryText, scopes, nowMs, safeForSecondaryModel) {
68
+ const strengthById = buildStrengthById(vault.getAccessStats(), nowMs);
69
+ const candidateIds = gatherCandidateIds(vault, scopes, nowMs);
70
+ const embeddings = candidateIds.length > 0
71
+ ? vault.getEmbeddings(candidateIds)
72
+ : new Map();
73
+ const embeddingById = new Map();
74
+ for (const [id, row] of embeddings)
75
+ embeddingById.set(id, row.vector);
76
+ const semanticById = safeForSecondaryModel && queryText !== undefined && queryText.length > 0 && embeddings.size > 0
77
+ ? await semanticScoresFrom(deps, queryText, candidateIds, embeddings)
78
+ : undefined;
79
+ return {
80
+ strengthById,
81
+ embeddingById,
82
+ ...(semanticById !== undefined ? { semanticById } : {}),
83
+ };
84
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"memory-salience.d.ts","sourceRoot":"","sources":["../src/memory-salience.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAU3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,kCAAkC,CAAC;AAqH1C,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CAC5D;AAID,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,gCAAgC,EACzC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,SAAS,4BAA4B,EAAE,CAAC,CA2ClD"}
1
+ {"version":3,"file":"memory-salience.d.ts","sourceRoot":"","sources":["../src/memory-salience.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAU3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,kCAAkC,CAAC;AA0H1C,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CAC5D;AAID,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,gCAAgC,EACzC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,SAAS,4BAA4B,EAAE,CAAC,CA2ClD"}
@@ -13,7 +13,7 @@ import { extractSalientMemories, memoryTextEgressRejectionReason, } from "@oscha
13
13
  import { currentRedactionSecrets } from "./deps.js";
14
14
  import { conversationMemoryScopes, } from "./memory-conversation-context.js";
15
15
  import { buildMemoryRecordFromProposal } from "./memory-record-builders.js";
16
- import { embedAndStoreMemory } from "./memory-embedding.js";
16
+ import { insertSalienceMemoryWithNoveltyGate } from "./memory-embedding.js";
17
17
  import { isPersistableMemoryCandidate, memoryCapturePolicyForDeps, SENSITIVE_MEMORY_REJECTION_REASON, } from "./memory-capture-policy.js";
18
18
  // Mirror of chat-handlers' private scopeLabel (decision 3 — mirrored rather than exported to keep
19
19
  // the modules decoupled). Pure and trivial.
@@ -78,9 +78,10 @@ function redactedErrorMessage(error, deps) {
78
78
  return redact(message, currentRedactionSecrets(deps));
79
79
  }
80
80
  // Persists one salience candidate and returns its wire action, or null when the outcome is not a
81
- // candidate or no record could be built. Best-effort embed-on-capture (#204): the inserted memory
82
- // is embedded and the vector stored when an embedding model is configured; failure is swallowed by
83
- // embedAndStoreMemory so capture is never affected.
81
+ // candidate, no record could be built, or the candidate was merged into an existing semantic
82
+ // near-duplicate (#204, O-F1) instead of stored. Embed-on-capture happens INSIDE the novelty gate:
83
+ // the body is embedded once, used to detect a near-duplicate, and stored only when the record is
84
+ // actually inserted. Graceful when no embedding model is configured (plain insert, no dedup).
84
85
  async function persistCandidate(deps, outcome, vault) {
85
86
  if (outcome.kind !== "candidate") {
86
87
  return null;
@@ -93,8 +94,12 @@ async function persistCandidate(deps, outcome, vault) {
93
94
  if (record === null) {
94
95
  return null;
95
96
  }
96
- const inserted = vault.insertMemory(record);
97
- await embedAndStoreMemory(deps, vault, inserted.id, inserted.body);
97
+ const { inserted } = await insertSalienceMemoryWithNoveltyGate(deps, vault, record);
98
+ if (inserted === null) {
99
+ // Near-duplicate of an existing in-scope memory: the canonical was reinforced, nothing new to
100
+ // surface. Over-capture is bounded at the encode boundary rather than deferred to a decay pass.
101
+ return null;
102
+ }
98
103
  return {
99
104
  kind: "candidate",
100
105
  proposalId: String(inserted.id),
@@ -1 +1 @@
1
- {"version":3,"file":"figmaConnector.d.ts","sourceRoot":"","sources":["../../../src/qualityIntelligence/figma/figmaConnector.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAIL,KAAK,kBAAkB,EAGvB,KAAK,sBAAsB,EAC5B,MAAM,4BAA4B,CAAC;AAOpC,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,kBAAkB,CAAC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AE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,kGAAkG;IAClG,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACvF;;;;OAIG;IACH,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5F;AAgOD,eAAO,MAAM,oBAAoB,GAAI,MAAM,kBAAkB,KAAG,cAiB/D,CAAC"}
@@ -18,9 +18,14 @@ import { resolveReadiness } from "./figmaReadiness.js";
18
18
  import { classifyTokenFailure, resolveFigmaToken } from "./figmaTokenSource.js";
19
19
  import { DEFAULT_SCOPED_PAGINATION_LIMITS, paginateScopedDocument, resolveScopedPaginationLimits, } from "./figmaScopedPagination.js";
20
20
  const FIGMA_API_ORIGIN = "https://api.figma.com";
21
- const DEFAULT_DEPTH = 4;
21
+ const DEFAULT_DEPTH = 2;
22
22
  const DEFAULT_MAX_NODE_COUNT = 5000;
23
23
  const EPOCH = "1970-01-01T00:00:00.000Z";
24
+ const DEEP_FETCH_FAIL_SOFT_RETRY_POLICY = {
25
+ maxRetries: 0,
26
+ baseDelayMs: 500,
27
+ maxDelayMs: 500,
28
+ };
24
29
  const resolveToken = (deps) => resolveFigmaToken({
25
30
  vaultToken: deps.vaultToken,
26
31
  configToken: deps.config?.accessToken,
@@ -96,9 +101,9 @@ const DEEP_FETCH_ABORT_CODES = new Set([
96
101
  // One scoped `nodes?ids=&depth=` fetch (with 429 backoff), returning the raw document. No oversize
97
102
  // guard here — the shallow path applies it; the deep path is bounded by the pagination budgets. The
98
103
  // token flows into the header only.
99
- const fetchDocumentAt = async (rt, token, fileKey, nodeId, fetchDepth, version) => {
104
+ const fetchDocumentAt = async (rt, token, fileKey, nodeId, fetchDepth, version, retryPolicy = rt.retryPolicy) => {
100
105
  const requestUrl = buildScopedUrl(fileKey, nodeId, fetchDepth, version);
101
- const response = await fetchWithBackoff(() => rt.deps.http({ url: requestUrl, headers: { "X-Figma-Token": token } }), rt.retryPolicy, rt.sleep);
106
+ const response = await fetchWithBackoff(() => rt.deps.http({ url: requestUrl, headers: { "X-Figma-Token": token } }), retryPolicy, rt.sleep);
102
107
  if (response.status < 200 || response.status >= 300) {
103
108
  throw statusToError(response.status, response.json);
104
109
  }
@@ -134,7 +139,7 @@ const doFetchScopedNodes = async (rt, url, options) => {
134
139
  const makeDeepFetcher = (rt, token, target, version) => {
135
140
  return async (nodeId) => {
136
141
  try {
137
- return await fetchDocumentAt(rt, token, target.fileKey, nodeId, rt.paginationLimits.pageDepth, version);
142
+ return await fetchDocumentAt(rt, token, target.fileKey, nodeId, rt.paginationLimits.pageDepth, version, DEEP_FETCH_FAIL_SOFT_RETRY_POLICY);
138
143
  }
139
144
  catch (err) {
140
145
  if (err instanceof FigmaConnectorError && DEEP_FETCH_ABORT_CODES.has(err.code))
@@ -37,11 +37,12 @@ export interface ScopedPaginationLimits {
37
37
  }
38
38
  /**
39
39
  * Defaults balanced for Figma's cost-based rate limit on real, latency-bound boards (NOT tuned to any
40
- * sample board's content). `pageDepth=8` keeps each request cheap enough to avoid provoking sustained
41
- * 429s; a small shared pool of 3 in-flight fetches parallelises across screens without bursting the
42
- * limit; the per-screen budgets expand the densest branches further. On a normal board (screens
43
- * shallower than `pageDepth`) a single per-screen fetch captures everything and no round runs. The
44
- * 429 backoff (#759) absorbs occasional rate-limit responses; all of these are deployment-overridable.
40
+ * sample board's content). `pageDepth=8` captures typical screen bodies in one bounded request, while
41
+ * a small shared pool of 2 in-flight fetches avoids bursty high-cost 429s. The per-screen and
42
+ * per-board caps deliberately keep the worst-case live build below 100 deep scoped fetches by
43
+ * default, so a pasted whole-canvas Release section remains reviewable in the browser instead of
44
+ * turning into a minutes-long request storm. Operators can raise these budgets per deployment through
45
+ * KEIKO_FIGMA_* env vars when their Figma plan and proxy allow it.
45
46
  */
46
47
  export declare const DEFAULT_SCOPED_PAGINATION_LIMITS: ScopedPaginationLimits;
47
48
  /** Hard safety ceilings: operators may tune pagination, but never past these finite bounds. */
@@ -1 +1 @@
1
- {"version":3,"file":"figmaScopedPagination.d.ts","sourceRoot":"","sources":["../../../src/qualityIntelligence/figma/figmaScopedPagination.ts"],"names":[],"mappings":"AAyBA,qGAAqG;AACrG,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;mFACmF;AACnF,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC;;mGAE+F;IAC/F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,iBAAiB,EAAE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AC,SAAS,EAAE,MAAM,CAAC;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;CACvC;AA0CD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,YAAY,KAAG,SAAS,YAAY,EAY7E,CAAC;AA4KF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,YAAY,EACzB,WAAW,iBAAiB,EAC5B,SAAQ,sBAAyD,KAChE,OAAO,CAAC,eAAe,CAsCzB,CAAC"}
@@ -24,18 +24,19 @@
24
24
  // assembled tree (and a budget cut-off truncates the same deterministic tail every run).
25
25
  /**
26
26
  * Defaults balanced for Figma's cost-based rate limit on real, latency-bound boards (NOT tuned to any
27
- * sample board's content). `pageDepth=8` keeps each request cheap enough to avoid provoking sustained
28
- * 429s; a small shared pool of 3 in-flight fetches parallelises across screens without bursting the
29
- * limit; the per-screen budgets expand the densest branches further. On a normal board (screens
30
- * shallower than `pageDepth`) a single per-screen fetch captures everything and no round runs. The
31
- * 429 backoff (#759) absorbs occasional rate-limit responses; all of these are deployment-overridable.
27
+ * sample board's content). `pageDepth=8` captures typical screen bodies in one bounded request, while
28
+ * a small shared pool of 2 in-flight fetches avoids bursty high-cost 429s. The per-screen and
29
+ * per-board caps deliberately keep the worst-case live build below 100 deep scoped fetches by
30
+ * default, so a pasted whole-canvas Release section remains reviewable in the browser instead of
31
+ * turning into a minutes-long request storm. Operators can raise these budgets per deployment through
32
+ * KEIKO_FIGMA_* env vars when their Figma plan and proxy allow it.
32
33
  */
33
34
  export const DEFAULT_SCOPED_PAGINATION_LIMITS = {
34
35
  pageDepth: 8,
35
- maxNodesPerScreen: 10_000,
36
- maxFetchesPerScreen: 32,
37
- maxScreensDeep: 80,
38
- fetchConcurrency: 3,
36
+ maxNodesPerScreen: 8_000,
37
+ maxFetchesPerScreen: 6,
38
+ maxScreensDeep: 16,
39
+ fetchConcurrency: 2,
39
40
  };
40
41
  /** Hard safety ceilings: operators may tune pagination, but never past these finite bounds. */
41
42
  export const SCOPED_PAGINATION_LIMIT_CEILINGS = {
@@ -24,7 +24,8 @@ export interface BuildFigmaSnapshotInput {
24
24
  }
25
25
  /**
26
26
  * Render the screens and assemble the immutable Figma Snapshot. Render failures degrade to a
27
- * `skippedScreens` entry (partial render); a non-2xx `/v1/images` call is a hard coded error.
27
+ * `skippedScreens` entry plus structural-only IR (partial render); a non-2xx `/v1/images` call is
28
+ * a hard coded error.
28
29
  */
29
30
  export declare const buildFigmaSnapshot: (input: BuildFigmaSnapshotInput) => Promise<FigmaSnapshot>;
30
31
  //# sourceMappingURL=figmaSnapshotBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"figmaSnapshotBuilder.d.ts","sourceRoot":"","sources":["../../../src/qualityIntelligence/figma/figmaSnapshotBuilder.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAGV,aAAa,EAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAiBzF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,EAAE,wBAAwB,CAAC,cAAc,CAAC;IACrD,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,K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