@remnic/core 10.0.194 → 10.0.196

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 (323) hide show
  1. package/dist/access-admin-ops-surface.js +65 -66
  2. package/dist/access-cli.js +65 -66
  3. package/dist/access-cli.js.map +1 -1
  4. package/dist/access-coding-context-resolution.js +2 -2
  5. package/dist/access-extraction-force-flush-preempt.js +65 -66
  6. package/dist/access-extraction-force-flush.js +65 -66
  7. package/dist/access-http-briefing.js +65 -66
  8. package/dist/access-http-query.js +65 -66
  9. package/dist/access-http.js +65 -66
  10. package/dist/access-identity-continuity-surface.js +65 -66
  11. package/dist/access-lcm-surface.js +65 -66
  12. package/dist/access-mcp.d.ts.map +1 -1
  13. package/dist/access-mcp.js +65 -66
  14. package/dist/access-observe-write-category.js +2 -2
  15. package/dist/access-observe-write-surface.js +65 -66
  16. package/dist/access-operations-batch.js +65 -66
  17. package/dist/access-operations.js +65 -66
  18. package/dist/access-recall-concurrency.d.ts +4 -0
  19. package/dist/access-recall-concurrency.d.ts.map +1 -1
  20. package/dist/access-recall-concurrency.js +65 -66
  21. package/dist/access-recall-diagnostics.js +2 -2
  22. package/dist/access-recall-response.d.ts.map +1 -1
  23. package/dist/access-recall-response.js +65 -66
  24. package/dist/access-recall-surface.d.ts.map +1 -1
  25. package/dist/access-recall-surface.js +65 -66
  26. package/dist/access-schema.d.ts +1 -0
  27. package/dist/access-schema.d.ts.map +1 -1
  28. package/dist/access-schema.js +1 -1
  29. package/dist/access-service.d.ts.map +1 -1
  30. package/dist/access-service.js +65 -66
  31. package/dist/active-recall.js +7 -6
  32. package/dist/active-recall.js.map +1 -1
  33. package/dist/{auto-sync-BJUAGKI5.js → auto-sync-BEW65FDT.js} +6 -5
  34. package/dist/{auto-sync-BJUAGKI5.js.map → auto-sync-BEW65FDT.js.map} +1 -1
  35. package/dist/briefing.js +7 -6
  36. package/dist/buffer.d.ts +1 -0
  37. package/dist/buffer.d.ts.map +1 -1
  38. package/dist/buffer.js +3 -3
  39. package/dist/calibration.js +5 -4
  40. package/dist/calibration.js.map +1 -1
  41. package/dist/causal-consolidation.js +8 -7
  42. package/dist/causal-consolidation.js.map +1 -1
  43. package/dist/{chunk-FZU62GIV.js → chunk-2X5I5C3M.js} +27 -10
  44. package/dist/chunk-2X5I5C3M.js.map +1 -0
  45. package/dist/{chunk-F2MVWUNF.js → chunk-374E2HYZ.js} +10 -2
  46. package/dist/chunk-374E2HYZ.js.map +1 -0
  47. package/dist/{chunk-3ZS3NUEI.js → chunk-3DSLTUK6.js} +2 -2
  48. package/dist/{chunk-DYUPSTCV.js → chunk-3EXG2KPK.js} +3 -3
  49. package/dist/{chunk-FGFU6J26.js → chunk-4FTYKZ77.js} +3 -3
  50. package/dist/{chunk-QIPRDRGM.js → chunk-4HEJDVPU.js} +1 -1
  51. package/dist/chunk-4HEJDVPU.js.map +1 -0
  52. package/dist/{chunk-EEA2RM4B.js → chunk-4I6A3SDL.js} +2 -2
  53. package/dist/{chunk-SKJM4PKE.js → chunk-4JI5PPFW.js} +2 -2
  54. package/dist/{chunk-TDG5NZAZ.js → chunk-65JA7LWV.js} +2 -2
  55. package/dist/{chunk-3YID7KZ6.js → chunk-6QMKUWXH.js} +2 -2
  56. package/dist/{chunk-7SOKOEAZ.js → chunk-6RRHTHKQ.js} +2 -2
  57. package/dist/{chunk-VHQNJW4Q.js → chunk-6W62D4MC.js} +2 -2
  58. package/dist/{chunk-CRS2NY44.js → chunk-7O6H7BPW.js} +2 -2
  59. package/dist/{chunk-VSLV3EEP.js → chunk-7TK5Q6LQ.js} +112 -81
  60. package/dist/chunk-7TK5Q6LQ.js.map +1 -0
  61. package/dist/{chunk-NN3LMWKA.js → chunk-7TQ3EDQ3.js} +1 -1
  62. package/dist/chunk-7TQ3EDQ3.js.map +1 -0
  63. package/dist/{chunk-KJ65WZHB.js → chunk-A7DIZOTF.js} +2 -2
  64. package/dist/{chunk-TZ7ZA2LM.js → chunk-AD3JOG2Q.js} +2 -2
  65. package/dist/{chunk-2QW5HPKU.js → chunk-AUDLHIHI.js} +35 -28
  66. package/dist/chunk-AUDLHIHI.js.map +1 -0
  67. package/dist/{chunk-BDFSVUUZ.js → chunk-C3H2QZOZ.js} +2 -1
  68. package/dist/chunk-C3H2QZOZ.js.map +1 -0
  69. package/dist/{chunk-7EP4FURO.js → chunk-C72YQM7E.js} +2 -2
  70. package/dist/{chunk-4EAVEDLG.js → chunk-CRKT2JXN.js} +9 -9
  71. package/dist/{chunk-CJSTQNE5.js → chunk-CTOMDCCA.js} +2 -2
  72. package/dist/{chunk-PSQ347YP.js → chunk-DSKII2W4.js} +3 -3
  73. package/dist/{chunk-KOVQZJ27.js → chunk-E7LDTUWK.js} +2 -2
  74. package/dist/{chunk-SPAKBUJY.js → chunk-EWLMEYLF.js} +2 -2
  75. package/dist/{chunk-JJ42IDJU.js → chunk-FEGQI5KR.js} +2 -2
  76. package/dist/{chunk-3BICT225.js → chunk-FGNBUUPX.js} +2 -2
  77. package/dist/{chunk-QZMGZBTF.js → chunk-HBG6CQEX.js} +2 -2
  78. package/dist/{chunk-7V6GNQC2.js → chunk-HINQENZG.js} +2 -2
  79. package/dist/{chunk-WRVKI6ZO.js → chunk-HLQXSX4F.js} +2 -2
  80. package/dist/{chunk-KQIOW3TG.js → chunk-HUDE2SQA.js} +2 -2
  81. package/dist/{chunk-T765HQ5U.js → chunk-IIDAN7XJ.js} +2 -2
  82. package/dist/{chunk-M7Q7Z6V5.js → chunk-JDZ5JPYG.js} +38 -8
  83. package/dist/chunk-JDZ5JPYG.js.map +1 -0
  84. package/dist/{chunk-VMNX2UV7.js → chunk-JRUOIEFL.js} +5 -5
  85. package/dist/{chunk-JKMIGCK6.js → chunk-KDGEEZOI.js} +3 -2
  86. package/dist/chunk-KDGEEZOI.js.map +1 -0
  87. package/dist/{chunk-MMRTPH3J.js → chunk-KQYGUFMQ.js} +5 -3
  88. package/dist/chunk-KQYGUFMQ.js.map +1 -0
  89. package/dist/{chunk-TWYYUMYO.js → chunk-KXAGZRJV.js} +2 -2
  90. package/dist/{chunk-JITK24KX.js → chunk-LJNCJK7B.js} +10 -10
  91. package/dist/{chunk-Z6EFSXU3.js → chunk-LMM2LRVQ.js} +2 -2
  92. package/dist/{chunk-V65H7MI6.js → chunk-M42UFQZY.js} +51 -4
  93. package/dist/chunk-M42UFQZY.js.map +1 -0
  94. package/dist/{chunk-KZ4BJRGQ.js → chunk-ODGVLSCQ.js} +2 -2
  95. package/dist/{chunk-AALJHIKH.js → chunk-OHJ5PNYB.js} +3 -3
  96. package/dist/{chunk-XZMQLON4.js → chunk-OK726OF4.js} +7 -5
  97. package/dist/chunk-OK726OF4.js.map +1 -0
  98. package/dist/{chunk-Q6S67LHR.js → chunk-OOMFFMX3.js} +2 -2
  99. package/dist/{chunk-YCJJODER.js → chunk-PNDTRIOI.js} +10 -3
  100. package/dist/chunk-PNDTRIOI.js.map +1 -0
  101. package/dist/{chunk-3RZ4GDOH.js → chunk-PX4AMRAN.js} +93 -23
  102. package/dist/chunk-PX4AMRAN.js.map +1 -0
  103. package/dist/{chunk-JNDMIAJ4.js → chunk-QEVZKJM6.js} +2 -2
  104. package/dist/{chunk-ZNCCX7P6.js → chunk-QO5QZR2U.js} +2 -2
  105. package/dist/{chunk-NFQKIZK3.js → chunk-QXEF66SC.js} +2 -2
  106. package/dist/{chunk-NKHRIDYP.js → chunk-RTXW6E6X.js} +3 -3
  107. package/dist/{chunk-5WDUY2ZZ.js → chunk-S4QWAWR6.js} +4 -4
  108. package/dist/{chunk-HEJFE3BC.js → chunk-SJCN7ESG.js} +2 -2
  109. package/dist/{chunk-AJ7JHHRY.js → chunk-SPPWVMP4.js} +2 -2
  110. package/dist/{chunk-QSF5SJAM.js → chunk-STQNKDKZ.js} +9 -3
  111. package/dist/chunk-STQNKDKZ.js.map +1 -0
  112. package/dist/{chunk-QFKNIKUF.js → chunk-SXR7L57Z.js} +2 -2
  113. package/dist/{chunk-GYCUX3N4.js → chunk-TGMIJABS.js} +2 -2
  114. package/dist/{chunk-GH7IKABD.js → chunk-UFJJMQDV.js} +2 -2
  115. package/dist/{chunk-FKHXXL42.js → chunk-VAE6QCZQ.js} +2 -2
  116. package/dist/{chunk-UH2VY2QQ.js → chunk-WCW7I7ZM.js} +2 -2
  117. package/dist/{chunk-5GIYIYJI.js → chunk-WLP3XJCO.js} +2 -2
  118. package/dist/{chunk-STSORBX5.js → chunk-XII23FXP.js} +1 -1
  119. package/dist/chunk-XII23FXP.js.map +1 -0
  120. package/dist/{chunk-LR6LWX33.js → chunk-XXDIPAUE.js} +2 -2
  121. package/dist/{chunk-G2MS56KM.js → chunk-YQUGYQRY.js} +2 -2
  122. package/dist/{chunk-WEI6HEUX.js → chunk-YXAH5TSN.js} +2 -2
  123. package/dist/{chunk-75K6DRPN.js → chunk-ZAVFAGBE.js} +2 -2
  124. package/dist/{chunk-7KTORRIK.js → chunk-ZNJU3NBJ.js} +2 -2
  125. package/dist/cli.js +65 -66
  126. package/dist/coding/export-okf-codegraph.js +9 -8
  127. package/dist/coding/export-okf-codegraph.js.map +1 -1
  128. package/dist/compounding/engine.js +8 -7
  129. package/dist/config.d.ts.map +1 -1
  130. package/dist/config.js +7 -6
  131. package/dist/connectors/codex-materialize-runner.js +7 -6
  132. package/dist/connectors/index.js +7 -6
  133. package/dist/convergence-refresh.js +9 -8
  134. package/dist/corpus-watermark.js +9 -8
  135. package/dist/deep-recall-http-glue.js +2 -2
  136. package/dist/deep-recall-policy-llm.js +4 -3
  137. package/dist/entity-retrieval.js +7 -6
  138. package/dist/eval-trajectory-store.js +2 -2
  139. package/dist/eval-trajectory.js +2 -2
  140. package/dist/evals.d.ts.map +1 -1
  141. package/dist/evals.js +1 -1
  142. package/dist/explicit-capture.js +65 -66
  143. package/dist/extraction-error-classification.d.ts +40 -5
  144. package/dist/extraction-error-classification.d.ts.map +1 -1
  145. package/dist/extraction-error-classification.js +5 -2
  146. package/dist/extraction-faithfulness.js +4 -3
  147. package/dist/extraction-judge.js +4 -3
  148. package/dist/extraction.d.ts.map +1 -1
  149. package/dist/extraction.js +17 -18
  150. package/dist/fallback-llm-codex-subscription.d.ts +3 -1
  151. package/dist/fallback-llm-codex-subscription.d.ts.map +1 -1
  152. package/dist/fallback-llm-codex-subscription.js +2 -1
  153. package/dist/fallback-llm.d.ts.map +1 -1
  154. package/dist/fallback-llm.js +3 -2
  155. package/dist/harmonic-retrieval.js +7 -6
  156. package/dist/index.js +65 -66
  157. package/dist/live-connectors-runner.js +1 -2
  158. package/dist/local-llm-helpers.d.ts +1 -0
  159. package/dist/local-llm-helpers.d.ts.map +1 -1
  160. package/dist/local-llm-helpers.js +1 -1
  161. package/dist/local-llm.d.ts.map +1 -1
  162. package/dist/local-llm.js +4 -3
  163. package/dist/location/index.js +8 -7
  164. package/dist/maintenance/memory-governance.js +7 -6
  165. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +7 -6
  166. package/dist/maintenance/rebuild-memory-projection-runner.js +9 -8
  167. package/dist/maintenance/rebuild-memory-projection.js +8 -7
  168. package/dist/memory-browse.js +3 -3
  169. package/dist/namespaces/migrate.js +8 -7
  170. package/dist/namespaces/storage.js +7 -6
  171. package/dist/operator-doctor-corpus.js +10 -9
  172. package/dist/operator-toolkit.js +15 -14
  173. package/dist/orchestration/backlog-scheduler.js +66 -67
  174. package/dist/orchestration/backlog-scheduler.js.map +1 -1
  175. package/dist/orchestration/buffer-drain-runner.js +66 -67
  176. package/dist/orchestration/extraction-drain.d.ts +1 -0
  177. package/dist/orchestration/extraction-drain.d.ts.map +1 -1
  178. package/dist/orchestration/extraction-run-helpers.d.ts +41 -4
  179. package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -1
  180. package/dist/orchestration/extraction-run.d.ts +4 -0
  181. package/dist/orchestration/extraction-run.d.ts.map +1 -1
  182. package/dist/orchestration/maintenance.js +17 -16
  183. package/dist/orchestration/orchestrator-helpers.d.ts +2 -0
  184. package/dist/orchestration/orchestrator-helpers.d.ts.map +1 -1
  185. package/dist/orchestration/recall-entry.d.ts +2 -2
  186. package/dist/orchestration/recall-entry.d.ts.map +1 -1
  187. package/dist/orchestration/recall-internal.d.ts.map +1 -1
  188. package/dist/orchestrator.d.ts.map +1 -1
  189. package/dist/orchestrator.js +65 -66
  190. package/dist/recall-explain-renderer.js +3 -3
  191. package/dist/recall-navigate-access.js +2 -2
  192. package/dist/recall-navigate-disclosure.js +2 -2
  193. package/dist/recall-navigate.js +2 -2
  194. package/dist/recall-navigation.js +65 -66
  195. package/dist/recall-planner-llm.js +3 -2
  196. package/dist/recall-planner-llm.js.map +1 -1
  197. package/dist/recall-state-view-admission.js +3 -3
  198. package/dist/recall-why-service.js +3 -3
  199. package/dist/recall-xray-cli.js +4 -4
  200. package/dist/recall-xray-renderer.js +3 -3
  201. package/dist/recall-xray.js +2 -2
  202. package/dist/resume-bundles.js +8 -7
  203. package/dist/semantic-consolidation.js +8 -7
  204. package/dist/semantic-rule-promotion.js +7 -6
  205. package/dist/semantic-rule-verifier.js +7 -6
  206. package/dist/source-agent-qualifier.js +10 -9
  207. package/dist/standup/build.js +7 -6
  208. package/dist/storage.d.ts.map +1 -1
  209. package/dist/storage.js +6 -5
  210. package/dist/summarizer.js +6 -5
  211. package/dist/support-passport/index.js +6 -5
  212. package/dist/transfer/export-okf.js +7 -6
  213. package/dist/types-extraction-failure.d.ts +7 -1
  214. package/dist/types-extraction-failure.d.ts.map +1 -1
  215. package/dist/types.d.ts +6 -6
  216. package/dist/types.d.ts.map +1 -1
  217. package/dist/types.js +1 -1
  218. package/dist/verified-recall.js +7 -6
  219. package/dist/who-knows-cli.js +8 -7
  220. package/dist/who-knows.js +7 -6
  221. package/package.json +2 -2
  222. package/src/access-mcp.ts +8 -0
  223. package/src/access-recall-concurrency.ts +35 -2
  224. package/src/access-recall-response.ts +3 -1
  225. package/src/access-recall-surface.ts +1 -0
  226. package/src/access-schema.ts +8 -0
  227. package/src/access-service-recall-concurrency.test.ts +65 -0
  228. package/src/access-service.ts +4 -3
  229. package/src/buffer-incremental-persistence.test.ts +23 -0
  230. package/src/buffer.ts +30 -28
  231. package/src/config.ts +2 -0
  232. package/src/evals.ts +6 -6
  233. package/src/extraction-error-classification.ts +88 -8
  234. package/src/extraction-local-failure-class.test.ts +117 -3
  235. package/src/extraction-reply-diagnostic-wiring.test.ts +3 -1
  236. package/src/extraction.test.ts +73 -3
  237. package/src/extraction.ts +26 -25
  238. package/src/fallback-llm-codex-subscription.ts +17 -3
  239. package/src/fallback-llm.test.ts +70 -0
  240. package/src/fallback-llm.ts +17 -18
  241. package/src/local-llm-headers-timeout.test.ts +151 -0
  242. package/src/local-llm-helpers.ts +1 -1
  243. package/src/local-llm.ts +44 -43
  244. package/src/orchestration/extraction-drain.ts +11 -5
  245. package/src/orchestration/extraction-run-helpers.ts +110 -4
  246. package/src/orchestration/extraction-run.test.ts +408 -3
  247. package/src/orchestration/extraction-run.ts +75 -75
  248. package/src/orchestration/orchestrator-helpers.ts +2 -0
  249. package/src/orchestration/recall-entry.ts +7 -7
  250. package/src/orchestration/recall-internal.ts +14 -4
  251. package/src/orchestrator.ts +3 -2
  252. package/src/recall-client-deadline-trace.test.ts +209 -0
  253. package/src/storage.ts +5 -4
  254. package/src/types-extraction-failure.ts +12 -1
  255. package/src/types.ts +6 -6
  256. package/dist/chunk-2QW5HPKU.js.map +0 -1
  257. package/dist/chunk-3RZ4GDOH.js.map +0 -1
  258. package/dist/chunk-BDFSVUUZ.js.map +0 -1
  259. package/dist/chunk-C7SRUWBW.js +0 -54
  260. package/dist/chunk-C7SRUWBW.js.map +0 -1
  261. package/dist/chunk-F2MVWUNF.js.map +0 -1
  262. package/dist/chunk-FZU62GIV.js.map +0 -1
  263. package/dist/chunk-JKMIGCK6.js.map +0 -1
  264. package/dist/chunk-M7Q7Z6V5.js.map +0 -1
  265. package/dist/chunk-MMRTPH3J.js.map +0 -1
  266. package/dist/chunk-NN3LMWKA.js.map +0 -1
  267. package/dist/chunk-QIPRDRGM.js.map +0 -1
  268. package/dist/chunk-QSF5SJAM.js.map +0 -1
  269. package/dist/chunk-STSORBX5.js.map +0 -1
  270. package/dist/chunk-V65H7MI6.js.map +0 -1
  271. package/dist/chunk-VSLV3EEP.js.map +0 -1
  272. package/dist/chunk-XZMQLON4.js.map +0 -1
  273. package/dist/chunk-YCJJODER.js.map +0 -1
  274. /package/dist/{chunk-3ZS3NUEI.js.map → chunk-3DSLTUK6.js.map} +0 -0
  275. /package/dist/{chunk-DYUPSTCV.js.map → chunk-3EXG2KPK.js.map} +0 -0
  276. /package/dist/{chunk-FGFU6J26.js.map → chunk-4FTYKZ77.js.map} +0 -0
  277. /package/dist/{chunk-EEA2RM4B.js.map → chunk-4I6A3SDL.js.map} +0 -0
  278. /package/dist/{chunk-SKJM4PKE.js.map → chunk-4JI5PPFW.js.map} +0 -0
  279. /package/dist/{chunk-TDG5NZAZ.js.map → chunk-65JA7LWV.js.map} +0 -0
  280. /package/dist/{chunk-3YID7KZ6.js.map → chunk-6QMKUWXH.js.map} +0 -0
  281. /package/dist/{chunk-7SOKOEAZ.js.map → chunk-6RRHTHKQ.js.map} +0 -0
  282. /package/dist/{chunk-VHQNJW4Q.js.map → chunk-6W62D4MC.js.map} +0 -0
  283. /package/dist/{chunk-CRS2NY44.js.map → chunk-7O6H7BPW.js.map} +0 -0
  284. /package/dist/{chunk-KJ65WZHB.js.map → chunk-A7DIZOTF.js.map} +0 -0
  285. /package/dist/{chunk-TZ7ZA2LM.js.map → chunk-AD3JOG2Q.js.map} +0 -0
  286. /package/dist/{chunk-7EP4FURO.js.map → chunk-C72YQM7E.js.map} +0 -0
  287. /package/dist/{chunk-4EAVEDLG.js.map → chunk-CRKT2JXN.js.map} +0 -0
  288. /package/dist/{chunk-CJSTQNE5.js.map → chunk-CTOMDCCA.js.map} +0 -0
  289. /package/dist/{chunk-PSQ347YP.js.map → chunk-DSKII2W4.js.map} +0 -0
  290. /package/dist/{chunk-KOVQZJ27.js.map → chunk-E7LDTUWK.js.map} +0 -0
  291. /package/dist/{chunk-SPAKBUJY.js.map → chunk-EWLMEYLF.js.map} +0 -0
  292. /package/dist/{chunk-JJ42IDJU.js.map → chunk-FEGQI5KR.js.map} +0 -0
  293. /package/dist/{chunk-3BICT225.js.map → chunk-FGNBUUPX.js.map} +0 -0
  294. /package/dist/{chunk-QZMGZBTF.js.map → chunk-HBG6CQEX.js.map} +0 -0
  295. /package/dist/{chunk-7V6GNQC2.js.map → chunk-HINQENZG.js.map} +0 -0
  296. /package/dist/{chunk-WRVKI6ZO.js.map → chunk-HLQXSX4F.js.map} +0 -0
  297. /package/dist/{chunk-KQIOW3TG.js.map → chunk-HUDE2SQA.js.map} +0 -0
  298. /package/dist/{chunk-T765HQ5U.js.map → chunk-IIDAN7XJ.js.map} +0 -0
  299. /package/dist/{chunk-VMNX2UV7.js.map → chunk-JRUOIEFL.js.map} +0 -0
  300. /package/dist/{chunk-TWYYUMYO.js.map → chunk-KXAGZRJV.js.map} +0 -0
  301. /package/dist/{chunk-JITK24KX.js.map → chunk-LJNCJK7B.js.map} +0 -0
  302. /package/dist/{chunk-Z6EFSXU3.js.map → chunk-LMM2LRVQ.js.map} +0 -0
  303. /package/dist/{chunk-KZ4BJRGQ.js.map → chunk-ODGVLSCQ.js.map} +0 -0
  304. /package/dist/{chunk-AALJHIKH.js.map → chunk-OHJ5PNYB.js.map} +0 -0
  305. /package/dist/{chunk-Q6S67LHR.js.map → chunk-OOMFFMX3.js.map} +0 -0
  306. /package/dist/{chunk-JNDMIAJ4.js.map → chunk-QEVZKJM6.js.map} +0 -0
  307. /package/dist/{chunk-ZNCCX7P6.js.map → chunk-QO5QZR2U.js.map} +0 -0
  308. /package/dist/{chunk-NFQKIZK3.js.map → chunk-QXEF66SC.js.map} +0 -0
  309. /package/dist/{chunk-NKHRIDYP.js.map → chunk-RTXW6E6X.js.map} +0 -0
  310. /package/dist/{chunk-5WDUY2ZZ.js.map → chunk-S4QWAWR6.js.map} +0 -0
  311. /package/dist/{chunk-HEJFE3BC.js.map → chunk-SJCN7ESG.js.map} +0 -0
  312. /package/dist/{chunk-AJ7JHHRY.js.map → chunk-SPPWVMP4.js.map} +0 -0
  313. /package/dist/{chunk-QFKNIKUF.js.map → chunk-SXR7L57Z.js.map} +0 -0
  314. /package/dist/{chunk-GYCUX3N4.js.map → chunk-TGMIJABS.js.map} +0 -0
  315. /package/dist/{chunk-GH7IKABD.js.map → chunk-UFJJMQDV.js.map} +0 -0
  316. /package/dist/{chunk-FKHXXL42.js.map → chunk-VAE6QCZQ.js.map} +0 -0
  317. /package/dist/{chunk-UH2VY2QQ.js.map → chunk-WCW7I7ZM.js.map} +0 -0
  318. /package/dist/{chunk-5GIYIYJI.js.map → chunk-WLP3XJCO.js.map} +0 -0
  319. /package/dist/{chunk-LR6LWX33.js.map → chunk-XXDIPAUE.js.map} +0 -0
  320. /package/dist/{chunk-G2MS56KM.js.map → chunk-YQUGYQRY.js.map} +0 -0
  321. /package/dist/{chunk-WEI6HEUX.js.map → chunk-YXAH5TSN.js.map} +0 -0
  322. /package/dist/{chunk-75K6DRPN.js.map → chunk-ZAVFAGBE.js.map} +0 -0
  323. /package/dist/{chunk-7KTORRIK.js.map → chunk-ZNJU3NBJ.js.map} +0 -0
package/src/local-llm.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { log } from "./logger.js";
2
+ import { isParameterConfigRejection } from "./extraction-error-classification.js";
2
3
  import { isUnsupportedJsonSchemaError } from "./fallback-llm-codex-subscription.js";
3
4
  import { estimateTokenCount } from "./token-estimate.js";
4
5
  import type { PluginConfig } from "./types.js";
@@ -525,8 +526,7 @@ export class LocalLlmClient {
525
526
  */
526
527
  private getContextFromLmsCli(modelId: string): number | null {
527
528
  try {
528
- // Check if lms CLI exists in common locations.
529
- // HOME may be absent in launchd environments, so prefer the resolved helper.
529
+ // Prefer the resolved helper: HOME may be absent in launchd environments.
530
530
  const homeDir = this.resolveHomeDir();
531
531
  const lmsPaths = [
532
532
  this.config.localLmsCliPath || "",
@@ -541,8 +541,7 @@ export class LocalLlmClient {
541
541
  return null;
542
542
  }
543
543
 
544
- // Run lms ps --json to get loaded models with context
545
- // Use spawnSync with shell and explicit PATH to ensure lms can find its dependencies
544
+ // Run `lms ps --json` for loaded models; explicit PATH so lms finds its deps
546
545
  log.debug(`LMS CLI: running: ${lmsPath} ps --json`);
547
546
  const existingPath = readEnvVar("PATH") || "";
548
547
  const result = launchProcessSync(lmsPath, ["ps", "--json"], {
@@ -902,23 +901,12 @@ export class LocalLlmClient {
902
901
  };
903
902
  this.nativeSchemaGate.attach(requestBody, options, requestModel);
904
903
 
905
- // Suppress thinking/reasoning for operations that benefit from terse,
906
- // structured output. Thinking-capable models (Qwen 3.5, Gemma 4,
907
- // DeepSeek) default to thinking-on via their chat template; sending
908
- // `chat_template_kwargs: { enable_thinking: false }` tells the template
909
- // to skip reasoning tokens. Consolidation operations on the main client
910
- // intentionally keep thinking enabled so entity resolution and
911
- // deduplication can use the model's reasoning path. Fast-tier callers can
912
- // still force suppression per request to preserve their low-latency
913
- // contract.
914
- //
915
- // Gate the injection on detected backend support (issue #548,
916
- // Codex P1 on PR #550): `chat_template_kwargs` is an LM Studio /
917
- // vLLM / llama.cpp extension, not part of standard OpenAI chat
918
- // completions. Strict OpenAI-compatible backends reject
919
- // unknown fields with 400, which trips the 400-cooldown path and
920
- // can effectively disable local extraction. Fail open when the
921
- // backend hasn't been positively identified as thinking-capable.
904
+ // Suppress thinking for operations that benefit from terse output:
905
+ // thinking-capable models default to thinking-on; `chat_template_kwargs:
906
+ // { enable_thinking: false }` skips it. Consolidation keeps thinking on;
907
+ // fast-tier callers can force suppression. Gate on detected backend
908
+ // support (issue #548): strict OpenAI backends reject the extension with
909
+ // 400 — fail open when unidentified.
922
910
  const shouldSuppressThinking =
923
911
  options.forceDisableThinking === true ||
924
912
  ((options.disableThinking ?? this._disableThinking) &&
@@ -930,15 +918,11 @@ export class LocalLlmClient {
930
918
  ) {
931
919
  requestBody.chat_template_kwargs = { enable_thinking: false };
932
920
  } else if (shouldSuppressThinking && this.detectedType === "ollama") {
933
- // Ollama's /v1 endpoint silently drops `chat_template_kwargs` AND
934
- // `enable_thinking` — the ONLY field it maps to think-off is
935
- // `reasoning_effort` ("none" → ThinkValue{false} in openai.go;
936
- // verified against Ollama 0.32.0 source and live probes,
937
- // issue #1996). Without this, thinking-capable models (Gemma 4,
938
- // Qwen 3.5+) burn 1,700-2,000 reasoning tokens per extraction on
939
- // Ollama, exceed the client timeout, and retry forever. The effort
940
- // is configurable via `localLlmReasoningEffort` (default "none");
941
- // an empty value disables injection (pre-#1996 behavior).
921
+ // Ollama's /v1 endpoint silently drops `chat_template_kwargs` and
922
+ // `enable_thinking` — only `reasoning_effort` maps to think-off (issue
923
+ // #1996). Without it thinking models burn reasoning tokens per
924
+ // extraction and retry forever. Empty `localLlmReasoningEffort`
925
+ // disables injection (pre-#1996).
942
926
  const effort = this.config.localLlmReasoningEffort;
943
927
  if (effort) {
944
928
  requestBody.reasoning_effort = effort;
@@ -956,11 +940,10 @@ export class LocalLlmClient {
956
940
  // (issue #2148 root cause); the sizing lives with the transport budgets.
957
941
  const { effectiveTimeoutMs, transportBudgetMs } = routeBudgets(operation, this.config.localLlmTimeoutMs, options.timeoutMs);
958
942
  const maxAttempts = 1 + Math.max(0, this.config.localLlmRetry5xxCount);
959
- // COS-447: rate-limit responses (429/503/408, LiteLLM cooldown) get
960
- // their own retry budget with exponential full-jitter backoff, and a
961
- // process-wide semaphore caps concurrent HTTP attempts across clients.
962
- // Waits are bounded by the request timeout so a short caller budget
963
- // (e.g. rerankTimeoutMs) is never stretched by a long cooldown.
943
+ // COS-447: rate-limit responses (429/503/408, LiteLLM cooldown) get their
944
+ // own retry budget with exponential full-jitter backoff, and a process-wide
945
+ // semaphore caps concurrent HTTP attempts. Waits stay bounded by the
946
+ // request timeout so a short caller budget is never stretched.
964
947
  const rateLimit = new LocalLlmRateLimitSession(
965
948
  formatLocalLlmPoolKey(chatUrl, operation),
966
949
  resolveRateLimitSettings(this.config),
@@ -979,8 +962,10 @@ export class LocalLlmClient {
979
962
  log.warn(gate.reason === "queue"
980
963
  ? `local LLM concurrency queue exceeded the ${effectiveTimeoutMs}ms request budget; skipping request (op=${operation})`
981
964
  : `local LLM rate-limit backoff active (${gate.remainingMs}ms remaining); skipping request (op=${operation})`);
982
- if (options.failureDiag)
965
+ if (options.failureDiag) {
983
966
  options.failureDiag.lastError = Object.assign(new Error("local LLM rate limited"), { status: 429 });
967
+ options.failureDiag.sawTransientAttempt = true;
968
+ }
984
969
  return null;
985
970
  }
986
971
  if (gate.kind === "aborted") return null;
@@ -1032,8 +1017,12 @@ export class LocalLlmClient {
1032
1017
  log.debug(`local LLM failed to read ${response.status} response body: ${options.redactProviderErrors ? "details redacted" : error.message}`);
1033
1018
  } else {
1034
1019
  response = null;
1035
- if (!isAbortError(err)) throw err;
1020
+ if (!isAbortError(err)) {
1021
+ if (options.failureDiag) options.failureDiag.sawTransientAttempt = true;
1022
+ throw err;
1023
+ }
1036
1024
  lastAbortError = error;
1025
+ if (options.failureDiag) options.failureDiag.sawTransientAttempt = true;
1037
1026
  if (attempt >= maxAttempts) break;
1038
1027
  const backoffMs = this.config.localLlmRetryBackoffMs * attempt;
1039
1028
  log.warn(
@@ -1052,6 +1041,9 @@ export class LocalLlmClient {
1052
1041
  rateLimit.onSuccess();
1053
1042
  break;
1054
1043
  }
1044
+ // A transient attempt stays evidence even when a later attempt fails terminally (#3757).
1045
+ if (options.failureDiag && (response.status === 408 || response.status === 429 || response.status >= 500))
1046
+ options.failureDiag.sawTransientAttempt = true;
1055
1047
  if (response.status >= 500 && attempt < maxAttempts) {
1056
1048
  const nonRecoverableReason = extractNonRecoverableBackendReasonFromErrorText(responseBody);
1057
1049
  if (nonRecoverableReason) {
@@ -1103,9 +1095,14 @@ export class LocalLlmClient {
1103
1095
  if (lastRateLimitDelayMs !== null)
1104
1096
  log.warn(`local LLM rate-limit retries exhausted: op=${operation} retries=${rateLimit.retryCount} nextBackoffMs=${lastRateLimitDelayMs}`);
1105
1097
  let reason = "";
1098
+ let providerMessage: string | undefined;
1099
+ let providerCode: string | undefined;
1106
1100
  try {
1107
- const parsed = JSON.parse(responseBody) as { error?: { message?: string } };
1108
- reason = parsed?.error?.message ? ` — ${parsed.error.message}` : "";
1101
+ // SAFETY: OpenAI-compatible error envelope; optional fields read defensively.
1102
+ const parsed = JSON.parse(responseBody) as { error?: { message?: string; code?: unknown } };
1103
+ providerMessage = parsed?.error?.message;
1104
+ providerCode = parsed?.error?.code === undefined ? undefined : String(parsed.error.code);
1105
+ reason = providerMessage ? ` — ${providerMessage}` : "";
1109
1106
  } catch {
1110
1107
  if (!options.redactProviderErrors) log.debug(`local LLM error body: ${responseBody.slice(0, 500)}`);
1111
1108
  }
@@ -1139,10 +1136,14 @@ export class LocalLlmClient {
1139
1136
  } else {
1140
1137
  this.consecutive400s = 0;
1141
1138
  }
1142
- if (options.failureDiag)
1143
- options.failureDiag.lastError = Object.assign(new Error("local LLM http failure"), {
1144
- status: response.status,
1145
- });
1139
+ if (options.failureDiag) {
1140
+ const lastError = Object.assign(new Error("local LLM http failure"), { status: response.status });
1141
+ // Tag a parameter-refusing rejection so classification parks the
1142
+ // window as a config failure; sanitized — no provider text (#3757).
1143
+ if (isParameterConfigRejection({ code: providerCode, message: providerMessage }))
1144
+ Object.assign(lastError, { code: "unsupported_parameter" });
1145
+ options.failureDiag.lastError = lastError;
1146
+ }
1146
1147
  return null;
1147
1148
  }
1148
1149
  this.consecutive400s = 0;
@@ -110,8 +110,14 @@ export class ExtractionDrain {
110
110
  constructor(deps: ExtractionDrainDeps, options?: { dropFailedChunks?: boolean }) {
111
111
  this.deps = deps;
112
112
  this.dropFailedChunks = options?.dropFailedChunks !== false;
113
+ // Forward the drain's drop policy so the run layer dead-letters a
114
+ // permanently-failing window only where dropping failures is permitted.
115
+ this.runExtraction = (turns, runOptions) =>
116
+ deps.runExtraction(turns, { ...runOptions, dropFailedChunks: this.dropFailedChunks && runOptions?.dropFailedChunks !== false });
113
117
  }
114
118
 
119
+ private readonly runExtraction: ExtractionDrainDeps["runExtraction"];
120
+
115
121
  /** Characters the coordinator would count for this window: user/assistant text, trimmed and capped per turn, context-only turns left out. */
116
122
  private windowChars(turns: readonly BufferTurn[]): number {
117
123
  let total = 0;
@@ -204,14 +210,14 @@ export class ExtractionDrain {
204
210
  if (plan.singleRun) {
205
211
  // Without duplicates this is today's single-run path: the run judges its own
206
212
  // thresholds on the raw window.
207
- if (collapsed.duplicateCount === 0) return await this.deps.runExtraction(turns, runOptions);
213
+ if (collapsed.duplicateCount === 0) return await this.runExtraction(turns, runOptions);
208
214
  // With duplicates, eligibility belongs to the RAW window — duplicate inflation
209
215
  // must not change whether a window qualifies (#3443). Below the threshold,
210
216
  // today's skip path runs on the raw window (unmarked, so skip/capture/clear
211
217
  // judge every identity exactly as before); above it, the representative subset
212
218
  // is never re-judged — the same rule the chunk loop applies to chunks.
213
- if (this.windowBelowThreshold(turns, runOptions)) return await this.deps.runExtraction(turns, runOptions);
214
- return await this.deps.runExtraction(window, {
219
+ if (this.windowBelowThreshold(turns, runOptions)) return await this.runExtraction(turns, runOptions);
220
+ return await this.runExtraction(window, {
215
221
  ...runOptions,
216
222
  skipCharThreshold: true,
217
223
  skipUserTurnThreshold: true,
@@ -221,7 +227,7 @@ export class ExtractionDrain {
221
227
  // window: a window that never qualified keeps the single-run path, which
222
228
  // judges it exactly as before.
223
229
  if (!plan.resumed && this.windowBelowThreshold(turns, runOptions)) {
224
- return await this.deps.runExtraction(turns, runOptions);
230
+ return await this.runExtraction(turns, runOptions);
225
231
  }
226
232
  // A deduped window is never re-judged on its representative subset inside the
227
233
  // run: eligibility above (or the caller's skip flags) already decided it.
@@ -360,7 +366,7 @@ export class ExtractionDrain {
360
366
  const failures = this.failureCount(bufferKey, chunk);
361
367
  let result: ExtractionRunResult;
362
368
  try {
363
- result = await this.deps.runExtraction(chunk, chunkOptions);
369
+ result = await this.runExtraction(chunk, { ...chunkOptions, partParents });
364
370
  } catch (err) {
365
371
  this.rethrowChunkAbort(err, preempt, runOptions.abortSignal?.aborted === true);
366
372
  // A successfully dropped thrown chunk does not end the drain: later
@@ -81,6 +81,9 @@ export interface ExtractionRetryStateEntry {
81
81
  nextEligibleAtMs: number;
82
82
  firstFailedAtMs: number;
83
83
  lastFailureClass: ExtractionFailureClass;
84
+ /** Only `provider_permanent` failures count here — transient/setup failures
85
+ * must not consume the terminal-refusal allowance (issue #3757). */
86
+ permanentAttempts?: number;
84
87
  }
85
88
 
86
89
  export interface ExtractionResilienceStatus {
@@ -135,16 +138,23 @@ export function computeExtractionRetryNextEligibleMs(
135
138
 
136
139
  /**
137
140
  * Whether a recorded failure long-parks the fingerprint: `output_truncated`
138
- * can never succeed at the same output ceiling, and `parse_empty` past its
139
- * attempt cap has shown this window unparseable — both park to max backoff.
140
- * The retained window still drains under a raised ceiling (#3521).
141
+ * can never succeed at the same output ceiling, `parse_empty` past its attempt
142
+ * cap has shown this window unparseable, and `provider_permanent` past its cap
143
+ * normally dead-letters — the park is the fallback when the dead-letter's
144
+ * recovery copy could not be written. The retained window still drains under a
145
+ * raised ceiling (#3521).
141
146
  */
142
147
  export function extractionFailureLongParks(
143
148
  cls: ExtractionFailureClass,
144
149
  attempts: number,
145
150
  parseEmptyMaxAttempts: number,
151
+ providerPermanentMaxAttempts: number = parseEmptyMaxAttempts,
146
152
  ): boolean {
147
- return cls === "output_truncated" || (cls === "parse_empty" && attempts > parseEmptyMaxAttempts);
153
+ return (
154
+ cls === "output_truncated" ||
155
+ (cls === "parse_empty" && attempts > parseEmptyMaxAttempts) ||
156
+ (cls === "provider_permanent" && attempts >= providerPermanentMaxAttempts)
157
+ );
148
158
  }
149
159
 
150
160
  /**
@@ -487,3 +497,99 @@ export async function extractChunkedExtraction(
487
497
  );
488
498
  return merged;
489
499
  }
500
+
501
+ /**
502
+ * Dead-letter bound for `provider_permanent` failures (the unbounded
503
+ * remnic-buffer-drain loop): once a fingerprint fails `permanentMaxAttempts`
504
+ * times with a terminal input refusal that a resend can never fix, the retry
505
+ * loop must END — the fingerprint is marked processed so later attempts
506
+ * short-circuit. Same rule as the drain's drop path: a dropped-chunk recovery
507
+ * copy under `state/dropped/` is written first, and if the copy cannot be
508
+ * written the window stays buffered and parked instead of being silently lost.
509
+ * Never throws on a storage failure — the run already holds its failure result.
510
+ */
511
+ export async function maybeDeadLetterPermanentExtractionFailure(args: {
512
+ readonly recorded: boolean;
513
+ readonly dropAllowed: boolean;
514
+ readonly failureClass: ExtractionFailureClass;
515
+ /** Permanent-refusal count only — transient/setup failures never consume the allowance. */
516
+ readonly permanentAttempts: number;
517
+ readonly permanentMaxAttempts: number;
518
+ readonly storage: StorageManager;
519
+ readonly bufferKey: string;
520
+ readonly turns: readonly BufferTurn[];
521
+ /** In-flight part copy → its buffered source turn (`extractionPartOf` splits). */
522
+ readonly partParents?: ReadonlyMap<BufferTurn, BufferTurn>;
523
+ readonly fingerprint: string;
524
+ readonly clearBufferedTurns: (dropTurns: readonly BufferTurn[]) => Promise<void>;
525
+ readonly recordProcessed: (
526
+ storage: StorageManager,
527
+ fingerprint: string,
528
+ meta: MetaState,
529
+ ) => Promise<void>;
530
+ /** Drop the fingerprint from persisted retry state only (inside the meta mutator). */
531
+ readonly clearPersistedRetryEntry: (meta: MetaState) => boolean;
532
+ /** Drop the fingerprint from the in-memory mirror — called only after the save lands. */
533
+ readonly clearRetryMirror: () => void;
534
+ readonly isDeadlineError: (err: Error) => boolean;
535
+ readonly runDeadlineAware: <T>(
536
+ operation: () => Promise<T>,
537
+ phase: string,
538
+ clearTimerOnError?: boolean,
539
+ ) => Promise<T>;
540
+ }): Promise<boolean> {
541
+ // No-drop callers (fail-closed flushes, claim drains) retain the window: the
542
+ // permanent failure stays parked for replay rather than silently processed.
543
+ if (!args.recorded || !args.dropAllowed || args.failureClass !== "provider_permanent") return false;
544
+ if (args.permanentAttempts < Math.max(1, args.permanentMaxAttempts)) return false;
545
+ // Split turns: slice copies match nothing buffered, so the drop set is the
546
+ // parents — same rule as the drain's drop path. Dropping only the copies
547
+ // would strand the parent and re-enter the retry cycle forever.
548
+ const dropTurns =
549
+ args.partParents === undefined
550
+ ? args.turns
551
+ : [...new Set(args.turns.map((t) => args.partParents?.get(t) ?? t))];
552
+ const reason =
553
+ `dead-lettered after ${args.permanentAttempts} provider_permanent extraction failures ` +
554
+ "(a resend of the identical request cannot succeed)";
555
+ let copyPath: string | null = null;
556
+ try {
557
+ copyPath = await args.runDeadlineAware(
558
+ () => args.storage.saveDroppedExtractionChunk(args.bufferKey, reason, dropTurns),
559
+ "during_dead_letter_copy",
560
+ false,
561
+ );
562
+ } catch (err) {
563
+ if (err instanceof Error && args.isDeadlineError(err)) throw err;
564
+ log.warn(
565
+ "runExtraction: could not save the dead-letter recovery copy; keeping the window buffered and parked",
566
+ err,
567
+ );
568
+ return false;
569
+ }
570
+ try {
571
+ await args.runDeadlineAware(
572
+ () =>
573
+ args.storage.updateMeta(async (freshMeta) => {
574
+ await args.recordProcessed(args.storage, args.fingerprint, freshMeta);
575
+ args.clearPersistedRetryEntry(freshMeta);
576
+ }),
577
+ "during_dead_letter_mark",
578
+ false,
579
+ );
580
+ // The mirror entry clears only after the save lands: a failed save would
581
+ // otherwise restart the permanent-attempt count at zero in this process
582
+ // while the persisted entry stayed at the cap.
583
+ args.clearRetryMirror();
584
+ } catch (err) {
585
+ if (err instanceof Error && args.isDeadlineError(err)) throw err;
586
+ // Without a durable processed mark the window must stay buffered: clearing
587
+ // it here would let recaptured content reach the provider again after a
588
+ // restart instead of being skipped as processed_fingerprint.
589
+ log.warn("runExtraction: failed to mark dead-lettered fingerprint processed; keeping the window parked", err);
590
+ return false;
591
+ }
592
+ log.warn(`runExtraction: ${reason}; recovery copy saved to ${copyPath}`);
593
+ await args.runDeadlineAware(() => args.clearBufferedTurns(dropTurns), "during_dead_letter_clear");
594
+ return true;
595
+ }