@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
@@ -19,6 +19,32 @@ import { graphProximityScore } from "./graph.js";
19
19
  import { recencyScore } from "./recency.js";
20
20
  import { lexicalRelevance } from "./relevance.js";
21
21
  const DEFAULT_GRAPH_HIGH_RANK_COUNT = 8;
22
+ // Internal invariant guard. The subscore / rank maps below are built with exactly one entry per
23
+ // memory in `memories`, so a lookup keyed by a memory from that same list is always present. This
24
+ // makes the invariant explicit instead of asserting it away with `!` — a miss is a programmer error,
25
+ // not a recoverable input, so it fails loud rather than silently scoring against a wrong value.
26
+ function requireEntry(map, key) {
27
+ const value = map.get(key);
28
+ if (value === undefined) {
29
+ throw new Error("ranking invariant violated: missing map entry for a known memory");
30
+ }
31
+ return value;
32
+ }
33
+ // Frozen source-authority importance (#204, O-F5). A deterministic function of the immutable capture
34
+ // provenance: a fact the user stated outright outranks one passively inferred by the system, at equal
35
+ // relevance. Reproducible and caller-input-free.
36
+ const SOURCE_IMPORTANCE = {
37
+ "explicit-user-instruction": 1,
38
+ "accepted-correction": 0.85,
39
+ "workflow-outcome": 0.6,
40
+ consolidation: 0.5,
41
+ "system-default": 0.4,
42
+ };
43
+ export function sourceImportance(record) {
44
+ // SOURCE_IMPORTANCE is total over MemorySourceKind, so a new source kind in contracts surfaces here
45
+ // as a compile error rather than silently defaulting.
46
+ return SOURCE_IMPORTANCE[record.provenance.sourceKind];
47
+ }
22
48
  function baselineSubscores(record, query) {
23
49
  return {
24
50
  relevance: lexicalRelevance(query.queryText, record),
@@ -30,6 +56,8 @@ function baselineSubscores(record, query) {
30
56
  : 0,
31
57
  graph: 0,
32
58
  semantic: query.semanticById?.get(record.id) ?? 0,
59
+ strength: query.strengthById?.get(record.id) ?? 0,
60
+ importance: sourceImportance(record),
33
61
  };
34
62
  }
35
63
  function weightedScore(s, w) {
@@ -39,8 +67,18 @@ function weightedScore(s, w) {
39
67
  s.pinned * w.pinned +
40
68
  s.correction * w.correction +
41
69
  s.graph * w.graph +
42
- s.semantic * w.semantic;
43
- const totalWeight = w.relevance + w.recency + w.confidence + w.pinned + w.correction + w.graph + w.semantic;
70
+ s.semantic * w.semantic +
71
+ s.strength * w.strength +
72
+ s.importance * w.importance;
73
+ const totalWeight = w.relevance +
74
+ w.recency +
75
+ w.confidence +
76
+ w.pinned +
77
+ w.correction +
78
+ w.graph +
79
+ w.semantic +
80
+ w.strength +
81
+ w.importance;
44
82
  if (totalWeight <= 0)
45
83
  return 0;
46
84
  return raw / totalWeight;
@@ -52,9 +90,13 @@ function topContributor(s, w) {
52
90
  // Semantic before relevance/recency/confidence so the stronger embedding signal wins a tie
53
91
  // against the lexical signals; pinned/correction stay above it as today.
54
92
  { key: "semantic", value: s.semantic * w.semantic },
93
+ // Reinforcement sits just below semantic: a heavily-reused memory wins a tie against the lexical
94
+ // signals but not against an explicit pin, a fresh correction, or a strong embedding match.
95
+ { key: "strength", value: s.strength * w.strength },
55
96
  { key: "relevance", value: s.relevance * w.relevance },
56
97
  { key: "recency", value: s.recency * w.recency },
57
98
  { key: "confidence", value: s.confidence * w.confidence },
99
+ { key: "importance", value: s.importance * w.importance },
58
100
  { key: "graph", value: s.graph * w.graph },
59
101
  ];
60
102
  let bestKey = "recency";
@@ -78,6 +120,8 @@ function inclusionReasonText(key, value) {
78
120
  correction: "recent correction overrides older facts",
79
121
  graph: "graph proximity to other top memories",
80
122
  semantic: "semantic similarity to query",
123
+ strength: "frequently recalled (reinforced)",
124
+ importance: "authoritative source",
81
125
  };
82
126
  return `top signal: ${label[key]}`;
83
127
  }
@@ -115,10 +159,97 @@ function sortByRank(entries, recordById) {
115
159
  // every score, reason, and ordering is identical to the pre-semantic lexical ranker. Only when
116
160
  // `semanticById` is present does the configured semantic weight participate.
117
161
  function effectiveWeights(query) {
162
+ // Each optional signal zeroes its own weight when the caller supplied no scores for it, so the
163
+ // weighted sum AND its denominator are untouched and the output is byte-identical to the behaviour
164
+ // before that signal existed. The two conditions are independent.
165
+ let weights = query.weights;
118
166
  if (query.semanticById === undefined) {
119
- return { ...query.weights, semantic: 0 };
167
+ weights = { ...weights, semantic: 0 };
168
+ }
169
+ if (query.strengthById === undefined) {
170
+ weights = { ...weights, strength: 0 };
171
+ }
172
+ return weights;
173
+ }
174
+ // Reciprocal Rank Fusion constant (Cormack et al. 2009). 60 is the field-standard k; larger flattens
175
+ // the rank advantage, smaller sharpens it.
176
+ export const RRF_K = 60;
177
+ const SUBSCORE_KEYS = [
178
+ "relevance",
179
+ "recency",
180
+ "confidence",
181
+ "pinned",
182
+ "correction",
183
+ "graph",
184
+ "semantic",
185
+ "strength",
186
+ "importance",
187
+ ];
188
+ // Final subscores per memory: baseline + (when edges are supplied) the graph layer. The graph
189
+ // high-rank set is the WEIGHTED-SUM baseline top-N, so graph proximity is computed identically
190
+ // regardless of the final fusion mode (and the weighted-sum path stays byte-identical to before).
191
+ function computeFinalSubscores(memories, query, weights, options, recordById) {
192
+ const map = new Map();
193
+ for (const m of memories)
194
+ map.set(m.id, baselineSubscores(m, query));
195
+ if (options.edgesByMemory === undefined)
196
+ return map;
197
+ const baselineSorted = sortByRank(memories.map((m) => entryFor(m, requireEntry(map, m.id), weights)), recordById);
198
+ const highRankCount = options.graphHighRankCount ?? DEFAULT_GRAPH_HIGH_RANK_COUNT;
199
+ const highRankIds = new Set(baselineSorted.slice(0, highRankCount).map((e) => e.memoryId));
200
+ const edges = options.edgesByMemory;
201
+ for (const m of memories) {
202
+ const base = requireEntry(map, m.id);
203
+ map.set(m.id, { ...base, graph: graphProximityScore(m.id, edges, highRankIds) });
120
204
  }
121
- return query.weights;
205
+ return map;
206
+ }
207
+ // Reciprocal Rank Fusion (#204, O-F2): for each positive-weight signal, rank the memories by that
208
+ // subscore (desc, id tiebreak) and fuse score = Σ w/(RRF_K + rank). Rank-based, so heterogeneous
209
+ // score scales (Jaccard ~[0,0.3] vs cosine [0,1]) need no normalization, and agreement across signals
210
+ // compounds. The fused value is normalized to [0,1] (best possible = rank 1 in every signal) to
211
+ // honour the documented score range; ordering uses the shared (score desc, updatedAt desc, id asc) sort.
212
+ function rrfRank(memories, subscoresById, weights, recordById) {
213
+ const signals = SUBSCORE_KEYS.filter((k) => weights[k] > 0);
214
+ const firstSignal = signals[0];
215
+ if (firstSignal === undefined) {
216
+ return sortByRank(memories.map((m) => entryFor(m, requireEntry(subscoresById, m.id), weights)), recordById);
217
+ }
218
+ const rankBySignal = new Map();
219
+ for (const sig of signals) {
220
+ const ordered = [...memories].sort((a, b) => {
221
+ const av = requireEntry(subscoresById, a.id)[sig];
222
+ const bv = requireEntry(subscoresById, b.id)[sig];
223
+ if (av !== bv)
224
+ return bv - av;
225
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
226
+ });
227
+ const ranks = new Map();
228
+ ordered.forEach((m, i) => ranks.set(m.id, i + 1));
229
+ rankBySignal.set(sig, ranks);
230
+ }
231
+ const maxFused = signals.reduce((sum, sig) => sum + weights[sig] / (RRF_K + 1), 0);
232
+ const entries = memories.map((m) => {
233
+ let fused = 0;
234
+ let bestSig = firstSignal;
235
+ let bestContrib = -1;
236
+ for (const sig of signals) {
237
+ const rank = requireEntry(requireEntry(rankBySignal, sig), m.id);
238
+ const contrib = weights[sig] / (RRF_K + rank);
239
+ fused += contrib;
240
+ if (contrib > bestContrib) {
241
+ bestContrib = contrib;
242
+ bestSig = sig;
243
+ }
244
+ }
245
+ return {
246
+ memoryId: m.id,
247
+ score: maxFused > 0 ? fused / maxFused : 0,
248
+ subscores: requireEntry(subscoresById, m.id),
249
+ inclusionReason: inclusionReasonText(bestSig, bestContrib),
250
+ };
251
+ });
252
+ return sortByRank(entries, recordById);
122
253
  }
123
254
  export function rankMemories(memories, query, options = {}) {
124
255
  if (memories.length === 0)
@@ -127,21 +258,9 @@ export function rankMemories(memories, query, options = {}) {
127
258
  for (const m of memories)
128
259
  recordById.set(m.id, m);
129
260
  const weights = effectiveWeights(query);
130
- // Pass 1 baseline.
131
- const baseline = memories.map((m) => entryFor(m, baselineSubscores(m, query), weights));
132
- const baselineSorted = sortByRank(baseline, recordById);
133
- // No edges supplied → skip pass 2 entirely (cost saving + identical result).
134
- if (options.edgesByMemory === undefined)
135
- return baselineSorted;
136
- // Pass 2 — graph layer.
137
- const highRankCount = options.graphHighRankCount ?? DEFAULT_GRAPH_HIGH_RANK_COUNT;
138
- const highRankIds = new Set(baselineSorted.slice(0, highRankCount).map((e) => e.memoryId));
139
- const edges = options.edgesByMemory;
140
- const layered = memories.map((m) => {
141
- const base = baselineSubscores(m, query);
142
- const graph = graphProximityScore(m.id, edges, highRankIds);
143
- const subscores = { ...base, graph };
144
- return entryFor(m, subscores, weights);
145
- });
146
- return sortByRank(layered, recordById);
261
+ const subscoresById = computeFinalSubscores(memories, query, weights, options, recordById);
262
+ if (query.fusion === "rrf") {
263
+ return rrfRank(memories, subscoresById, weights, recordById);
264
+ }
265
+ return sortByRank(memories.map((m) => entryFor(m, requireEntry(subscoresById, m.id), weights)), recordById);
147
266
  }
@@ -1 +1 @@
1
- {"version":3,"file":"recency.d.ts","sourceRoot":"","sources":["../src/recency.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB,QAAiB,CAAC;AAGnD,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAOrE"}
1
+ {"version":3,"file":"recency.d.ts","sourceRoot":"","sources":["../src/recency.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB,QAAiB,CAAC;AAEnD,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIrE"}
@@ -7,17 +7,11 @@
7
7
  // runs the previous week; consolidation (#208) will collapse older records into semantic
8
8
  // facts whose recency continues to refresh on every update. The constant is exported so
9
9
  // callers (e.g. an audit dashboard) can reproduce the score deterministically.
10
+ import { exponentialDecay } from "./decay.js";
10
11
  const MS_PER_DAY = 86_400_000;
11
12
  export const RECENCY_HALF_LIFE_MS = 7 * MS_PER_DAY;
12
- const LN_2 = Math.LN2;
13
13
  export function recencyScore(updatedAt, nowMs) {
14
- const ageMs = nowMs - updatedAt;
15
- if (ageMs <= 0)
16
- return 1;
17
- const decay = Math.exp(-(LN_2 * ageMs) / RECENCY_HALF_LIFE_MS);
18
- if (decay < 0)
19
- return 0;
20
- if (decay > 1)
21
- return 1;
22
- return decay;
14
+ // Edit-recency: decays since the record was last UPDATED. (Reuse-recency, which decays since last
15
+ // ACCESS at a different half-life, lives in strength.ts — both share the kernel in decay.ts.)
16
+ return exponentialDecay(nowMs - updatedAt, RECENCY_HALF_LIFE_MS);
23
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"retrieve.d.ts","sourceRoot":"","sources":["../src/retrieve.ts"],"names":[],"mappings":"AAmCA,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAG3B,MAAM,YAAY,CAAC;AAwPpB,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,eAAe,GACpB,qBAAqB,CA8BvB"}
1
+ {"version":3,"file":"retrieve.d.ts","sourceRoot":"","sources":["../src/retrieve.ts"],"names":[],"mappings":"AAoCA,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAG3B,MAAM,YAAY,CAAC;AA0PpB,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,eAAe,GACpB,qBAAqB,CA0CvB"}
@@ -21,6 +21,7 @@
21
21
  // responses + identical request -> identical output. The cross-scope isolation test pins
22
22
  // this with a spy port that records every listByScope call.
23
23
  import { assembleContextBlock } from "./context.js";
24
+ import { DEFAULT_MMR_LAMBDA, reorderByMmr } from "./diversity.js";
24
25
  import { RetrievalError } from "./errors.js";
25
26
  import { tokenize } from "./relevance.js";
26
27
  import { rankMemories } from "./ranking.js";
@@ -50,6 +51,8 @@ function resolveWeights(request) {
50
51
  correction: request.correctionBoost ?? DEFAULT_RANKING_WEIGHTS.correction,
51
52
  graph: request.graphProximityBoost ?? DEFAULT_RANKING_WEIGHTS.graph,
52
53
  semantic: request.semanticWeight ?? DEFAULT_RANKING_WEIGHTS.semantic,
54
+ strength: request.strengthWeight ?? DEFAULT_RANKING_WEIGHTS.strength,
55
+ importance: request.importanceWeight ?? DEFAULT_RANKING_WEIGHTS.importance,
53
56
  };
54
57
  }
55
58
  function assertNonNegativeWeights(weights) {
@@ -231,10 +234,17 @@ export function retrieveMemoryContext(request, port) {
231
234
  weights: resolved.weights,
232
235
  ...(request.queryText === undefined ? {} : { queryText: request.queryText }),
233
236
  ...(request.semanticById === undefined ? {} : { semanticById: request.semanticById }),
237
+ ...(request.strengthById === undefined ? {} : { strengthById: request.strengthById }),
238
+ ...(request.fusion === undefined ? {} : { fusion: request.fusion }),
234
239
  };
235
240
  const ranked = rankMemories(filtered.candidates, rankQuery, edgesByMemory === undefined ? {} : { edgesByMemory });
236
241
  const thresholded = applyRelevanceFloor(ranked, request);
237
- const assembled = assembleContextBlock(thresholded.ranked, filtered.candidates, {
242
+ // MMR diversity (#204, O-F3): re-order the ranked candidates so near-duplicates do not all consume
243
+ // the token budget. Inert (byte-identical greedy-by-rank) when the caller supplies no embeddings.
244
+ const selectionOrder = request.embeddingById === undefined
245
+ ? thresholded.ranked
246
+ : reorderByMmr(thresholded.ranked, request.embeddingById, request.mmrLambda ?? DEFAULT_MMR_LAMBDA);
247
+ const assembled = assembleContextBlock(selectionOrder, filtered.candidates, {
238
248
  budgetTokens: resolved.budgetTokens,
239
249
  maxIncluded: resolved.maxIncluded,
240
250
  });
@@ -0,0 +1,9 @@
1
+ export declare const STRENGTH_HALF_LIFE_MS: number;
2
+ export declare const STRENGTH_FREQUENCY_SATURATION = 8;
3
+ export interface MemoryAccessStat {
4
+ readonly accessCount: number;
5
+ readonly lastAccessedAt: number;
6
+ }
7
+ export declare function reinforcementStrength(stat: MemoryAccessStat | undefined, nowMs: number): number;
8
+ export declare function buildStrengthById<K>(statsById: ReadonlyMap<K, MemoryAccessStat>, nowMs: number): ReadonlyMap<K, number>;
9
+ //# sourceMappingURL=strength.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strength.d.ts","sourceRoot":"","sources":["../src/strength.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAKrD,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAI/C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAGD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAW/F;AAID,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,SAAS,EAAE,WAAW,CAAC,CAAC,EAAE,gBAAgB,CAAC,EAC3C,KAAK,EAAE,MAAM,GACZ,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,CAOxB"}
@@ -0,0 +1,51 @@
1
+ // Reinforcement-strength primitive (#204 plasticity). Turns a memory's access history — how OFTEN
2
+ // and how RECENTLY it has been recalled — into a [0,1] re-ranking signal so a frequently-reused
3
+ // memory is surfaced ahead of a never-touched one. This realises the core plasticity promise ("a
4
+ // memory gets stronger when reused") at retrieval time; the maintenance pass already strengthens on
5
+ // a slower cadence, but ranking is where reuse must change what the user actually sees.
6
+ //
7
+ // Cognitive basis (ACT-R base-level activation, simplified): activation rises with practice
8
+ // frequency and decays with disuse. Two bounded, deterministic factors, multiplied:
9
+ // accessRecency = exp(-ln2 * (now - lastAccessedAt) / HALF_LIFE) disuse decay, 45-day half-life
10
+ // frequency = 1 - exp(-accessCount / SATURATION) saturating practice gain
11
+ // A NEVER-accessed memory scores 0 (no reinforcement yet) so this subscore only ever ADDS signal for
12
+ // genuine reuse and never perturbs a fresh memory's existing relevance/recency/confidence ranking.
13
+ //
14
+ // Pure: no clock (now is passed in), no IO, no randomness. Same inputs => same output, so the
15
+ // retrieval layer stays replay-stable and the deterministic eval can pin it.
16
+ import { exponentialDecay } from "./decay.js";
17
+ const MS_PER_DAY = 86_400_000;
18
+ // Disuse half-life. Matches the maintenance strength curve (keiko-memory-governance maintenance.ts)
19
+ // so "recency of use" decays at one consistent rate across ranking and the decay/forget cycle.
20
+ export const STRENGTH_HALF_LIFE_MS = 45 * MS_PER_DAY;
21
+ // Access count at which the frequency factor reaches ~0.63 of its ceiling. Logarithmic-feeling
22
+ // saturation: 1 recall ≈ 0.12, 8 ≈ 0.63, 24 ≈ 0.95 — heavy reuse keeps mattering with diminishing
23
+ // returns, matching the practice-curve intuition without an unbounded count term.
24
+ export const STRENGTH_FREQUENCY_SATURATION = 8;
25
+ // Reinforcement strength in [0,1]. `undefined` stat (memory never accessed) => 0.
26
+ export function reinforcementStrength(stat, nowMs) {
27
+ if (stat === undefined)
28
+ return 0;
29
+ // Reuse-recency: decays since last ACCESS (future-dated clamps to full recency). Shares the kernel
30
+ // in decay.ts with edit-recency (recency.ts), which decays since last UPDATE at a different half-life.
31
+ const accessRecency = exponentialDecay(nowMs - stat.lastAccessedAt, STRENGTH_HALF_LIFE_MS);
32
+ const count = stat.accessCount > 0 ? stat.accessCount : 0;
33
+ const frequency = 1 - Math.exp(-count / STRENGTH_FREQUENCY_SATURATION);
34
+ const strength = frequency * accessRecency;
35
+ if (strength < 0)
36
+ return 0;
37
+ if (strength > 1)
38
+ return 1;
39
+ return strength;
40
+ }
41
+ // Convenience: build the per-memory strength map the ranker consumes from a map of access stats.
42
+ // Lives here (next to the formula) so callers cannot drift from the canonical computation.
43
+ export function buildStrengthById(statsById, nowMs) {
44
+ const out = new Map();
45
+ for (const [id, stat] of statsById) {
46
+ const strength = reinforcementStrength(stat, nowMs);
47
+ if (strength > 0)
48
+ out.set(id, strength);
49
+ }
50
+ return out;
51
+ }
@@ -21,12 +21,15 @@ export interface RankingWeights {
21
21
  readonly correction: number;
22
22
  readonly graph: number;
23
23
  readonly semantic: number;
24
+ readonly strength: number;
25
+ readonly importance: number;
24
26
  }
25
27
  export declare const DEFAULT_RANKING_WEIGHTS: RankingWeights;
26
28
  export declare const DEFAULT_BUDGET_TOKENS = 1500;
27
29
  export declare const DEFAULT_MAX_INCLUDED = 12;
28
30
  export declare const DEFAULT_STALE_CONFIDENCE_THRESHOLD = 0.3;
29
31
  export declare const DEFAULT_LIST_BY_SCOPE_MAX_RESULTS = 500;
32
+ export type RankingFusionMode = "weighted-sum" | "rrf";
30
33
  export interface MemoryRetrievalRequest {
31
34
  readonly scopes: readonly MemoryScope[];
32
35
  readonly queryText?: string;
@@ -45,6 +48,12 @@ export interface MemoryRetrievalRequest {
45
48
  /** Audit/debug opt-in. Active context retrieval suppresses superseded memories by default. */
46
49
  readonly includeSuperseded?: boolean;
47
50
  readonly semanticById?: ReadonlyMap<MemoryId, number>;
51
+ readonly strengthById?: ReadonlyMap<MemoryId, number>;
52
+ readonly strengthWeight?: number;
53
+ readonly importanceWeight?: number;
54
+ readonly embeddingById?: ReadonlyMap<MemoryId, Float32Array>;
55
+ readonly mmrLambda?: number;
56
+ readonly fusion?: RankingFusionMode;
48
57
  }
49
58
  export interface MemoryContextBlockEntry {
50
59
  readonly memoryId: MemoryId;
@@ -71,6 +80,8 @@ export interface IncludedSubscores {
71
80
  readonly correction: number;
72
81
  readonly graph: number;
73
82
  readonly semantic: number;
83
+ readonly strength: number;
84
+ readonly importance: number;
74
85
  }
75
86
  export interface IncludedMemory {
76
87
  readonly memoryId: MemoryId;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACX,MAAM,sCAAsC,CAAC;AAO9C,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,YAAY,EAAE,CAAC;IACvF,wDAAwD;IACxD,iBAAiB,CAAC,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,UAAU,EAAE,CAAC;IAC9D,4BAA4B;IAC5B,iBAAiB,CAAC,CAAC,QAAQ,EAA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,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,MAAM,aAAa,GACrB,sBAAsB,GACtB,iBAAiB,GACjB,iBAAiB,GACjB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC"}
@@ -26,6 +26,13 @@ export const DEFAULT_RANKING_WEIGHTS = Object.freeze({
26
26
  correction: 0.1,
27
27
  graph: 0.15,
28
28
  semantic: 0.25,
29
+ // Reinforcement weight (#204). Sits between recency and semantic: reuse is a strong signal but must
30
+ // not override an explicit pin or a fresh correction. Only participates when the caller supplies
31
+ // per-memory strength scores; otherwise the ranker forces it to 0 (byte-identical legacy behaviour).
32
+ strength: 0.2,
33
+ // Source-authority importance weight (#204, O-F5). Default 0 (opt-in): always computed but inert
34
+ // until an operator sets a non-zero weight, so legacy ranking is byte-identical.
35
+ importance: 0,
29
36
  });
30
37
  export const DEFAULT_BUDGET_TOKENS = 1500;
31
38
  export const DEFAULT_MAX_INCLUDED = 12;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscharko-dev/keiko-memory-retrieval",
3
- "version": "0.2.0-beta.7",
3
+ "version": "0.2.0-beta.9",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",