@tenphi/akno-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (485) hide show
  1. package/LICENSE +83 -0
  2. package/README.md +26 -0
  3. package/config/default.jsonc +548 -0
  4. package/dist/bench/answer-corpus.d.ts +48 -0
  5. package/dist/bench/answer-corpus.d.ts.map +1 -0
  6. package/dist/bench/answer-corpus.js +491 -0
  7. package/dist/bench/answer-corpus.js.map +1 -0
  8. package/dist/bench/answer.d.ts +156 -0
  9. package/dist/bench/answer.d.ts.map +1 -0
  10. package/dist/bench/answer.js +608 -0
  11. package/dist/bench/answer.js.map +1 -0
  12. package/dist/bench/auto-recall-answer-corpus.d.ts +21 -0
  13. package/dist/bench/auto-recall-answer-corpus.d.ts.map +1 -0
  14. package/dist/bench/auto-recall-answer-corpus.js +245 -0
  15. package/dist/bench/auto-recall-answer-corpus.js.map +1 -0
  16. package/dist/bench/auto-recall-answer.d.ts +198 -0
  17. package/dist/bench/auto-recall-answer.d.ts.map +1 -0
  18. package/dist/bench/auto-recall-answer.js +720 -0
  19. package/dist/bench/auto-recall-answer.js.map +1 -0
  20. package/dist/bench/auto-recall-corpus.d.ts +45 -0
  21. package/dist/bench/auto-recall-corpus.d.ts.map +1 -0
  22. package/dist/bench/auto-recall-corpus.js +221 -0
  23. package/dist/bench/auto-recall-corpus.js.map +1 -0
  24. package/dist/bench/auto-recall.d.ts +171 -0
  25. package/dist/bench/auto-recall.d.ts.map +1 -0
  26. package/dist/bench/auto-recall.js +651 -0
  27. package/dist/bench/auto-recall.js.map +1 -0
  28. package/dist/bench/entity-resolution.d.ts +37 -0
  29. package/dist/bench/entity-resolution.d.ts.map +1 -0
  30. package/dist/bench/entity-resolution.js +121 -0
  31. package/dist/bench/entity-resolution.js.map +1 -0
  32. package/dist/bench/graph.d.ts +57 -0
  33. package/dist/bench/graph.d.ts.map +1 -0
  34. package/dist/bench/graph.js +573 -0
  35. package/dist/bench/graph.js.map +1 -0
  36. package/dist/bench/llm-ranking-probe.d.ts +27 -0
  37. package/dist/bench/llm-ranking-probe.d.ts.map +1 -0
  38. package/dist/bench/llm-ranking-probe.js +105 -0
  39. package/dist/bench/llm-ranking-probe.js.map +1 -0
  40. package/dist/bench/merge-discovery-corpus.d.ts +26 -0
  41. package/dist/bench/merge-discovery-corpus.d.ts.map +1 -0
  42. package/dist/bench/merge-discovery-corpus.js +114 -0
  43. package/dist/bench/merge-discovery-corpus.js.map +1 -0
  44. package/dist/bench/merge-discovery-review.d.ts +81 -0
  45. package/dist/bench/merge-discovery-review.d.ts.map +1 -0
  46. package/dist/bench/merge-discovery-review.js +149 -0
  47. package/dist/bench/merge-discovery-review.js.map +1 -0
  48. package/dist/bench/merge-discovery.d.ts +122 -0
  49. package/dist/bench/merge-discovery.d.ts.map +1 -0
  50. package/dist/bench/merge-discovery.js +390 -0
  51. package/dist/bench/merge-discovery.js.map +1 -0
  52. package/dist/bench/mixed-retrieval.d.ts +35 -0
  53. package/dist/bench/mixed-retrieval.d.ts.map +1 -0
  54. package/dist/bench/mixed-retrieval.js +355 -0
  55. package/dist/bench/mixed-retrieval.js.map +1 -0
  56. package/dist/bench/ranking-corpus.d.ts +29 -0
  57. package/dist/bench/ranking-corpus.d.ts.map +1 -0
  58. package/dist/bench/ranking-corpus.js +514 -0
  59. package/dist/bench/ranking-corpus.js.map +1 -0
  60. package/dist/bench/ranking-end-to-end.d.ts +112 -0
  61. package/dist/bench/ranking-end-to-end.d.ts.map +1 -0
  62. package/dist/bench/ranking-end-to-end.js +479 -0
  63. package/dist/bench/ranking-end-to-end.js.map +1 -0
  64. package/dist/bench/ranking-latency.d.ts +71 -0
  65. package/dist/bench/ranking-latency.d.ts.map +1 -0
  66. package/dist/bench/ranking-latency.js +130 -0
  67. package/dist/bench/ranking-latency.js.map +1 -0
  68. package/dist/bench/ranking-matrix.d.ts +141 -0
  69. package/dist/bench/ranking-matrix.d.ts.map +1 -0
  70. package/dist/bench/ranking-matrix.js +526 -0
  71. package/dist/bench/ranking-matrix.js.map +1 -0
  72. package/dist/bench/ranking-review.d.ts +93 -0
  73. package/dist/bench/ranking-review.d.ts.map +1 -0
  74. package/dist/bench/ranking-review.js +249 -0
  75. package/dist/bench/ranking-review.js.map +1 -0
  76. package/dist/bench/ranking.d.ts +122 -0
  77. package/dist/bench/ranking.d.ts.map +1 -0
  78. package/dist/bench/ranking.js +547 -0
  79. package/dist/bench/ranking.js.map +1 -0
  80. package/dist/bench.d.ts +60 -0
  81. package/dist/bench.d.ts.map +1 -0
  82. package/dist/bench.js +167 -0
  83. package/dist/bench.js.map +1 -0
  84. package/dist/config/jsonc.d.ts +8 -0
  85. package/dist/config/jsonc.d.ts.map +1 -0
  86. package/dist/config/jsonc.js +85 -0
  87. package/dist/config/jsonc.js.map +1 -0
  88. package/dist/config/load.d.ts +43 -0
  89. package/dist/config/load.d.ts.map +1 -0
  90. package/dist/config/load.js +608 -0
  91. package/dist/config/load.js.map +1 -0
  92. package/dist/config/paths.d.ts +10 -0
  93. package/dist/config/paths.d.ts.map +1 -0
  94. package/dist/config/paths.js +38 -0
  95. package/dist/config/paths.js.map +1 -0
  96. package/dist/config/schema.d.ts +698 -0
  97. package/dist/config/schema.d.ts.map +1 -0
  98. package/dist/config/schema.js +394 -0
  99. package/dist/config/schema.js.map +1 -0
  100. package/dist/config/write-rules.d.ts +41 -0
  101. package/dist/config/write-rules.d.ts.map +1 -0
  102. package/dist/config/write-rules.js +225 -0
  103. package/dist/config/write-rules.js.map +1 -0
  104. package/dist/config/write-setup.d.ts +42 -0
  105. package/dist/config/write-setup.d.ts.map +1 -0
  106. package/dist/config/write-setup.js +358 -0
  107. package/dist/config/write-setup.js.map +1 -0
  108. package/dist/context.d.ts +64 -0
  109. package/dist/context.d.ts.map +1 -0
  110. package/dist/context.js +14 -0
  111. package/dist/context.js.map +1 -0
  112. package/dist/doctor.d.ts +115 -0
  113. package/dist/doctor.d.ts.map +1 -0
  114. package/dist/doctor.js +388 -0
  115. package/dist/doctor.js.map +1 -0
  116. package/dist/index/chunk.d.ts +62 -0
  117. package/dist/index/chunk.d.ts.map +1 -0
  118. package/dist/index/chunk.js +307 -0
  119. package/dist/index/chunk.js.map +1 -0
  120. package/dist/index/defer.d.ts +32 -0
  121. package/dist/index/defer.d.ts.map +1 -0
  122. package/dist/index/defer.js +66 -0
  123. package/dist/index/defer.js.map +1 -0
  124. package/dist/index/derive.d.ts +99 -0
  125. package/dist/index/derive.d.ts.map +1 -0
  126. package/dist/index/derive.js +378 -0
  127. package/dist/index/derive.js.map +1 -0
  128. package/dist/index/entity-resolution.d.ts +68 -0
  129. package/dist/index/entity-resolution.d.ts.map +1 -0
  130. package/dist/index/entity-resolution.js +305 -0
  131. package/dist/index/entity-resolution.js.map +1 -0
  132. package/dist/index/graph.d.ts +46 -0
  133. package/dist/index/graph.d.ts.map +1 -0
  134. package/dist/index/graph.js +618 -0
  135. package/dist/index/graph.js.map +1 -0
  136. package/dist/index/indexer.d.ts +301 -0
  137. package/dist/index/indexer.d.ts.map +1 -0
  138. package/dist/index/indexer.js +1398 -0
  139. package/dist/index/indexer.js.map +1 -0
  140. package/dist/index/revision-barrier.d.ts +30 -0
  141. package/dist/index/revision-barrier.d.ts.map +1 -0
  142. package/dist/index/revision-barrier.js +140 -0
  143. package/dist/index/revision-barrier.js.map +1 -0
  144. package/dist/index.d.ts +55 -0
  145. package/dist/index.d.ts.map +1 -0
  146. package/dist/index.js +37 -0
  147. package/dist/index.js.map +1 -0
  148. package/dist/ingest/adoption-eligibility.d.ts +4 -0
  149. package/dist/ingest/adoption-eligibility.d.ts.map +1 -0
  150. package/dist/ingest/adoption-eligibility.js +18 -0
  151. package/dist/ingest/adoption-eligibility.js.map +1 -0
  152. package/dist/ingest/availability.d.ts +15 -0
  153. package/dist/ingest/availability.d.ts.map +1 -0
  154. package/dist/ingest/availability.js +37 -0
  155. package/dist/ingest/availability.js.map +1 -0
  156. package/dist/ingest/extract.d.ts +58 -0
  157. package/dist/ingest/extract.d.ts.map +1 -0
  158. package/dist/ingest/extract.js +255 -0
  159. package/dist/ingest/extract.js.map +1 -0
  160. package/dist/ingest/fetch.d.ts +35 -0
  161. package/dist/ingest/fetch.d.ts.map +1 -0
  162. package/dist/ingest/fetch.js +142 -0
  163. package/dist/ingest/fetch.js.map +1 -0
  164. package/dist/ingest/inbox.d.ts +53 -0
  165. package/dist/ingest/inbox.d.ts.map +1 -0
  166. package/dist/ingest/inbox.js +110 -0
  167. package/dist/ingest/inbox.js.map +1 -0
  168. package/dist/ingest/name.d.ts +72 -0
  169. package/dist/ingest/name.d.ts.map +1 -0
  170. package/dist/ingest/name.js +208 -0
  171. package/dist/ingest/name.js.map +1 -0
  172. package/dist/ingest/parts.d.ts +78 -0
  173. package/dist/ingest/parts.d.ts.map +1 -0
  174. package/dist/ingest/parts.js +52 -0
  175. package/dist/ingest/parts.js.map +1 -0
  176. package/dist/ingest/rendition.d.ts +75 -0
  177. package/dist/ingest/rendition.d.ts.map +1 -0
  178. package/dist/ingest/rendition.js +92 -0
  179. package/dist/ingest/rendition.js.map +1 -0
  180. package/dist/ingest/store.d.ts +66 -0
  181. package/dist/ingest/store.d.ts.map +1 -0
  182. package/dist/ingest/store.js +92 -0
  183. package/dist/ingest/store.js.map +1 -0
  184. package/dist/kb/folders.d.ts +37 -0
  185. package/dist/kb/folders.d.ts.map +1 -0
  186. package/dist/kb/folders.js +133 -0
  187. package/dist/kb/folders.js.map +1 -0
  188. package/dist/kb/frontmatter.d.ts +91 -0
  189. package/dist/kb/frontmatter.d.ts.map +1 -0
  190. package/dist/kb/frontmatter.js +274 -0
  191. package/dist/kb/frontmatter.js.map +1 -0
  192. package/dist/kb/line-facts.d.ts +29 -0
  193. package/dist/kb/line-facts.d.ts.map +1 -0
  194. package/dist/kb/line-facts.js +23 -0
  195. package/dist/kb/line-facts.js.map +1 -0
  196. package/dist/kb/page.d.ts +92 -0
  197. package/dist/kb/page.d.ts.map +1 -0
  198. package/dist/kb/page.js +243 -0
  199. package/dist/kb/page.js.map +1 -0
  200. package/dist/kb/scan.d.ts +38 -0
  201. package/dist/kb/scan.d.ts.map +1 -0
  202. package/dist/kb/scan.js +109 -0
  203. package/dist/kb/scan.js.map +1 -0
  204. package/dist/kb/words.d.ts +30 -0
  205. package/dist/kb/words.d.ts.map +1 -0
  206. package/dist/kb/words.js +107 -0
  207. package/dist/kb/words.js.map +1 -0
  208. package/dist/maintenance/adopt.d.ts +65 -0
  209. package/dist/maintenance/adopt.d.ts.map +1 -0
  210. package/dist/maintenance/adopt.js +238 -0
  211. package/dist/maintenance/adopt.js.map +1 -0
  212. package/dist/maintenance/budget.d.ts +55 -0
  213. package/dist/maintenance/budget.d.ts.map +1 -0
  214. package/dist/maintenance/budget.js +61 -0
  215. package/dist/maintenance/budget.js.map +1 -0
  216. package/dist/maintenance/conflicts.d.ts +105 -0
  217. package/dist/maintenance/conflicts.d.ts.map +1 -0
  218. package/dist/maintenance/conflicts.js +368 -0
  219. package/dist/maintenance/conflicts.js.map +1 -0
  220. package/dist/maintenance/contradictions.d.ts +34 -0
  221. package/dist/maintenance/contradictions.d.ts.map +1 -0
  222. package/dist/maintenance/contradictions.js +199 -0
  223. package/dist/maintenance/contradictions.js.map +1 -0
  224. package/dist/maintenance/curate.d.ts +156 -0
  225. package/dist/maintenance/curate.d.ts.map +1 -0
  226. package/dist/maintenance/curate.js +2070 -0
  227. package/dist/maintenance/curate.js.map +1 -0
  228. package/dist/maintenance/dream.d.ts +139 -0
  229. package/dist/maintenance/dream.d.ts.map +1 -0
  230. package/dist/maintenance/dream.js +1632 -0
  231. package/dist/maintenance/dream.js.map +1 -0
  232. package/dist/maintenance/graph-candidates.d.ts +19 -0
  233. package/dist/maintenance/graph-candidates.d.ts.map +1 -0
  234. package/dist/maintenance/graph-candidates.js +120 -0
  235. package/dist/maintenance/graph-candidates.js.map +1 -0
  236. package/dist/maintenance/housekeeping.d.ts +81 -0
  237. package/dist/maintenance/housekeeping.d.ts.map +1 -0
  238. package/dist/maintenance/housekeeping.js +281 -0
  239. package/dist/maintenance/housekeeping.js.map +1 -0
  240. package/dist/maintenance/link-repairs.d.ts +58 -0
  241. package/dist/maintenance/link-repairs.d.ts.map +1 -0
  242. package/dist/maintenance/link-repairs.js +281 -0
  243. package/dist/maintenance/link-repairs.js.map +1 -0
  244. package/dist/maintenance/log.d.ts +41 -0
  245. package/dist/maintenance/log.d.ts.map +1 -0
  246. package/dist/maintenance/log.js +72 -0
  247. package/dist/maintenance/log.js.map +1 -0
  248. package/dist/maintenance/managed-item-routing.d.ts +48 -0
  249. package/dist/maintenance/managed-item-routing.d.ts.map +1 -0
  250. package/dist/maintenance/managed-item-routing.js +281 -0
  251. package/dist/maintenance/managed-item-routing.js.map +1 -0
  252. package/dist/maintenance/managed-item-sources.d.ts +38 -0
  253. package/dist/maintenance/managed-item-sources.d.ts.map +1 -0
  254. package/dist/maintenance/managed-item-sources.js +324 -0
  255. package/dist/maintenance/managed-item-sources.js.map +1 -0
  256. package/dist/maintenance/managed-items.d.ts +162 -0
  257. package/dist/maintenance/managed-items.d.ts.map +1 -0
  258. package/dist/maintenance/managed-items.js +1329 -0
  259. package/dist/maintenance/managed-items.js.map +1 -0
  260. package/dist/maintenance/merge-classifier.d.ts +19 -0
  261. package/dist/maintenance/merge-classifier.d.ts.map +1 -0
  262. package/dist/maintenance/merge-classifier.js +49 -0
  263. package/dist/maintenance/merge-classifier.js.map +1 -0
  264. package/dist/maintenance/model-telemetry.d.ts +45 -0
  265. package/dist/maintenance/model-telemetry.d.ts.map +1 -0
  266. package/dist/maintenance/model-telemetry.js +107 -0
  267. package/dist/maintenance/model-telemetry.js.map +1 -0
  268. package/dist/maintenance/observe.d.ts +72 -0
  269. package/dist/maintenance/observe.d.ts.map +1 -0
  270. package/dist/maintenance/observe.js +265 -0
  271. package/dist/maintenance/observe.js.map +1 -0
  272. package/dist/maintenance/path-policy.d.ts +83 -0
  273. package/dist/maintenance/path-policy.d.ts.map +1 -0
  274. package/dist/maintenance/path-policy.js +360 -0
  275. package/dist/maintenance/path-policy.js.map +1 -0
  276. package/dist/maintenance/plans.d.ts +366 -0
  277. package/dist/maintenance/plans.d.ts.map +1 -0
  278. package/dist/maintenance/plans.js +4060 -0
  279. package/dist/maintenance/plans.js.map +1 -0
  280. package/dist/maintenance/profile.d.ts +33 -0
  281. package/dist/maintenance/profile.d.ts.map +1 -0
  282. package/dist/maintenance/profile.js +99 -0
  283. package/dist/maintenance/profile.js.map +1 -0
  284. package/dist/maintenance/recovery.d.ts +38 -0
  285. package/dist/maintenance/recovery.d.ts.map +1 -0
  286. package/dist/maintenance/recovery.js +217 -0
  287. package/dist/maintenance/recovery.js.map +1 -0
  288. package/dist/maintenance/repair.d.ts +37 -0
  289. package/dist/maintenance/repair.d.ts.map +1 -0
  290. package/dist/maintenance/repair.js +183 -0
  291. package/dist/maintenance/repair.js.map +1 -0
  292. package/dist/maintenance/rule-drift.d.ts +104 -0
  293. package/dist/maintenance/rule-drift.d.ts.map +1 -0
  294. package/dist/maintenance/rule-drift.js +507 -0
  295. package/dist/maintenance/rule-drift.js.map +1 -0
  296. package/dist/maintenance/run-verification.d.ts +44 -0
  297. package/dist/maintenance/run-verification.d.ts.map +1 -0
  298. package/dist/maintenance/run-verification.js +253 -0
  299. package/dist/maintenance/run-verification.js.map +1 -0
  300. package/dist/maintenance/runs.d.ts +142 -0
  301. package/dist/maintenance/runs.d.ts.map +1 -0
  302. package/dist/maintenance/runs.js +439 -0
  303. package/dist/maintenance/runs.js.map +1 -0
  304. package/dist/maintenance/semantic-merge-discovery.d.ts +54 -0
  305. package/dist/maintenance/semantic-merge-discovery.d.ts.map +1 -0
  306. package/dist/maintenance/semantic-merge-discovery.js +308 -0
  307. package/dist/maintenance/semantic-merge-discovery.js.map +1 -0
  308. package/dist/maintenance/temporal.d.ts +44 -0
  309. package/dist/maintenance/temporal.d.ts.map +1 -0
  310. package/dist/maintenance/temporal.js +295 -0
  311. package/dist/maintenance/temporal.js.map +1 -0
  312. package/dist/models/client.d.ts +214 -0
  313. package/dist/models/client.d.ts.map +1 -0
  314. package/dist/models/client.js +904 -0
  315. package/dist/models/client.js.map +1 -0
  316. package/dist/models/provider-api.d.ts +28 -0
  317. package/dist/models/provider-api.d.ts.map +1 -0
  318. package/dist/models/provider-api.js +320 -0
  319. package/dist/models/provider-api.js.map +1 -0
  320. package/dist/open.d.ts +163 -0
  321. package/dist/open.d.ts.map +1 -0
  322. package/dist/open.js +382 -0
  323. package/dist/open.js.map +1 -0
  324. package/dist/ops/adopt.d.ts +12 -0
  325. package/dist/ops/adopt.d.ts.map +1 -0
  326. package/dist/ops/adopt.js +138 -0
  327. package/dist/ops/adopt.js.map +1 -0
  328. package/dist/ops/answer.d.ts +29 -0
  329. package/dist/ops/answer.d.ts.map +1 -0
  330. package/dist/ops/answer.js +557 -0
  331. package/dist/ops/answer.js.map +1 -0
  332. package/dist/ops/context.d.ts +18 -0
  333. package/dist/ops/context.d.ts.map +1 -0
  334. package/dist/ops/context.js +713 -0
  335. package/dist/ops/context.js.map +1 -0
  336. package/dist/ops/folder.d.ts +23 -0
  337. package/dist/ops/folder.d.ts.map +1 -0
  338. package/dist/ops/folder.js +130 -0
  339. package/dist/ops/folder.js.map +1 -0
  340. package/dist/ops/forget.d.ts +14 -0
  341. package/dist/ops/forget.d.ts.map +1 -0
  342. package/dist/ops/forget.js +212 -0
  343. package/dist/ops/forget.js.map +1 -0
  344. package/dist/ops/graph.d.ts +10 -0
  345. package/dist/ops/graph.d.ts.map +1 -0
  346. package/dist/ops/graph.js +480 -0
  347. package/dist/ops/graph.js.map +1 -0
  348. package/dist/ops/ingest.d.ts +40 -0
  349. package/dist/ops/ingest.d.ts.map +1 -0
  350. package/dist/ops/ingest.js +434 -0
  351. package/dist/ops/ingest.js.map +1 -0
  352. package/dist/ops/list.d.ts +9 -0
  353. package/dist/ops/list.d.ts.map +1 -0
  354. package/dist/ops/list.js +217 -0
  355. package/dist/ops/list.js.map +1 -0
  356. package/dist/ops/move.d.ts +20 -0
  357. package/dist/ops/move.d.ts.map +1 -0
  358. package/dist/ops/move.js +173 -0
  359. package/dist/ops/move.js.map +1 -0
  360. package/dist/ops/read.d.ts +9 -0
  361. package/dist/ops/read.d.ts.map +1 -0
  362. package/dist/ops/read.js +271 -0
  363. package/dist/ops/read.js.map +1 -0
  364. package/dist/ops/recall.d.ts +13 -0
  365. package/dist/ops/recall.d.ts.map +1 -0
  366. package/dist/ops/recall.js +297 -0
  367. package/dist/ops/recall.js.map +1 -0
  368. package/dist/ops/remember.d.ts +34 -0
  369. package/dist/ops/remember.d.ts.map +1 -0
  370. package/dist/ops/remember.js +660 -0
  371. package/dist/ops/remember.js.map +1 -0
  372. package/dist/ops/timeline.d.ts +11 -0
  373. package/dist/ops/timeline.d.ts.map +1 -0
  374. package/dist/ops/timeline.js +111 -0
  375. package/dist/ops/timeline.js.map +1 -0
  376. package/dist/ops/undo.d.ts +9 -0
  377. package/dist/ops/undo.d.ts.map +1 -0
  378. package/dist/ops/undo.js +38 -0
  379. package/dist/ops/undo.js.map +1 -0
  380. package/dist/ops/write.d.ts +55 -0
  381. package/dist/ops/write.d.ts.map +1 -0
  382. package/dist/ops/write.js +463 -0
  383. package/dist/ops/write.js.map +1 -0
  384. package/dist/recall/assemble.d.ts +81 -0
  385. package/dist/recall/assemble.d.ts.map +1 -0
  386. package/dist/recall/assemble.js +603 -0
  387. package/dist/recall/assemble.js.map +1 -0
  388. package/dist/recall/expand.d.ts +55 -0
  389. package/dist/recall/expand.d.ts.map +1 -0
  390. package/dist/recall/expand.js +282 -0
  391. package/dist/recall/expand.js.map +1 -0
  392. package/dist/recall/graph-arm.d.ts +17 -0
  393. package/dist/recall/graph-arm.d.ts.map +1 -0
  394. package/dist/recall/graph-arm.js +227 -0
  395. package/dist/recall/graph-arm.js.map +1 -0
  396. package/dist/recall/llm-rerank.d.ts +55 -0
  397. package/dist/recall/llm-rerank.d.ts.map +1 -0
  398. package/dist/recall/llm-rerank.js +213 -0
  399. package/dist/recall/llm-rerank.js.map +1 -0
  400. package/dist/recall/reranker-calibration.d.ts +23 -0
  401. package/dist/recall/reranker-calibration.d.ts.map +1 -0
  402. package/dist/recall/reranker-calibration.js +161 -0
  403. package/dist/recall/reranker-calibration.js.map +1 -0
  404. package/dist/recall/search.d.ts +107 -0
  405. package/dist/recall/search.d.ts.map +1 -0
  406. package/dist/recall/search.js +530 -0
  407. package/dist/recall/search.js.map +1 -0
  408. package/dist/reserved.d.ts +39 -0
  409. package/dist/reserved.d.ts.map +1 -0
  410. package/dist/reserved.js +63 -0
  411. package/dist/reserved.js.map +1 -0
  412. package/dist/rules/compile.d.ts +27 -0
  413. package/dist/rules/compile.d.ts.map +1 -0
  414. package/dist/rules/compile.js +105 -0
  415. package/dist/rules/compile.js.map +1 -0
  416. package/dist/setup/model-free.d.ts +15 -0
  417. package/dist/setup/model-free.d.ts.map +1 -0
  418. package/dist/setup/model-free.js +26 -0
  419. package/dist/setup/model-free.js.map +1 -0
  420. package/dist/setup/openai.d.ts +46 -0
  421. package/dist/setup/openai.d.ts.map +1 -0
  422. package/dist/setup/openai.js +165 -0
  423. package/dist/setup/openai.js.map +1 -0
  424. package/dist/store/db.d.ts +61 -0
  425. package/dist/store/db.d.ts.map +1 -0
  426. package/dist/store/db.js +265 -0
  427. package/dist/store/db.js.map +1 -0
  428. package/dist/store/ids.d.ts +29 -0
  429. package/dist/store/ids.d.ts.map +1 -0
  430. package/dist/store/ids.js +0 -0
  431. package/dist/store/ids.js.map +1 -0
  432. package/dist/store/migrations.d.ts +54 -0
  433. package/dist/store/migrations.d.ts.map +1 -0
  434. package/dist/store/migrations.js +923 -0
  435. package/dist/store/migrations.js.map +1 -0
  436. package/dist/store/vectors.d.ts +34 -0
  437. package/dist/store/vectors.d.ts.map +1 -0
  438. package/dist/store/vectors.js +158 -0
  439. package/dist/store/vectors.js.map +1 -0
  440. package/dist/timeline/documents.d.ts +23 -0
  441. package/dist/timeline/documents.d.ts.map +1 -0
  442. package/dist/timeline/documents.js +262 -0
  443. package/dist/timeline/documents.js.map +1 -0
  444. package/dist/watch/watcher.d.ts +43 -0
  445. package/dist/watch/watcher.d.ts.map +1 -0
  446. package/dist/watch/watcher.js +143 -0
  447. package/dist/watch/watcher.js.map +1 -0
  448. package/dist/write/atomic.d.ts +34 -0
  449. package/dist/write/atomic.d.ts.map +1 -0
  450. package/dist/write/atomic.js +58 -0
  451. package/dist/write/atomic.js.map +1 -0
  452. package/dist/write/conflict.d.ts +43 -0
  453. package/dist/write/conflict.d.ts.map +1 -0
  454. package/dist/write/conflict.js +149 -0
  455. package/dist/write/conflict.js.map +1 -0
  456. package/dist/write/edit.d.ts +59 -0
  457. package/dist/write/edit.d.ts.map +1 -0
  458. package/dist/write/edit.js +231 -0
  459. package/dist/write/edit.js.map +1 -0
  460. package/dist/write/gate.d.ts +59 -0
  461. package/dist/write/gate.d.ts.map +1 -0
  462. package/dist/write/gate.js +99 -0
  463. package/dist/write/gate.js.map +1 -0
  464. package/dist/write/journal.d.ts +90 -0
  465. package/dist/write/journal.d.ts.map +1 -0
  466. package/dist/write/journal.js +187 -0
  467. package/dist/write/journal.js.map +1 -0
  468. package/dist/write/ledger.d.ts +28 -0
  469. package/dist/write/ledger.d.ts.map +1 -0
  470. package/dist/write/ledger.js +141 -0
  471. package/dist/write/ledger.js.map +1 -0
  472. package/dist/write/placement.d.ts +29 -0
  473. package/dist/write/placement.d.ts.map +1 -0
  474. package/dist/write/placement.js +140 -0
  475. package/dist/write/placement.js.map +1 -0
  476. package/dist/write/remember-fallback.d.ts +18 -0
  477. package/dist/write/remember-fallback.d.ts.map +1 -0
  478. package/dist/write/remember-fallback.js +48 -0
  479. package/dist/write/remember-fallback.js.map +1 -0
  480. package/dist/write/retain.d.ts +61 -0
  481. package/dist/write/retain.d.ts.map +1 -0
  482. package/dist/write/retain.js +272 -0
  483. package/dist/write/retain.js.map +1 -0
  484. package/package.json +50 -0
  485. package/swift/extract.swift +232 -0
package/LICENSE ADDED
@@ -0,0 +1,83 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ Required Notice: Copyright 2026 Andrey Yamanov (https://github.com/tenphi/akno)
6
+
7
+ Akno is source-available, not open source. Personal and other noncommercial
8
+ use is free. Using it commercially — including as part of, or to operate, a
9
+ paid product or service — is not permitted under these terms. For a commercial
10
+ licence, ask.
11
+
12
+ Third-party dependencies are not covered by these terms. Each remains under
13
+ its own licence and the copyright of its own authors.
14
+
15
+ ## Acceptance
16
+
17
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
18
+
19
+ ## Copyright License
20
+
21
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
22
+
23
+ ## Distribution License
24
+
25
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
26
+
27
+ ## Notices
28
+
29
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
30
+
31
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
32
+
33
+ ## Changes and New Works License
34
+
35
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
36
+
37
+ ## Patent License
38
+
39
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
40
+
41
+ ## Noncommercial Purposes
42
+
43
+ Any noncommercial purpose is a permitted purpose.
44
+
45
+ ## Personal Uses
46
+
47
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
48
+
49
+ ## Noncommercial Organizations
50
+
51
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
52
+
53
+ ## Fair Use
54
+
55
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
56
+
57
+ ## No Other Rights
58
+
59
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
60
+
61
+ ## Patent Defense
62
+
63
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
64
+
65
+ ## Violations
66
+
67
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
68
+
69
+ ## No Liability
70
+
71
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
72
+
73
+ ## Definitions
74
+
75
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
76
+
77
+ **You** refers to the individual or entity agreeing to these terms.
78
+
79
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
80
+
81
+ **Your licenses** are all the licenses granted to you for the software under these terms.
82
+
83
+ **Use** means anything you do with the software requiring one of your licenses.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @tenphi/akno-core
2
+
3
+ The memory layer itself: config, store, indexer, models, recall, the write path, the watcher and the
4
+ maintenance cycle. This is the engine behind the [`@tenphi/akno`](https://www.npmjs.com/package/@tenphi/akno)
5
+ CLI, published separately so a host can embed it in-process.
6
+
7
+ macOS only (`"os": ["darwin"]`), and it carries native dependencies — `better-sqlite3` and `sqlite-vec`. A
8
+ host that only needs to _talk_ to a running Akno should depend on
9
+ [`@tenphi/akno-client`](https://www.npmjs.com/package/@tenphi/akno-client) instead, which is portable and
10
+ has no native code.
11
+
12
+ ```ts
13
+ import { open } from '@tenphi/akno-core';
14
+
15
+ const akno = await open({ aknoPath: '~/Notes' });
16
+ const result = await akno.call('recall', { query: 'car insurance renewal' });
17
+ ```
18
+
19
+ Exactly one process may hold the write handle. A second `open` on the same state directory returns a
20
+ read-only handle and says so, rather than racing a live watcher.
21
+
22
+ Full documentation: [github.com/tenphi/akno](https://github.com/tenphi/akno#readme)
23
+
24
+ ## License
25
+
26
+ PolyForm Noncommercial License 1.0.0 © Andrey Yamanov — noncommercial use only.
@@ -0,0 +1,548 @@
1
+ {
2
+ // ───────────────────────────────────────────────────────────────────────────
3
+ // Akno — committed defaults.
4
+ //
5
+ // This file is version-controlled and must stay machine-independent: no home
6
+ // paths, no endpoints, no credentials, no model ids that assume a particular
7
+ // server. Override anything here in `config/local.jsonc` (gitignored) or in
8
+ // `~/.akno/config.json`.
9
+ //
10
+ // Precedence, lowest to highest:
11
+ // config/default.jsonc → ~/.akno/config.json → config/local.jsonc → AKNO_* env
12
+ // ───────────────────────────────────────────────────────────────────────────
13
+
14
+ // The Markdown knowledge base. Null on purpose: Akno refuses to start
15
+ // rather than guessing which folder holds your notes.
16
+ "akno_path": null,
17
+
18
+ // Everything Akno derives — the index, the trash, the journal, logs, the
19
+ // socket. Deleting it costs one re-index and no data.
20
+ "state_dir": "~/.akno",
21
+
22
+ // ─── Reserved paths ───────────────────────────────────────────────────────
23
+ // Remappable so a collision with something you already have is resolvable.
24
+ // Relative to akno_path.
25
+ "paths": {
26
+ "timeline": "timeline.md",
27
+ "inbox": "inbox",
28
+ "observations": "observations",
29
+ "journal": "journal"
30
+ },
31
+
32
+ // Create `timeline.md` and `inbox/` on startup if missing. Off by default so
33
+ // a first run against an existing knowledge base changes nothing at all.
34
+ "create_reserved_paths": false,
35
+
36
+ // ─── Identity ─────────────────────────────────────────────────────────────
37
+ // Akno's only write into a page is a frontmatter `id:`. Off by default: the
38
+ // sidecar map in akno.db carries identity, and renames are followed by body
39
+ // hash. Turn this on for identity that survives `rm akno.db` and a move to
40
+ // another machine.
41
+ "write_ids": false,
42
+
43
+ // ─── Ingestion & structure ────────────────────────────────────────────────
44
+ // Directories never walked, at any depth.
45
+ "ignore": [".git", ".obsidian", ".trash", ".akno", "node_modules", ".DS_Store", ".stfolder", ".stversions"],
46
+ // Extensions indexed as pages. Everything else is an attachment candidate.
47
+ "page_extensions": [".md", ".markdown"],
48
+ // Bytes above which a page is chunked but not summarized or fact-mined.
49
+ "max_page_bytes": 1048576,
50
+
51
+ // ─── Declaring folders ────────────────────────────────────────────────────
52
+ // How deep a folder must be *described* before a page can appear in it. Not an approval:
53
+ // nothing here reaches the user. A write into an undeclared folder comes back
54
+ // `requires_folder`, the caller says what belongs there with the `folder` op — ungated —
55
+ // and repeats the write.
56
+ //
57
+ // "top-level" | "all" | "none". A folder the user makes by hand is theirs and is never
58
+ // questioned; this only sees what an agent creates.
59
+ "gate": "top-level",
60
+ // Below this score `remember` and inbox routing propose instead of writing.
61
+ // 0.5 is a starting default, not a measured one.
62
+ "route_threshold": 0.5,
63
+ // "ledger" | "daily" — where an event with no page behind it lands.
64
+ "loose_events": "ledger",
65
+ // "none" | "summary" | "all" — write derived data back into frontmatter as a
66
+ // body-hash-keyed cache. Visible in Obsidian; a stale entry is never trusted.
67
+ "derived_in_frontmatter": "none",
68
+
69
+ // ─── Providers ────────────────────────────────────────────────────────────
70
+ // Any OpenAI-compatible endpoint. `api_key` names an env var; it never holds
71
+ // a key. One local server can host every role.
72
+ // Null endpoint on purpose: committed defaults assume nothing about this
73
+ // machine, not even that something is listening on a well-known port. Set this
74
+ // in config/local.jsonc — `akno doctor` reports every role that has no
75
+ // endpoint and what its absence costs.
76
+ "providers": {
77
+ "local": {
78
+ "base_url": null,
79
+ "api_key": null,
80
+ // Generative transport only; embeddings and native reranking keep their
81
+ // dedicated endpoints. Third-party OpenAI-compatible servers default to
82
+ // Chat Completions. Use "auto" to run one invented capability probe and
83
+ // cache the result; the guided OpenAI preset explicitly uses Responses.
84
+ "api": "chat_completions",
85
+ // Retries after a rate limit (429) or a transient server error (500, 502,
86
+ // 503, 504), with exponential backoff and full jitter. A `Retry-After`
87
+ // header is obeyed when one is sent.
88
+ //
89
+ // What it costs to change: on the recall path, nothing — `recall.expansion_
90
+ // timeout_ms` is the budget for the whole sequence, so a retry happens only
91
+ // if there is time left inside it and a retrying recall can never be slower
92
+ // than one with retries off.
93
+ //
94
+ // Everywhere else a role's `timeout_ms` is per *attempt*, because it is a
95
+ // backstop against an endpoint that has gone quiet and nothing waits on a
96
+ // background derivation. So this multiplies the worst case: 2 against
97
+ // derive's 300s is 900s plus backoff for one page, in the case where an
98
+ // endpoint returns a slow 5xx three times running. Lower it if that matters
99
+ // more than the page; 0 turns retrying off entirely.
100
+ //
101
+ // A timeout is never retried: the attempt has already spent its deadline,
102
+ // and the callers that care have a better answer than repetition (a
103
+ // derivation that times out asks for the summary alone, which is cheaper
104
+ // *and* likelier to land than the identical request a second time).
105
+ "max_retries": 2
106
+ }
107
+ },
108
+
109
+ // ─── Models ───────────────────────────────────────────────────────────────
110
+ // Six roles, all optional, each degrading rather than failing. `id: null`
111
+ // means the role is unconfigured — Akno reports it in `doctor` and takes
112
+ // the documented degraded path.
113
+ "models": {
114
+ // Without it: lexical search only.
115
+ "embedding": {
116
+ "provider": "local",
117
+ "id": null,
118
+ "dimensions": 1024,
119
+ "batch": 32,
120
+ "timeout_ms": 60000
121
+ },
122
+ // Without it: hybrid score ordering.
123
+ "reranker": {
124
+ "provider": "local",
125
+ "id": null,
126
+ "enabled": false,
127
+ // "endpoint" calls a native cross-encoder at /rerank. "llm" uses the
128
+ // versioned Akno listwise prompt over the provider's generative transport.
129
+ "mode": "endpoint",
130
+ // A successful reranker may remove confidently irrelevant candidates.
131
+ // Unjudged candidates outside top_k are omitted rather than used to fill
132
+ // the holes, because the model made no qualification claim about them.
133
+ "exclude_irrelevant": true,
134
+ // Candidates re-scored. This is the reranker's whole latency dial: cost is
135
+ // per candidate, not per character. Measured on 223 pages against a local
136
+ // bge-reranker-v2-m3, over 8 queries, compared to top_k 40:
137
+ //
138
+ // top_k 40 1036 ms (reference)
139
+ // top_k 30 886 ms same top hit every time, 36/40 results unchanged
140
+ // top_k 20 646 ms one different top hit, 30/40 results unchanged
141
+ //
142
+ // 40 is the default because the cheaper settings change *which pages come
143
+ // back*, and 400 ms is not worth a different answer. Lower it if you would
144
+ // rather have the latency, now that you know what it costs.
145
+ //
146
+ // LLM mode still sends exactly top_k candidates. It preserves the first
147
+ // top_k - 1 fused hits and uses the final slot for the strongest vector-ranked
148
+ // candidate from a bounded 2 × top_k pool. This recovers a strong paraphrase
149
+ // just beyond the fusion boundary without increasing model tokens.
150
+ "top_k": 40,
151
+ // Characters of each candidate sent. Measured free — truncating from 4,000 to
152
+ // 800 changed neither latency (1036 → 1028 ms) nor a single result. Kept
153
+ // because it bounds the request payload and costs nothing: a cross-encoder's
154
+ // relevance signal is front-loaded.
155
+ "max_chars": 800,
156
+ // Native endpoints do not share a score scale. "auto" learns a conservative
157
+ // boundary from invented anchors, caches it for seven days, and refuses to
158
+ // filter if those anchors do not separate. A measured number overrides it.
159
+ "score_offset": "auto",
160
+ // Used only by mode "llm". Set reasoning explicitly for hosted reasoning
161
+ // models so ranking latency and cost do not inherit a provider default.
162
+ "max_output_tokens": 1600,
163
+ "reasoning_effort": null,
164
+ "timeout_ms": 30000
165
+ },
166
+ // The quality role: page summaries, keywords, fact derivation, `remember`,
167
+ // naming an arrival, and every maintenance tier. None of it is on the recall
168
+ // path, so this one is allowed to be slow and good.
169
+ //
170
+ // Without it: no summaries, no keywords, no fact derivation, no `remember`,
171
+ // no naming, no observations. Recall still works.
172
+ "derive": {
173
+ "provider": "local",
174
+ "id": null,
175
+ // A ceiling on this role, and the *lower* of it and what a task asks for is what gets sent.
176
+ // 2400 because that is what a full page derivation needs to answer in JSON — a summary,
177
+ // keywords, and every durable claim on the page. Lower it and long pages start returning
178
+ // truncated JSON, which costs their facts (the summary is recovered on its own). Every
179
+ // cheaper caller already asks for less and is unaffected: 700 for an observation, 500 to name
180
+ // an arrival, 200 for a conflict verdict.
181
+ "max_output_tokens": 2400,
182
+ // null uses the provider default. Hosted reasoning models can set one of
183
+ // "none", "low", "medium", "high", "xhigh", or "max" per role.
184
+ "reasoning_effort": null,
185
+ // Pages derived at once during a sweep. Raise it for a bigger endpoint;
186
+ // a single local server usually does no better than 2.
187
+ "concurrency": 2,
188
+ "timeout_ms": 120000
189
+ },
190
+ // The latency role: query expansion, and nothing else. It runs on every
191
+ // recall that asks for it, so a small fast model is the right answer here
192
+ // even when `derive` points at something much stronger. Pointing both at one
193
+ // model is fine too.
194
+ //
195
+ // Without it: recall searches the words you typed and nothing more.
196
+ "expansion": {
197
+ "provider": "local",
198
+ "id": null,
199
+ // Expansion asks for 400; this only has to be above it.
200
+ "max_output_tokens": 1024,
201
+ "reasoning_effort": null,
202
+ "concurrency": 2,
203
+ // A backstop, not the deadline — `recall.expansion_timeout_ms` governs a
204
+ // call. This one only catches an endpoint that accepts and goes quiet.
205
+ "timeout_ms": 30000
206
+ },
207
+ // Direct grounded synthesis. If this block is omitted from an overlay,
208
+ // Akno inherits the derive model so an existing single-endpoint setup
209
+ // does not need another model declaration. A separate role lets interactive
210
+ // answering keep a smaller output ceiling and timeout.
211
+ "answer": {
212
+ "provider": "local",
213
+ "id": null,
214
+ "max_output_tokens": 1024,
215
+ "reasoning_effort": null,
216
+ "concurrency": 2,
217
+ "timeout_ms": 60000
218
+ },
219
+ // Off by default. OCR covers scans and screenshots, which is most arrivals.
220
+ "vision": {
221
+ "provider": "local",
222
+ "id": null,
223
+ "enabled": false,
224
+ "reasoning_effort": null,
225
+ "timeout_ms": 120000
226
+ }
227
+ },
228
+
229
+ // ─── Indexing ─────────────────────────────────────────────────────────────
230
+ "index": {
231
+ // Chunks follow the document's own headings; these are the size gates.
232
+ "chunk_target_chars": 1200,
233
+ "chunk_max_chars": 4000,
234
+ "chunk_overlap_chars": 120,
235
+ // Model-backed derivation. Each is independently skippable, and skipping
236
+ // one degrades a feature rather than failing the index.
237
+ "summaries": true,
238
+ "facts": true,
239
+ // Files hashed concurrently during a sweep.
240
+ "hash_concurrency": 8,
241
+ // Switch on sqlite-vec's ANN index above this many chunks. Brute force is
242
+ // strictly better below it.
243
+ "ann_threshold_chunks": 20000
244
+ },
245
+
246
+ // ─── Evidence graph ─────────────────────────────────────────────────────
247
+ "graph": {
248
+ "contextual_resolution": {
249
+ // Exact aliases remain the default. Turn this on only after
250
+ // `akno bench entities` passes against the configured derive model.
251
+ // The model may choose among existing exact-name candidates or abstain;
252
+ // it cannot create, merge, or rename entities.
253
+ "enabled": false,
254
+ "max_candidates": 8,
255
+ "max_mentions_per_index": 20,
256
+ "reasoning_effort": "none"
257
+ }
258
+ },
259
+
260
+ // ─── Recall ───────────────────────────────────────────────────────────────
261
+ "recall": {
262
+ "default_budget": 8000,
263
+ "default_limit": 8,
264
+ // Candidates pulled from each arm of the hybrid search before fusion.
265
+ "candidates_per_arm": 60,
266
+ // Lines of body returned per card in lookup mode.
267
+ "line_window": 6,
268
+ // Hard cap on what a `source` page contributes unprompted. A guess, not a
269
+ // measurement.
270
+ "source_quote_lines": 6,
271
+ // Query expansion — off means the query is searched verbatim.
272
+ "expansion": true,
273
+ // Expansion is optional, so it gets its own short deadline rather than the
274
+ // role's ceiling. A recall that waits two minutes for an optional model call has
275
+ // failed at its job; past this it degrades and searches the query verbatim.
276
+ "expansion_timeout_ms": 4000,
277
+ // Add bounded exact evidence paths as a third candidate arm. Candidates still
278
+ // pass through ordinary rank fusion, reranking, qualification, and budgeting.
279
+ "graph": true,
280
+ // Multiplied into the final score at assembly, not at search.
281
+ "rank": {
282
+ "knowledge": 1,
283
+ "source": 0.85,
284
+ "inference": 0.6
285
+ }
286
+ },
287
+
288
+ // ─── Watching ─────────────────────────────────────────────────────────────
289
+ "watch": {
290
+ "enabled": true,
291
+ // FSEvents coalesces; this debounce collapses an editor's write storm.
292
+ "debounce_ms": 400,
293
+ // The correctness path. FSEvents can drop events after sleep/wake or a
294
+ // large sync, so a periodic stat sweep is the backstop, not the watcher.
295
+ "sweep_interval_ms": 300000,
296
+ // Full hash sweep — catches a sync client or restore that preserved mtime.
297
+ "verify_interval_ms": 3600000
298
+ },
299
+
300
+ // ─── The maintenance cycle ────────────────────────────────────────────────
301
+ // Retain runs per turn; observe, reflect and curate run in `akno dream`.
302
+ // Phases are independent and each is safe to re-run.
303
+ //
304
+ // A **mission** appends emphasis to a fixed system prompt and never replaces
305
+ // it. That is a guardrail, not a convenience: every rule that keeps an
306
+ // inference engine honest lives in the fixed part, and a replaceable prompt is
307
+ // how they all get lost at once.
308
+ "maintenance": {
309
+ // A named profile is the authority ceiling for the complete scheduled cycle:
310
+ // audit plans only, review waits for a human, autonomous uses the separate curator
311
+ // and applies accepted work. New installations start in audit until the owner chooses
312
+ // a more authoritative profile.
313
+ // In a full named-profile/policy run, every phase plan is sealed before automatic apply.
314
+ "profile": "audit",
315
+ // Optional per-class authority: off, audit, review, or auto. Omitted classes
316
+ // inherit the profile and explicit values may only lower it.
317
+ "policies": {},
318
+ // Cumulative apply ceilings shared by plan-backed observe, reflect, curate, and adopt
319
+ // in one invocation.
320
+ // Planning remains complete; an indivisible item that would cross a ceiling
321
+ // stays proposed with a typed budget_exhausted reason for a later run.
322
+ "limits": {
323
+ "max_items": 30,
324
+ "max_files_changed": 40,
325
+ "max_bytes_written": 500000,
326
+ "max_high_risk_items": 3
327
+ },
328
+ // Terminal plans keep exact private operations and evidence for short-term review,
329
+ // then retain only compact decisions, hashes, and verification receipts. Active,
330
+ // review, apply, and recovery states never expire through this policy.
331
+ "plan_retention": {
332
+ "payload_days": 30,
333
+ "receipt_days": 180
334
+ },
335
+ // The model the cycle uses, when it should not be the one indexing uses.
336
+ // Not a role of its own — the same capability as `derive`, pointed somewhere
337
+ // else for the one caller that runs unattended.
338
+ //
339
+ // This is worth setting. Measured on a real 223-page base: the observe tier
340
+ // produced 15 candidates worth about four with a local 3B, and 8 candidates
341
+ // with no guardrail violations at all with a strong model. A knowledge base
342
+ // that wants a good model once a night should not thereby send every recall
343
+ // expansion to a paid API.
344
+ //
345
+ // "model": { "provider": "openai", "id": "gpt-5.6" }
346
+ "model": null,
347
+ // Local macOS notifications for scheduled runs. "actionable" reports only
348
+ // review backlog, failed/incomplete work, persistent budget deferral, repeated
349
+ // model degradation, or a missed cycle. "all" also confirms quiet success.
350
+ // Page text, paths, diffs, prompts, and model responses are never included.
351
+ "notifications": "off",
352
+ // Retain is the `remember` op, available per-turn — the tier that needs
353
+ // to be fresh does not wait for a timer. `dream` does not re-run it.
354
+ // Write every run down — what was applied, what a guardrail refused, what was
355
+ // skipped and why — to <state_dir>/logs/dream.jsonl, one JSON object per run.
356
+ //
357
+ // Off by default on purpose. A log of inferences drawn from private notes is a
358
+ // second copy of the sensitive part, kept outside the notes. It is genuinely
359
+ // useful while you are deciding whether to trust the cycle; that is a decision
360
+ // for whoever owns the notes, not for a default.
361
+ "log_changes": false,
362
+
363
+ "retain": {
364
+ "enabled": true,
365
+ "mission": null,
366
+ // Optional exact page slug for durable claims that have no ordinary admitted destination.
367
+ // The page itself must allow remember integration, or its parent folder must explicitly
368
+ // allow creation. Reserved pages such as the event timeline are never valid fallbacks.
369
+ "fallback_page": null
370
+ },
371
+ // Combine repeated facts into stable patterns. Writes pages under
372
+ // `observations/` with `derived: true` and the evidence it used, appending
373
+ // only: a changed pattern gets a new dated line and nothing is deleted.
374
+ //
375
+ // Off by default from measurement, not caution. On a real 223-page knowledge
376
+ // base with a local 3B model, one run produced 18 candidate patterns of
377
+ // which about three were worth keeping — and every one of them would have
378
+ // been recalled later as truth. The guardrails hold; what they cannot do is
379
+ // make a small model insightful. Turn this on with a model you have watched
380
+ // produce patterns worth having, and read the first run with `--dry-run`.
381
+ "observe": {
382
+ "enabled": false,
383
+ "mission": null,
384
+ // Distinct source pages an observation needs. Two is the floor and the
385
+ // schema refuses less: one page agreeing with itself is not a pattern.
386
+ "min_evidence": 2,
387
+ // Subjects looked at per run, most recently touched first.
388
+ "max_subjects": 40
389
+ },
390
+ // Ships as an extension point, off by default. At a few hundred pages
391
+ // and a handful of events a month, a "pattern" is one coincidence away from
392
+ // noise. Switch it on when a knowledge base has the volume, not before.
393
+ "reflect": {
394
+ "enabled": false,
395
+ "mission": null
396
+ },
397
+ // Page-owned curation. Only knowledge pages with an explicit frontmatter
398
+ // `akno.management.dream` of `hygiene` or `synthesize` are candidates. Input
399
+ // fingerprints skip unchanged pages; synthesis also fingerprints linked evidence
400
+ // and conflicts, and an accepted preview reruns once when writes are enabled. Bounded
401
+ // events gain a journalled `akno.temporal` boundary; after it passes, only strong
402
+ // post-event evidence wakes one archival assessment instead of another planning pass.
403
+ // The draft is checked by a second model pass and deterministic guards.
404
+ // The profile/policy matrix controls durable exact plans for hygiene and synthesis
405
+ // pages, including atomic canonical-page splits, extraction of a reusable subject
406
+ // into an independent page, and exact-alias merge inside an eligible folder.
407
+ "curate": {
408
+ "verify": true,
409
+ "max_pages": 8,
410
+ // Structural operations are separately bounded across the whole run.
411
+ "max_splits": 3,
412
+ "max_extracts": 3,
413
+ // Merge is higher risk and therefore needs an explicit folder allowlist.
414
+ // Use ["*"] only when every synthesize-opted knowledge folder is eligible.
415
+ "max_merges": 2,
416
+ // Exact scalar type correction and explicitly routed max-depth relocation share this cap.
417
+ "max_rule_drifts": 20,
418
+ "merge_folders": [],
419
+ // "exact" uses aliases and conservative graph subjects. "semantic" additionally
420
+ // runs the qualified embedding prefilter and strict candidate classifier.
421
+ "merge_discovery": "exact",
422
+ "max_children_per_page": 2,
423
+ // Split only large canonical pages into substantial subordinate sections.
424
+ "split_after_bytes": 16384,
425
+ "split_section_bytes": 8192,
426
+ // Extract one reusable subject into an existing integrated-knowledge folder.
427
+ "extract_after_bytes": 8192,
428
+ "extract_section_bytes": 1024
429
+ },
430
+ // Give a document that no page owns a page of its own, beside the file, from
431
+ // the summary extraction already produced. Orphan text is directly recallable;
432
+ // adoption adds a browsable home, page metadata, and richer future organization.
433
+ // Honours a folder rule of `ingest: "file"`, which exists for exactly the case
434
+ // where a stub page per file would be noise — and never touches the file itself.
435
+ "adopt": {
436
+ // A folder of 500 unowned PDFs should not become 500 pages overnight before
437
+ // anyone has read the first report.
438
+ "max_pages": 20
439
+ },
440
+ // The thorough pass: facts on different pages that state different values
441
+ // for the same thing — which inline checking cannot see, because neither page
442
+ // is being written. Classification itself never rewrites a claim. When
443
+ // plan-backed curate is enabled, guarded contradiction items may represent
444
+ // or resolve the typed result on pages that explicitly allow synthesis.
445
+ "conflicts": {
446
+ "enabled": true,
447
+ // Ask a model whether a candidate pair really conflicts. Off leaves
448
+ // every candidate reported as `unverified`, which is honest and cheaper.
449
+ "verify": true,
450
+ // Include high-risk contradiction items in audit/review/auto curation plans.
451
+ // Model confidence cannot authorize supersession: the current claim must
452
+ // carry an explicit dated as-of/effective/from/since boundary, and every affected page
453
+ // must declare `dream: synthesize`. Qualification requires an exact scope phrase
454
+ // and the broad claim's exact value in a distinct sealed evidence claim.
455
+ "resolve": true,
456
+ "max_pairs": 40
457
+ },
458
+ // Broken links use the same durable plan lifecycle as curation and contradictions:
459
+ // exact evidence, curator or human decision, stale checks, one journal per item,
460
+ // and post-write verification. `links` includes them in curate plans. `enabled`
461
+ // keeps the report-only `repair` phase available for compatibility.
462
+ "repair": {
463
+ "enabled": false,
464
+ "links": true,
465
+ "max_changes": 25
466
+ }
467
+ },
468
+
469
+ // ─── Doors ────────────────────────────────────────────────────────────────
470
+ "server": {
471
+ // Unix socket, relative to state_dir. Filesystem permissions are the auth.
472
+ "socket": "akno.sock",
473
+ // Loopback HTTP for sandboxed or remote agents. Null = off.
474
+ "http": null,
475
+ // Ops an MCP caller may invoke. Trust is a parameter, not a property of the
476
+ // transport — the same code runs with different permissions. Add "adopt" to
477
+ // expose only the document-scoped, plan-backed filing action to an agent.
478
+ "mcp_allow": ["recall", "answer", "read", "list", "timeline", "context", "graph"]
479
+ },
480
+
481
+ // ─── Ingest ───────────────────────────────────────────────────────────────
482
+ "ingest": {
483
+ "max_file_mb": 25,
484
+ // Pages OCR'd before stopping. A 200-page scan need not be fully searchable to
485
+ // be findable, and the ingest report says how many were read. Measured on this
486
+ // hardware: ~0.6s per page through the Vision framework.
487
+ "max_ocr_pages": 12,
488
+ // The second naming guard: below this, the file keeps its name, gets no page, and is
489
+ // reported — rather than being given a confident wrong name. Renaming is the one
490
+ // destructive thing ingest does, so the bias is toward not doing it.
491
+ "name_confidence": 0.55,
492
+ // Keep the extracted text as `<file>.txt` beside the file it came from, so anything that
493
+ // is not Akno — a grep, an editor, a git diff, an agent with a folder and no socket —
494
+ // can read a scanned contract without OCRing it again. Akno itself never needs this:
495
+ // the text is indexed against the document and `read({document})` returns all of it.
496
+ //
497
+ // Off, because the folder is the user's and this is the only setting that would put a
498
+ // file next to every document on a first run. On, a rendition is recognised as the same
499
+ // document rather than a second one, so it costs no extra summary and returns no second
500
+ // hit — and one that was edited by hand is left alone rather than overwritten.
501
+ "text_rendition": false,
502
+ // Under this, the page beside the document already says everything the document does, and
503
+ // a second file is clutter. Roughly one chunk: below `index.chunk_target_chars`.
504
+ "text_rendition_min_chars": 1000,
505
+ // Executables and installers. Not a security boundary — Akno never runs what
506
+ // it ingests — but a `.dmg` filed as a memory is a mistake worth refusing.
507
+ "blocked_extensions": [
508
+ "exe",
509
+ "dll",
510
+ "so",
511
+ "dylib",
512
+ "app",
513
+ "pkg",
514
+ "dmg",
515
+ "msi",
516
+ "bat",
517
+ "cmd",
518
+ "com",
519
+ "scr",
520
+ "jar",
521
+ "sh",
522
+ "bash",
523
+ "zsh",
524
+ "ps1"
525
+ ]
526
+ },
527
+
528
+ // How long a deleted page or document is recoverable from trash.
529
+ "trash_retention_days": 30,
530
+
531
+ // ─── Rules ────────────────────────────────────────────────────────────────
532
+ // Glob-scoped, most-specific-wins. Empty by default: Akno ships no folder
533
+ // taxonomy. A knowledge base with no rules at all works — every page has the
534
+ // searchable `knowledge` role, but `remember` cannot inject facts until a page or
535
+ // folder explicitly sets `remember: "integrate"`. Rules at `<akno_path>/akno.jsonc`
536
+ // win over these, so they can travel with the notes.
537
+ //
538
+ // `route: true` is what turns a folder into an inbox: files dropped there are
539
+ // extracted, named, and *moved* to wherever they belong. It is the only place
540
+ // Akno moves files — a file dropped straight into `documents/` was put there
541
+ // on purpose. Empty here because automatic filing should be opt-in:
542
+ //
543
+ // "inbox/**": { "ingest": "auto", "route": true }
544
+ // A max_depth rule remains diagnostic unless the same rule also names `relocate_to`.
545
+ // That explicit folder authorizes a byte-preserving, link-safe relocation; Akno never
546
+ // invents a destination from the depth or slug pattern alone.
547
+ "folders": {}
548
+ }