@remnic/core 9.15.1 → 9.15.2

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 (302) hide show
  1. package/dist/access-admin-ops-surface.d.ts +8 -8
  2. package/dist/access-admin-ops-surface.js +7 -7
  3. package/dist/access-boundary.d.ts +8 -8
  4. package/dist/access-boundary.js +7 -7
  5. package/dist/access-cli.js +33 -33
  6. package/dist/access-http.d.ts +8 -8
  7. package/dist/access-http.js +11 -11
  8. package/dist/access-identity-continuity-surface.d.ts +6 -6
  9. package/dist/access-identity-continuity-surface.js +7 -7
  10. package/dist/access-lcm-surface.d.ts +8 -8
  11. package/dist/access-lcm-surface.js +7 -7
  12. package/dist/access-mcp.d.ts +8 -8
  13. package/dist/access-mcp.js +10 -10
  14. package/dist/access-memory-search-fanout.d.ts +2 -2
  15. package/dist/{access-namespace-preflight-DgJtZCmU.d.ts → access-namespace-preflight-B9e5GnyZ.d.ts} +1 -1
  16. package/dist/access-namespace-preflight.d.ts +3 -3
  17. package/dist/access-namespace-preflight.js +7 -7
  18. package/dist/access-observe-write-surface.d.ts +8 -8
  19. package/dist/access-observe-write-surface.js +7 -7
  20. package/dist/access-operations-batch.js +8 -8
  21. package/dist/access-operations.d.ts +8 -8
  22. package/dist/access-operations.js +9 -9
  23. package/dist/access-recall-concurrency.d.ts +8 -8
  24. package/dist/access-recall-concurrency.js +7 -7
  25. package/dist/access-recall-response.d.ts +8 -8
  26. package/dist/access-recall-response.js +7 -7
  27. package/dist/access-recall-surface.d.ts +8 -8
  28. package/dist/access-recall-surface.js +7 -7
  29. package/dist/{access-service-bw2p9ULX.d.ts → access-service-DgmJd_A-.d.ts} +6 -6
  30. package/dist/access-service.d.ts +8 -8
  31. package/dist/access-service.js +7 -7
  32. package/dist/access-surface-catalog.d.ts +8 -8
  33. package/dist/action-confidence.d.ts +1 -1
  34. package/dist/active-memory-bridge.d.ts +1 -1
  35. package/dist/active-recall.d.ts +1 -1
  36. package/dist/active-recall.js +1 -1
  37. package/dist/behavior-learner.d.ts +1 -1
  38. package/dist/behavior-signals.d.ts +1 -1
  39. package/dist/bootstrap.d.ts +6 -6
  40. package/dist/briefing.d.ts +2 -2
  41. package/dist/briefing.js +3 -3
  42. package/dist/buffer-surprise-report.d.ts +1 -1
  43. package/dist/buffer.d.ts +2 -2
  44. package/dist/bulk-import/index.d.ts +3 -3
  45. package/dist/calibration.d.ts +1 -1
  46. package/dist/capabilities.d.ts +1 -1
  47. package/dist/{catalog-BWqHb5HT.d.ts → catalog-g_dfT6oL.d.ts} +1 -1
  48. package/dist/causal-behavior.d.ts +1 -1
  49. package/dist/causal-consolidation.d.ts +1 -1
  50. package/dist/causal-consolidation.js +4 -4
  51. package/dist/causal-trajectory-graph.d.ts +1 -1
  52. package/dist/{chunk-H3MDWWGN.js → chunk-42DJZZUB.js} +2 -2
  53. package/dist/{chunk-JRXN5LYL.js → chunk-47WFEKT7.js} +2 -2
  54. package/dist/{chunk-I7DUEPE2.js → chunk-4E5H4FPC.js} +3 -3
  55. package/dist/{chunk-FFF4XIGB.js → chunk-5HFIHWOF.js} +17 -17
  56. package/dist/{chunk-MUQ3BD2C.js → chunk-5MDE5MIC.js} +2 -2
  57. package/dist/{chunk-QLOOCKKE.js → chunk-6EJL2O3G.js} +2 -2
  58. package/dist/{chunk-WSHJAY5M.js → chunk-B57BIBXI.js} +2 -2
  59. package/dist/{chunk-KN6UGAQB.js → chunk-B6NCHYAK.js} +7 -2
  60. package/dist/chunk-B6NCHYAK.js.map +1 -0
  61. package/dist/{chunk-FMMZQDCT.js → chunk-BNH2VVWP.js} +2 -2
  62. package/dist/{chunk-6KIQT7RG.js → chunk-BZ52BJ6C.js} +2 -2
  63. package/dist/chunk-BZ52BJ6C.js.map +1 -0
  64. package/dist/{chunk-63P3PJED.js → chunk-CXFVZ3PK.js} +18 -18
  65. package/dist/{chunk-7FNHLCQE.js → chunk-EEUZQQRJ.js} +2 -2
  66. package/dist/{chunk-YVKF3HEW.js → chunk-FJ5IQ3SI.js} +1 -1
  67. package/dist/chunk-FJ5IQ3SI.js.map +1 -0
  68. package/dist/{chunk-BOP256DB.js → chunk-GQOKO77V.js} +2 -2
  69. package/dist/{chunk-CCNSCRJ2.js → chunk-H4MDUPER.js} +2 -2
  70. package/dist/{chunk-XKFXY3ZA.js → chunk-IRX5UCGN.js} +3 -3
  71. package/dist/{chunk-HWFK24UD.js → chunk-JN4N2TMQ.js} +7 -7
  72. package/dist/chunk-JN4N2TMQ.js.map +1 -0
  73. package/dist/{chunk-YEU4VEU4.js → chunk-JTW4TGPV.js} +2 -2
  74. package/dist/{chunk-RRHEV5HA.js → chunk-KLXG4BBO.js} +2 -2
  75. package/dist/{chunk-YS7KIG3A.js → chunk-NAY25BGS.js} +6 -6
  76. package/dist/{chunk-RWSLO24I.js → chunk-O7ACJAHR.js} +9 -2
  77. package/dist/{chunk-RWSLO24I.js.map → chunk-O7ACJAHR.js.map} +1 -1
  78. package/dist/{chunk-SWVW42CG.js → chunk-OOGGUXAG.js} +2 -2
  79. package/dist/{chunk-XII2XSHL.js → chunk-P53HGVJS.js} +2 -2
  80. package/dist/{chunk-U3ZAVRP3.js → chunk-PXJEL55X.js} +2 -2
  81. package/dist/{chunk-XMAD32BW.js → chunk-RRS5CDB6.js} +2 -2
  82. package/dist/{chunk-3QAH2S33.js → chunk-SYCVU556.js} +3 -3
  83. package/dist/{chunk-SW2KEZNX.js → chunk-T4EAQPQQ.js} +2 -2
  84. package/dist/{chunk-BVC242OS.js → chunk-T4OTDMX4.js} +2 -2
  85. package/dist/{chunk-ZNFVYUYF.js → chunk-U6QWUFSM.js} +2 -2
  86. package/dist/{chunk-SDZWOEZH.js → chunk-UJIBXOJA.js} +5 -5
  87. package/dist/{chunk-CQMEM5CC.js → chunk-WIKOHCQZ.js} +2 -2
  88. package/dist/{chunk-CVZYPFEH.js → chunk-XJT6LNLY.js} +3 -3
  89. package/dist/{chunk-46OH3OVK.js → chunk-YXTSUIXC.js} +5 -1
  90. package/dist/chunk-YXTSUIXC.js.map +1 -0
  91. package/dist/{cli-DzPVFfGe.d.ts → cli-BXCd2cgK.d.ts} +5 -5
  92. package/dist/cli.d.ts +10 -10
  93. package/dist/cli.js +24 -24
  94. package/dist/compounding/engine.d.ts +2 -2
  95. package/dist/compounding/engine.js +3 -3
  96. package/dist/compounding/preference-consolidator.d.ts +1 -1
  97. package/dist/compression-optimizer.d.ts +1 -1
  98. package/dist/config.d.ts +1 -1
  99. package/dist/config.js +1 -1
  100. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  101. package/dist/connectors/codex-materialize-runner.js +3 -3
  102. package/dist/connectors/codex-materialize.d.ts +1 -1
  103. package/dist/connectors/index.d.ts +1 -1
  104. package/dist/connectors/index.js +3 -3
  105. package/dist/consolidation-provenance-check.d.ts +2 -2
  106. package/dist/consolidation-undo.d.ts +2 -2
  107. package/dist/contradiction/index.d.ts +2 -2
  108. package/dist/conversation-index/backend.d.ts +1 -1
  109. package/dist/conversation-index/chunker.d.ts +1 -1
  110. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  111. package/dist/conversation-index/indexer.d.ts +1 -1
  112. package/dist/conversation-index/search.d.ts +1 -1
  113. package/dist/day-summary.d.ts +1 -1
  114. package/dist/delinearize.d.ts +1 -1
  115. package/dist/direct-answer-wiring.d.ts +1 -1
  116. package/dist/direct-answer.d.ts +1 -1
  117. package/dist/embedding-fallback.d.ts +1 -1
  118. package/dist/enrichment/index.d.ts +1 -1
  119. package/dist/entity-retrieval.d.ts +2 -2
  120. package/dist/entity-retrieval.js +3 -3
  121. package/dist/entity-schema.d.ts +1 -1
  122. package/dist/explicit-capture.d.ts +6 -6
  123. package/dist/extraction-faithfulness.d.ts +1 -1
  124. package/dist/extraction-judge-telemetry.d.ts +1 -1
  125. package/dist/extraction-judge-training.d.ts +1 -1
  126. package/dist/extraction-judge.d.ts +1 -1
  127. package/dist/extraction.d.ts +3 -2
  128. package/dist/extraction.js +6 -4
  129. package/dist/fallback-llm.d.ts +1 -1
  130. package/dist/graph-dashboard-diff.d.ts +1 -1
  131. package/dist/graph-dashboard-key.d.ts +1 -1
  132. package/dist/graph-dashboard-parser.d.ts +1 -1
  133. package/dist/graph-edge-reinforcement.d.ts +1 -1
  134. package/dist/graph-snapshot.d.ts +1 -1
  135. package/dist/graph.d.ts +1 -1
  136. package/dist/importance.d.ts +1 -1
  137. package/dist/importers/index.d.ts +1 -1
  138. package/dist/in-flight-reads.d.ts +1 -1
  139. package/dist/index.d.ts +18 -18
  140. package/dist/index.js +33 -33
  141. package/dist/intent.d.ts +1 -1
  142. package/dist/lcm/engine.d.ts +1 -1
  143. package/dist/lcm/index.d.ts +1 -1
  144. package/dist/lcm/tools.d.ts +1 -1
  145. package/dist/lifecycle.d.ts +1 -1
  146. package/dist/live-connectors-runner.d.ts +1 -1
  147. package/dist/local-llm.d.ts +2 -1
  148. package/dist/local-llm.js +1 -1
  149. package/dist/local-model-endpoint.d.ts +1 -1
  150. package/dist/maintenance/memory-governance.d.ts +1 -1
  151. package/dist/maintenance/memory-governance.js +3 -3
  152. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  153. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  154. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  155. package/dist/mcp-memory-inspector-app.d.ts +8 -8
  156. package/dist/memory-action-policy.d.ts +1 -1
  157. package/dist/memory-cache.d.ts +1 -1
  158. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  159. package/dist/memory-projection-store.d.ts +1 -1
  160. package/dist/memory-provenance.d.ts +1 -1
  161. package/dist/memory-worth-outcomes.d.ts +2 -2
  162. package/dist/models-json.d.ts +1 -1
  163. package/dist/namespaces/migrate.d.ts +3 -3
  164. package/dist/namespaces/migrate.js +4 -4
  165. package/dist/namespaces/principal.d.ts +1 -1
  166. package/dist/namespaces/search.d.ts +1 -1
  167. package/dist/namespaces/storage.d.ts +3 -3
  168. package/dist/namespaces/storage.js +3 -3
  169. package/dist/native-knowledge.d.ts +1 -1
  170. package/dist/offline-sync-impression-drain.d.ts +1 -1
  171. package/dist/operator-toolkit.d.ts +2 -2
  172. package/dist/operator-toolkit.js +8 -8
  173. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  174. package/dist/orchestration/maintenance.d.ts +3 -3
  175. package/dist/orchestration/maintenance.js +6 -6
  176. package/dist/{orchestrator-CQJ8U7En.d.ts → orchestrator-BHfWtvEJ.d.ts} +5 -5
  177. package/dist/orchestrator.d.ts +6 -6
  178. package/dist/orchestrator.js +33 -33
  179. package/dist/patterns-cli.d.ts +1 -1
  180. package/dist/{pipeline-Cn-kvYeV.d.ts → pipeline-CBYcnmDC.d.ts} +1 -1
  181. package/dist/policy-runtime.d.ts +1 -1
  182. package/dist/proactive-contention.d.ts +1 -1
  183. package/dist/provenance.d.ts +1 -1
  184. package/dist/{qmd-oh9VXz1d.d.ts → qmd-BIq-jrV4.d.ts} +1 -1
  185. package/dist/qmd-preflight.d.ts +2 -2
  186. package/dist/qmd-recall-cache.d.ts +1 -1
  187. package/dist/qmd.d.ts +2 -2
  188. package/dist/recall-concurrency-config.d.ts +1 -1
  189. package/dist/recall-disclosure-escalation.d.ts +1 -1
  190. package/dist/recall-explain-renderer.d.ts +1 -1
  191. package/dist/recall-explain-renderer.js +3 -3
  192. package/dist/recall-memory-map.d.ts +1 -1
  193. package/dist/recall-planner-llm.d.ts +1 -1
  194. package/dist/recall-state.d.ts +1 -1
  195. package/dist/recall-tag-filter.d.ts +1 -1
  196. package/dist/recall-timings.d.ts +1 -1
  197. package/dist/recall-xray-cli.d.ts +1 -1
  198. package/dist/recall-xray-cli.js +4 -4
  199. package/dist/recall-xray-renderer.d.ts +1 -1
  200. package/dist/recall-xray-renderer.js +3 -3
  201. package/dist/recall-xray.d.ts +1 -1
  202. package/dist/recall-xray.js +2 -2
  203. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  204. package/dist/replay/normalizers/claude.d.ts +1 -1
  205. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  206. package/dist/replay/normalizers/shared.d.ts +1 -1
  207. package/dist/replay/runner.d.ts +1 -1
  208. package/dist/replay/types.d.ts +1 -1
  209. package/dist/resolve-auth-token.d.ts +1 -1
  210. package/dist/resume-bundles.js +2 -2
  211. package/dist/retrieval-agents.d.ts +2 -2
  212. package/dist/retrieval-tiers.d.ts +1 -1
  213. package/dist/routing/engine.d.ts +1 -1
  214. package/dist/routing/store.d.ts +1 -1
  215. package/dist/salvage-envelope.d.ts +1 -1
  216. package/dist/schemas.d.ts +22 -22
  217. package/dist/{scope-profiles-EpJG7yKP.d.ts → scope-profiles-DDno-uvy.d.ts} +1 -1
  218. package/dist/search/embed-helper.d.ts +1 -1
  219. package/dist/search/factory.d.ts +1 -1
  220. package/dist/search/index.d.ts +1 -1
  221. package/dist/search/lancedb-backend.d.ts +1 -1
  222. package/dist/search/meilisearch-backend.d.ts +1 -1
  223. package/dist/search/noop-backend.d.ts +1 -1
  224. package/dist/search/orama-backend.d.ts +1 -1
  225. package/dist/search/port.d.ts +1 -1
  226. package/dist/search/remote-backend.d.ts +1 -1
  227. package/dist/{semantic-consolidation-DILZEQq3.d.ts → semantic-consolidation-7RIJFDwY.d.ts} +1 -1
  228. package/dist/semantic-consolidation.d.ts +2 -2
  229. package/dist/semantic-consolidation.js +4 -4
  230. package/dist/semantic-rule-promotion.js +3 -3
  231. package/dist/semantic-rule-verifier.d.ts +1 -1
  232. package/dist/semantic-rule-verifier.js +3 -3
  233. package/dist/session-observer-bands.d.ts +1 -1
  234. package/dist/session-observer-state.d.ts +1 -1
  235. package/dist/shared-context/manager.d.ts +1 -1
  236. package/dist/signal.d.ts +1 -1
  237. package/dist/{storage-NIyKYD8g.d.ts → storage-DkphZiOJ.d.ts} +1 -1
  238. package/dist/storage.d.ts +2 -2
  239. package/dist/storage.js +2 -2
  240. package/dist/summarizer.d.ts +1 -1
  241. package/dist/summarizer.js +2 -2
  242. package/dist/summary-snapshot.d.ts +1 -1
  243. package/dist/temporal-supersession.d.ts +2 -2
  244. package/dist/temporal-timeline-recall.d.ts +1 -1
  245. package/dist/temporal-validity.d.ts +1 -1
  246. package/dist/threading.d.ts +1 -1
  247. package/dist/tier-migration.d.ts +2 -2
  248. package/dist/tier-routing.d.ts +1 -1
  249. package/dist/topics.d.ts +1 -1
  250. package/dist/transcript.d.ts +1 -1
  251. package/dist/transfer/types.d.ts +12 -12
  252. package/dist/trust-score-stage.d.ts +1 -1
  253. package/dist/trust-score.d.ts +1 -1
  254. package/dist/{types-D_fG2ix8.d.ts → types-2q_MRFcM.d.ts} +6 -0
  255. package/dist/types.d.ts +1 -1
  256. package/dist/types.js +1 -1
  257. package/dist/utility-runtime.d.ts +1 -1
  258. package/dist/verified-recall.js +3 -3
  259. package/dist/write-envelope.d.ts +1 -1
  260. package/package.json +2 -2
  261. package/src/access-service.ts +0 -46
  262. package/src/config.test.ts +7 -0
  263. package/src/config.ts +6 -0
  264. package/src/extraction-thinking.test.ts +44 -0
  265. package/src/extraction.ts +12 -0
  266. package/src/local-llm-thinking.test.ts +13 -1
  267. package/src/local-llm.ts +2 -1
  268. package/src/orchestration/qmd-result-resolver.test.ts +103 -0
  269. package/src/orchestration/qmd-result-resolver.ts +11 -0
  270. package/src/types.ts +6 -0
  271. package/dist/chunk-46OH3OVK.js.map +0 -1
  272. package/dist/chunk-6KIQT7RG.js.map +0 -1
  273. package/dist/chunk-HWFK24UD.js.map +0 -1
  274. package/dist/chunk-KN6UGAQB.js.map +0 -1
  275. package/dist/chunk-YVKF3HEW.js.map +0 -1
  276. /package/dist/{chunk-H3MDWWGN.js.map → chunk-42DJZZUB.js.map} +0 -0
  277. /package/dist/{chunk-JRXN5LYL.js.map → chunk-47WFEKT7.js.map} +0 -0
  278. /package/dist/{chunk-I7DUEPE2.js.map → chunk-4E5H4FPC.js.map} +0 -0
  279. /package/dist/{chunk-FFF4XIGB.js.map → chunk-5HFIHWOF.js.map} +0 -0
  280. /package/dist/{chunk-MUQ3BD2C.js.map → chunk-5MDE5MIC.js.map} +0 -0
  281. /package/dist/{chunk-QLOOCKKE.js.map → chunk-6EJL2O3G.js.map} +0 -0
  282. /package/dist/{chunk-WSHJAY5M.js.map → chunk-B57BIBXI.js.map} +0 -0
  283. /package/dist/{chunk-FMMZQDCT.js.map → chunk-BNH2VVWP.js.map} +0 -0
  284. /package/dist/{chunk-63P3PJED.js.map → chunk-CXFVZ3PK.js.map} +0 -0
  285. /package/dist/{chunk-7FNHLCQE.js.map → chunk-EEUZQQRJ.js.map} +0 -0
  286. /package/dist/{chunk-BOP256DB.js.map → chunk-GQOKO77V.js.map} +0 -0
  287. /package/dist/{chunk-CCNSCRJ2.js.map → chunk-H4MDUPER.js.map} +0 -0
  288. /package/dist/{chunk-XKFXY3ZA.js.map → chunk-IRX5UCGN.js.map} +0 -0
  289. /package/dist/{chunk-YEU4VEU4.js.map → chunk-JTW4TGPV.js.map} +0 -0
  290. /package/dist/{chunk-RRHEV5HA.js.map → chunk-KLXG4BBO.js.map} +0 -0
  291. /package/dist/{chunk-YS7KIG3A.js.map → chunk-NAY25BGS.js.map} +0 -0
  292. /package/dist/{chunk-SWVW42CG.js.map → chunk-OOGGUXAG.js.map} +0 -0
  293. /package/dist/{chunk-XII2XSHL.js.map → chunk-P53HGVJS.js.map} +0 -0
  294. /package/dist/{chunk-U3ZAVRP3.js.map → chunk-PXJEL55X.js.map} +0 -0
  295. /package/dist/{chunk-XMAD32BW.js.map → chunk-RRS5CDB6.js.map} +0 -0
  296. /package/dist/{chunk-3QAH2S33.js.map → chunk-SYCVU556.js.map} +0 -0
  297. /package/dist/{chunk-SW2KEZNX.js.map → chunk-T4EAQPQQ.js.map} +0 -0
  298. /package/dist/{chunk-BVC242OS.js.map → chunk-T4OTDMX4.js.map} +0 -0
  299. /package/dist/{chunk-ZNFVYUYF.js.map → chunk-U6QWUFSM.js.map} +0 -0
  300. /package/dist/{chunk-SDZWOEZH.js.map → chunk-UJIBXOJA.js.map} +0 -0
  301. /package/dist/{chunk-CQMEM5CC.js.map → chunk-WIKOHCQZ.js.map} +0 -0
  302. /package/dist/{chunk-CVZYPFEH.js.map → chunk-XJT6LNLY.js.map} +0 -0
@@ -0,0 +1,44 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import { shouldEnableLocalExtractionThinking } from "./extraction.js";
5
+ import type { PluginConfig } from "./types.js";
6
+
7
+ function config(overrides: Partial<PluginConfig> = {}): PluginConfig {
8
+ return {
9
+ localLlmDisableThinking: true,
10
+ localLlmThinkingThresholdChars: 3_000,
11
+ ...overrides,
12
+ } as PluginConfig;
13
+ }
14
+
15
+ test("short local extraction enables thinking when configured (#1997)", () => {
16
+ assert.equal(shouldEnableLocalExtractionThinking(config(), 2_999), true);
17
+ });
18
+
19
+ test("length-aware local thinking stays disabled at the threshold and above (#1997)", () => {
20
+ assert.equal(shouldEnableLocalExtractionThinking(config(), 3_000), false);
21
+ assert.equal(shouldEnableLocalExtractionThinking(config(), 3_001), false);
22
+ });
23
+
24
+ test("disabled threshold and explicit global opt-out preserve existing behavior (#1997)", () => {
25
+ assert.equal(shouldEnableLocalExtractionThinking(config({ localLlmThinkingThresholdChars: 0 }), 1), false);
26
+ assert.equal(shouldEnableLocalExtractionThinking(config({ localLlmDisableThinking: false }), 1), false);
27
+ });
28
+
29
+ test("four-transcript selection matrix keeps short sparse cases in thinking mode (#1997)", () => {
30
+ const cases = [
31
+ { name: "sparse commitment", transcript: "A".repeat(750), thinking: true },
32
+ { name: "sparse correction", transcript: "B".repeat(1_600), thinking: true },
33
+ { name: "dense technical discussion", transcript: "C".repeat(3_000), thinking: false },
34
+ { name: "dense multi-turn discussion", transcript: "D".repeat(6_000), thinking: false },
35
+ ];
36
+
37
+ for (const scenario of cases) {
38
+ assert.equal(
39
+ shouldEnableLocalExtractionThinking(config(), scenario.transcript.length),
40
+ scenario.thinking,
41
+ scenario.name,
42
+ );
43
+ }
44
+ });
package/src/extraction.ts CHANGED
@@ -147,6 +147,15 @@ function normalizeProfileUpdateKey(update: string): string {
147
147
  return update.trim().toLowerCase();
148
148
  }
149
149
 
150
+ export function shouldEnableLocalExtractionThinking(
151
+ config: Pick<PluginConfig, "localLlmDisableThinking" | "localLlmThinkingThresholdChars">,
152
+ conversationChars: number,
153
+ ): boolean {
154
+ return config.localLlmDisableThinking &&
155
+ config.localLlmThinkingThresholdChars > 0 &&
156
+ conversationChars < config.localLlmThinkingThresholdChars;
157
+ }
158
+
150
159
  export class ExtractionEngine {
151
160
  private client: OpenAI | null;
152
161
  private localLlm: LocalLlmClient;
@@ -1523,6 +1532,9 @@ ${truncatedConversation}`;
1523
1532
  temperature: 0.1,
1524
1533
  maxTokens: contextSizes.maxOutputTokens,
1525
1534
  operation: "extraction",
1535
+ disableThinking: shouldEnableLocalExtractionThinking(this.config, conversation.length)
1536
+ ? false
1537
+ : undefined,
1526
1538
  priority: "background",
1527
1539
  },
1528
1540
  );
@@ -83,7 +83,7 @@ function captureFetchBodies(): {
83
83
  async function runOneChatCompletion(
84
84
  client: LocalLlmClient,
85
85
  operation: string | null = "extraction",
86
- options: { forceDisableThinking?: boolean } = {},
86
+ options: { forceDisableThinking?: boolean; disableThinking?: boolean } = {},
87
87
  ): Promise<void> {
88
88
  await client.chatCompletion(
89
89
  [{ role: "user", content: "hello" }],
@@ -344,3 +344,15 @@ test("disableThinking=false never injects chat_template_kwargs, regardless of ba
344
344
  }
345
345
  assert.equal("chat_template_kwargs" in (bodies[0] ?? {}), false);
346
346
  });
347
+
348
+ test("request-level thinking override leaves short extraction thinking enabled (#1997)", async () => {
349
+ const client = new LocalLlmClient(createConfig());
350
+ primeClient(client, { thinking: true, detected: "ollama" });
351
+ const { restore, bodies } = captureFetchBodies();
352
+ try {
353
+ await runOneChatCompletion(client, "extraction", { disableThinking: false });
354
+ } finally {
355
+ restore();
356
+ }
357
+ assert.equal("reasoning_effort" in (bodies[0] ?? {}), false);
358
+ });
package/src/local-llm.ts CHANGED
@@ -220,6 +220,7 @@ interface LocalLlmChatCompletionOptions {
220
220
  timeoutMs?: number;
221
221
  operation?: string;
222
222
  forceDisableThinking?: boolean;
223
+ disableThinking?: boolean;
223
224
  priority?: LocalLlmRequestPriority;
224
225
  }
225
226
 
@@ -989,7 +990,7 @@ export class LocalLlmClient {
989
990
  // backend hasn't been positively identified as thinking-capable.
990
991
  const shouldSuppressThinking =
991
992
  options.forceDisableThinking === true ||
992
- (this._disableThinking &&
993
+ ((options.disableThinking ?? this._disableThinking) &&
993
994
  THINKING_SUPPRESSED_OPERATIONS.has(operation));
994
995
  if (
995
996
  shouldSuppressThinking &&
@@ -0,0 +1,103 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
4
+ import os from "node:os";
5
+ import path from "node:path";
6
+
7
+ import { parseConfig } from "../config.js";
8
+ import { StorageManager } from "../index.js";
9
+ import {
10
+ QmdResultResolver,
11
+ qmdResultPathCandidates,
12
+ } from "./qmd-result-resolver.js";
13
+
14
+ test("qmdResultPathCandidates probes the facts/ fallback for relative date paths", () => {
15
+ const root = path.join(os.tmpdir(), "remnic-resolver-rel");
16
+ const candidates = qmdResultPathCandidates(root, "2026-07-21/fact-x.md");
17
+ assert.deepEqual(
18
+ candidates.sort(),
19
+ [
20
+ path.join(root, "2026-07-21", "fact-x.md"),
21
+ path.join(root, "facts", "2026-07-21", "fact-x.md"),
22
+ ].sort(),
23
+ "relative date paths probe both the literal and the facts/ location",
24
+ );
25
+ });
26
+
27
+ test("qmdResultPathCandidates probes the facts/ fallback for absolute date paths inside the storage root (issue #2111)", () => {
28
+ const root = path.join(os.tmpdir(), "remnic-resolver-abs");
29
+ const absolute = path.join(root, "2026-07-21", "fact-x.md");
30
+ const candidates = qmdResultPathCandidates(root, absolute);
31
+ assert.deepEqual(
32
+ candidates.sort(),
33
+ [absolute, path.join(root, "facts", "2026-07-21", "fact-x.md")].sort(),
34
+ "pre-absolutized date paths must probe the facts/ location too",
35
+ );
36
+ });
37
+
38
+ test("qmdResultPathCandidates keeps non-date absolute paths literal", () => {
39
+ const root = path.join(os.tmpdir(), "remnic-resolver-abs-nondate");
40
+ const absolute = path.join(root, "entities", "person-x.md");
41
+ assert.deepEqual(
42
+ qmdResultPathCandidates(root, absolute),
43
+ [absolute],
44
+ "non-date absolute paths must not grow a facts/ variant",
45
+ );
46
+ });
47
+
48
+ test("qmdResultPathCandidates rejects absolute paths outside the storage root", () => {
49
+ const root = path.join(os.tmpdir(), "remnic-resolver-abs-outside");
50
+ const outside = path.join(os.tmpdir(), "elsewhere", "2026-07-21", "fact-x.md");
51
+ assert.deepEqual(
52
+ qmdResultPathCandidates(root, outside),
53
+ [],
54
+ "containment must drop escaping paths, including their facts/ variant",
55
+ );
56
+ });
57
+
58
+ test("readQmdResultMemory resolves an absolute date path whose file lives under facts/ (issue #2111)", async () => {
59
+ const dir = await mkdtemp(path.join(os.tmpdir(), "remnic-resolver-e2e-"));
60
+ try {
61
+ const storage = new StorageManager(dir);
62
+ await storage.ensureDirectories();
63
+ const factDir = path.join(dir, "facts", "2026-07-21");
64
+ await mkdir(factDir, { recursive: true });
65
+ const factPath = path.join(factDir, "fact-cookie-note.md");
66
+ await writeFile(
67
+ factPath,
68
+ [
69
+ "---",
70
+ "id: fact-cookie-note",
71
+ "category: fact",
72
+ "created: 2026-07-21T00:00:00.000Z",
73
+ "updated: 2026-07-21T00:00:00.000Z",
74
+ "status: active",
75
+ "---",
76
+ "",
77
+ "The storefront manages a uniqueId cookie with a 90-day expiration.",
78
+ "",
79
+ ].join("\n"),
80
+ "utf8",
81
+ );
82
+
83
+ const config = parseConfig({ memoryDir: dir });
84
+ const resolver = new QmdResultResolver({
85
+ getConfig: () => config,
86
+ storageFor: async () => storage,
87
+ storageDirNamespace: () => config.defaultNamespace,
88
+ qmdCollectionNamespaceFromPrefix: () => null,
89
+ namespaceFromPath: () => config.defaultNamespace,
90
+ });
91
+
92
+ // Daemon-mode shape: the result path is already absolutized against the
93
+ // storage root but is missing the facts/ segment because the hot-facts
94
+ // collection was registered at the facts/ subtree.
95
+ const preAbsolutized = path.join(dir, "2026-07-21", "fact-cookie-note.md");
96
+ const memory = await resolver.readQmdResultMemory(preAbsolutized, storage);
97
+ assert.ok(memory, "the memory must resolve via the facts/ fallback");
98
+ assert.equal(memory.frontmatter.id, "fact-cookie-note");
99
+ assert.equal(path.resolve(memory.path), path.resolve(factPath));
100
+ } finally {
101
+ await rm(dir, { recursive: true, force: true });
102
+ }
103
+ });
@@ -84,6 +84,17 @@ export function qmdResultPathCandidates(
84
84
 
85
85
  if (path.isAbsolute(resultPath)) {
86
86
  addCandidate(resultPath);
87
+ // Daemon-mode results can arrive pre-absolutized against the storage
88
+ // root while the file lives under facts/<date>/ (hot-facts collection
89
+ // registered at the facts/ subtree — issue #2111). Mirror the relative
90
+ // branch's facts/ fallback; addCandidate re-checks containment.
91
+ const relative = path.relative(storageRoot, path.resolve(resultPath));
92
+ if (relative && !relative.startsWith("..") && !path.isAbsolute(relative)) {
93
+ const normalized = relative.split(path.sep).join("/");
94
+ if (/^\d{4}-\d{2}-\d{2}\//.test(normalized)) {
95
+ addCandidate(path.join(storageRoot, "facts", normalized));
96
+ }
97
+ }
87
98
  } else {
88
99
  addRelativeCandidates(resultPath);
89
100
  }
package/src/types.ts CHANGED
@@ -1624,6 +1624,12 @@ export interface PluginConfig extends BoundedJsonlStateConfig {
1624
1624
  * `chat_template_kwargs`, so this is the only think-off dialect it honors.
1625
1625
  * Issue #1996. */
1626
1626
  localLlmReasoningEffort: string;
1627
+ /**
1628
+ * Maximum transcript length that re-enables thinking for local extraction.
1629
+ * Set to `0` to keep thinking suppressed for every extraction. Default:
1630
+ * `3000`. Consolidation is unaffected.
1631
+ */
1632
+ localLlmThinkingThresholdChars: number;
1627
1633
  // Extraction retry/backoff + circuit breaker (extraction hot-loop hardening)
1628
1634
  /** Master gate. When false, restores pre-change behavior (extractor called on every triggered observe; no gate). */
1629
1635
  extractionRetryEnabled: boolean;