oh-my-second-brain 0.1.8 → 0.2.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 (466) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.ko.md +127 -0
  3. package/README.md +128 -0
  4. package/adapters/README.md +8 -8
  5. package/adapters/claude-code/.claude-plugin/plugin.json +3 -2
  6. package/adapters/claude-code/.mcp.json +8 -0
  7. package/adapters/claude-code/CLAUDE.md +5 -6
  8. package/adapters/claude-code/skills/compile/SKILL.md +10 -35
  9. package/adapters/claude-code/skills/distill/SKILL.md +6 -26
  10. package/adapters/claude-code/skills/link/SKILL.md +87 -0
  11. package/adapters/claude-code/skills/retrieve/SKILL.md +4 -7
  12. package/adapters/claude-code/skills/setup/SKILL.md +5 -6
  13. package/adapters/claude-code/skills/uninstall/SKILL.md +1 -1
  14. package/adapters/claude-code/skills/wiki/SKILL.md +49 -24
  15. package/adapters/claude-code/skills/write/SKILL.md +16 -0
  16. package/adapters/codex/.codex-plugin/plugin.json +1 -1
  17. package/adapters/codex/AGENTS.md +2 -2
  18. package/adapters/codex/rules/oms.md +1 -1
  19. package/adapters/codex/skills/oms-compile/SKILL.md +7 -9
  20. package/adapters/codex/skills/oms-distill/SKILL.md +4 -9
  21. package/adapters/codex/skills/oms-link/SKILL.md +35 -0
  22. package/adapters/codex/skills/oms-retrieve/SKILL.md +5 -6
  23. package/adapters/codex/skills/oms-wiki/SKILL.md +28 -8
  24. package/adapters/codex/skills/oms-write/SKILL.md +10 -0
  25. package/adapters/hermes/README.md +3 -1
  26. package/adapters/hermes/SOUL.md +2 -3
  27. package/adapters/hermes/manifest.json +1 -1
  28. package/adapters/hermes/skills/compile/SKILL.md +5 -7
  29. package/adapters/hermes/skills/distill/SKILL.md +1 -3
  30. package/adapters/hermes/skills/link/SKILL.md +18 -0
  31. package/adapters/hermes/skills/retrieve/SKILL.md +5 -6
  32. package/adapters/hermes/skills/setup/SKILL.md +5 -2
  33. package/adapters/hermes/skills/wiki/SKILL.md +4 -2
  34. package/adapters/hermes/skills/write/SKILL.md +10 -0
  35. package/core/AGENTS.md +4 -2
  36. package/core/agents/librarian.md +3 -2
  37. package/core/ontology/concepts/term.yaml +12 -0
  38. package/core/ontology/taxonomy.yaml +3 -0
  39. package/core/skills/compile/SKILL.md +19 -18
  40. package/core/skills/distill/SKILL.md +13 -24
  41. package/core/skills/link/SKILL.md +130 -0
  42. package/core/skills/retrieve/SKILL.md +0 -1
  43. package/core/skills/setup/SKILL.md +12 -14
  44. package/core/skills/vault-lint/SKILL.md +1 -1
  45. package/core/skills/wiki/SKILL.md +109 -30
  46. package/core/skills/write/SKILL.md +15 -0
  47. package/dist/capture/safe.d.ts +61 -1
  48. package/dist/capture/safe.js +489 -66
  49. package/dist/capture/safe.js.map +1 -1
  50. package/dist/cli/args.d.ts +29 -0
  51. package/dist/cli/args.js +156 -0
  52. package/dist/cli/args.js.map +1 -0
  53. package/dist/cli/audit.d.ts +6 -0
  54. package/dist/cli/audit.js +93 -0
  55. package/dist/cli/audit.js.map +1 -0
  56. package/dist/cli/claude-install-plan.d.ts +10 -0
  57. package/dist/cli/claude-install-plan.js +26 -0
  58. package/dist/cli/claude-install-plan.js.map +1 -0
  59. package/dist/cli/doctor-lint.d.ts +11 -0
  60. package/dist/cli/doctor-lint.js +86 -0
  61. package/dist/cli/doctor-lint.js.map +1 -0
  62. package/dist/cli/global-writeback.d.ts +31 -0
  63. package/dist/cli/global-writeback.js +73 -0
  64. package/dist/cli/global-writeback.js.map +1 -0
  65. package/dist/cli/host-commands.d.ts +30 -0
  66. package/dist/cli/host-commands.js +89 -0
  67. package/dist/cli/host-commands.js.map +1 -0
  68. package/dist/cli/link-command.d.ts +9 -0
  69. package/dist/cli/link-command.js +47 -0
  70. package/dist/cli/link-command.js.map +1 -0
  71. package/dist/cli/linkify.d.ts +23 -0
  72. package/dist/cli/linkify.js +118 -0
  73. package/dist/cli/linkify.js.map +1 -0
  74. package/dist/cli/oms.d.ts +8 -32
  75. package/dist/cli/oms.js +100 -703
  76. package/dist/cli/oms.js.map +1 -1
  77. package/dist/cli/semantic-args.d.ts +1 -2
  78. package/dist/cli/semantic-args.js +4 -7
  79. package/dist/cli/semantic-args.js.map +1 -1
  80. package/dist/cli/semantic-http.d.ts +0 -3
  81. package/dist/cli/semantic-http.js +40 -45
  82. package/dist/cli/semantic-http.js.map +1 -1
  83. package/dist/cli/semantic-usage.js +10 -9
  84. package/dist/cli/semantic-usage.js.map +1 -1
  85. package/dist/cli/semantic.js +99 -137
  86. package/dist/cli/semantic.js.map +1 -1
  87. package/dist/cli/setup-command.d.ts +11 -0
  88. package/dist/cli/setup-command.js +196 -0
  89. package/dist/cli/setup-command.js.map +1 -0
  90. package/dist/cli/setup-documents.d.ts +15 -0
  91. package/dist/cli/setup-documents.js +149 -0
  92. package/dist/cli/setup-documents.js.map +1 -0
  93. package/dist/cli/update-notice.d.ts +10 -0
  94. package/dist/cli/update-notice.js +42 -0
  95. package/dist/cli/update-notice.js.map +1 -0
  96. package/dist/cli/usage.d.ts +4 -0
  97. package/dist/cli/usage.js +102 -0
  98. package/dist/cli/usage.js.map +1 -0
  99. package/dist/conventions/lint.js +12 -33
  100. package/dist/conventions/lint.js.map +1 -1
  101. package/dist/conventions/report.d.ts +62 -0
  102. package/dist/conventions/report.js +217 -0
  103. package/dist/conventions/report.js.map +1 -0
  104. package/dist/conventions/validate.d.ts +1 -1
  105. package/dist/conventions/vault-walk.d.ts +38 -0
  106. package/dist/conventions/vault-walk.js +80 -0
  107. package/dist/conventions/vault-walk.js.map +1 -0
  108. package/dist/conventions/write-contract.d.ts +27 -0
  109. package/dist/conventions/write-contract.js +91 -0
  110. package/dist/conventions/write-contract.js.map +1 -0
  111. package/dist/conventions/write-protocol.d.ts +39 -0
  112. package/dist/conventions/write-protocol.js +44 -0
  113. package/dist/conventions/write-protocol.js.map +1 -0
  114. package/dist/core/ontology/loader.d.ts +2 -0
  115. package/dist/{ontology → core/ontology}/loader.js +11 -20
  116. package/dist/core/ontology/loader.js.map +1 -0
  117. package/dist/core/ontology/resolver.d.ts +2 -0
  118. package/dist/{ontology → core/ontology}/resolver.js +1 -15
  119. package/dist/core/ontology/resolver.js.map +1 -0
  120. package/dist/core/ontology/types.d.ts +47 -0
  121. package/dist/core/ontology/types.js +2 -0
  122. package/dist/core/ontology/types.js.map +1 -0
  123. package/dist/core/runtime/assets.d.ts +20 -0
  124. package/dist/core/runtime/assets.js +66 -0
  125. package/dist/core/runtime/assets.js.map +1 -0
  126. package/dist/engine/assemble.d.ts +28 -72
  127. package/dist/engine/assemble.js +77 -61
  128. package/dist/engine/assemble.js.map +1 -1
  129. package/dist/engine/conventions/vault-lint.d.ts +30 -2
  130. package/dist/engine/conventions/vault-lint.js +93 -97
  131. package/dist/engine/conventions/vault-lint.js.map +1 -1
  132. package/dist/engine/embed/deferred.d.ts +3 -4
  133. package/dist/engine/embed/deferred.js +10 -7
  134. package/dist/engine/embed/deferred.js.map +1 -1
  135. package/dist/engine/embed/identity.d.ts +11 -0
  136. package/dist/engine/embed/identity.js +15 -0
  137. package/dist/engine/embed/identity.js.map +1 -0
  138. package/dist/engine/embed/provider.d.ts +12 -13
  139. package/dist/engine/embed/provider.js +30 -27
  140. package/dist/engine/embed/provider.js.map +1 -1
  141. package/dist/engine/embed/store.d.ts +48 -27
  142. package/dist/engine/embed/store.js +281 -98
  143. package/dist/engine/embed/store.js.map +1 -1
  144. package/dist/engine/embed/sync.d.ts +17 -47
  145. package/dist/engine/embed/sync.js +233 -69
  146. package/dist/engine/embed/sync.js.map +1 -1
  147. package/dist/engine/graph/builder.d.ts +1 -1
  148. package/dist/engine/graph/builder.js +1 -1
  149. package/dist/engine/graph/explore.d.ts +2 -2
  150. package/dist/engine/graph/explore.js +0 -0
  151. package/dist/engine/graph/resolver.d.ts +17 -0
  152. package/dist/engine/graph/resolver.js +46 -11
  153. package/dist/engine/graph/resolver.js.map +1 -1
  154. package/dist/engine/linkify/apply.d.ts +56 -0
  155. package/dist/engine/linkify/apply.js +65 -0
  156. package/dist/engine/linkify/apply.js.map +1 -0
  157. package/dist/engine/linkify/josa.d.ts +58 -0
  158. package/dist/engine/linkify/josa.js +133 -0
  159. package/dist/engine/linkify/josa.js.map +1 -0
  160. package/dist/engine/linkify/mask.d.ts +29 -0
  161. package/dist/engine/linkify/mask.js +173 -0
  162. package/dist/engine/linkify/mask.js.map +1 -0
  163. package/dist/engine/linkify/suggest.d.ts +52 -0
  164. package/dist/engine/linkify/suggest.js +181 -0
  165. package/dist/engine/linkify/suggest.js.map +1 -0
  166. package/dist/engine/linkify/types.d.ts +68 -0
  167. package/dist/engine/linkify/types.js +12 -0
  168. package/dist/engine/linkify/types.js.map +1 -0
  169. package/dist/engine/mcp/facade.d.ts +12 -18
  170. package/dist/engine/mcp/facade.js +30 -80
  171. package/dist/engine/mcp/facade.js.map +1 -1
  172. package/dist/engine/mcp/op-mappers.d.ts +3 -9
  173. package/dist/engine/mcp/op-mappers.js +2 -30
  174. package/dist/engine/mcp/op-mappers.js.map +1 -1
  175. package/dist/engine/mcp/types.d.ts +5 -29
  176. package/dist/engine/tracer.js +6 -2
  177. package/dist/engine/tracer.js.map +1 -1
  178. package/dist/engine/types.d.ts +8 -3
  179. package/dist/graph/cache.d.ts +1 -11
  180. package/dist/graph/cache.js +1 -44
  181. package/dist/graph/cache.js.map +1 -1
  182. package/dist/graph/explore.js +88 -137
  183. package/dist/graph/explore.js.map +1 -1
  184. package/dist/harness/surface-registry.d.ts +56 -0
  185. package/dist/harness/surface-registry.js +397 -0
  186. package/dist/harness/surface-registry.js.map +1 -0
  187. package/dist/harness/validation.d.ts +9 -0
  188. package/dist/harness/validation.js +201 -0
  189. package/dist/harness/validation.js.map +1 -0
  190. package/dist/hook/post-tool-use.js +2 -2
  191. package/dist/hook/post-tool-use.js.map +1 -1
  192. package/dist/index.d.ts +7 -5
  193. package/dist/index.js +7 -5
  194. package/dist/index.js.map +1 -1
  195. package/dist/install/adapter-source.d.ts +14 -0
  196. package/dist/install/adapter-source.js +45 -0
  197. package/dist/install/adapter-source.js.map +1 -0
  198. package/dist/install/claude-hooks.d.ts +13 -0
  199. package/dist/install/claude-hooks.js +411 -0
  200. package/dist/install/claude-hooks.js.map +1 -0
  201. package/dist/install/claude-marketplace.d.ts +44 -0
  202. package/dist/install/claude-marketplace.js +89 -0
  203. package/dist/install/claude-marketplace.js.map +1 -0
  204. package/dist/install/claude.d.ts +4 -0
  205. package/dist/install/claude.js +216 -0
  206. package/dist/install/claude.js.map +1 -0
  207. package/dist/install/codex.d.ts +24 -0
  208. package/dist/install/codex.js +193 -0
  209. package/dist/install/codex.js.map +1 -0
  210. package/dist/install/common.d.ts +34 -0
  211. package/dist/install/common.js +122 -0
  212. package/dist/install/common.js.map +1 -0
  213. package/dist/install/hermes.d.ts +4 -0
  214. package/dist/install/hermes.js +78 -0
  215. package/dist/install/hermes.js.map +1 -0
  216. package/dist/install/hosts.d.ts +6 -56
  217. package/dist/install/hosts.js +65 -610
  218. package/dist/install/hosts.js.map +1 -1
  219. package/dist/install/types.d.ts +34 -0
  220. package/dist/install/types.js +2 -0
  221. package/dist/install/types.js.map +1 -0
  222. package/dist/link/convention-note.d.ts +10 -0
  223. package/dist/link/convention-note.js +59 -0
  224. package/dist/link/convention-note.js.map +1 -0
  225. package/dist/link/global-config.d.ts +22 -0
  226. package/dist/link/global-config.js +69 -0
  227. package/dist/link/global-config.js.map +1 -0
  228. package/dist/link/link.d.ts +101 -0
  229. package/dist/link/link.js +265 -0
  230. package/dist/link/link.js.map +1 -0
  231. package/dist/mcp/engine-morning-backend.d.ts +12 -17
  232. package/dist/mcp/engine-morning-backend.js +25 -131
  233. package/dist/mcp/engine-morning-backend.js.map +1 -1
  234. package/dist/mcp/link-tools.d.ts +81 -0
  235. package/dist/mcp/link-tools.js +157 -0
  236. package/dist/mcp/link-tools.js.map +1 -0
  237. package/dist/mcp/semantic-engine.d.ts +32 -0
  238. package/dist/mcp/semantic-engine.js +52 -0
  239. package/dist/mcp/semantic-engine.js.map +1 -0
  240. package/dist/mcp/semantic-retrieve-args.d.ts +1 -5
  241. package/dist/mcp/semantic-retrieve-args.js +1 -26
  242. package/dist/mcp/semantic-retrieve-args.js.map +1 -1
  243. package/dist/mcp/semantic-retrieve-schema.d.ts +0 -14
  244. package/dist/mcp/semantic-retrieve-schema.js +0 -5
  245. package/dist/mcp/semantic-retrieve-schema.js.map +1 -1
  246. package/dist/mcp/semantic-retrieve.d.ts +12 -18
  247. package/dist/mcp/semantic-retrieve.js +40 -71
  248. package/dist/mcp/semantic-retrieve.js.map +1 -1
  249. package/dist/mcp/semantic-tool-schemas.js +7 -24
  250. package/dist/mcp/semantic-tool-schemas.js.map +1 -1
  251. package/dist/mcp/server.d.ts +7 -0
  252. package/dist/mcp/server.js +224 -162
  253. package/dist/mcp/server.js.map +1 -1
  254. package/dist/mcp/update-notice.d.ts +51 -0
  255. package/dist/mcp/update-notice.js +196 -0
  256. package/dist/mcp/update-notice.js.map +1 -0
  257. package/dist/ontology/active.d.ts +7 -0
  258. package/dist/ontology/active.js +41 -0
  259. package/dist/ontology/active.js.map +1 -0
  260. package/dist/retrieve/morning.d.ts +10 -18
  261. package/dist/retrieve/morning.js +2 -26
  262. package/dist/retrieve/morning.js.map +1 -1
  263. package/dist/retrieve/semantic-contract.d.ts +10 -0
  264. package/dist/retrieve/semantic-contract.js +2 -0
  265. package/dist/retrieve/semantic-contract.js.map +1 -0
  266. package/dist/setup/axis.d.ts +22 -3
  267. package/dist/setup/axis.js +82 -35
  268. package/dist/setup/axis.js.map +1 -1
  269. package/dist/update/update.d.ts +12 -0
  270. package/dist/update/update.js +2 -2
  271. package/dist/update/update.js.map +1 -1
  272. package/docs/install.md +43 -7
  273. package/docs/release.md +109 -17
  274. package/package.json +11 -3
  275. package/scripts/install.sh +1 -1
  276. package/adapters/claude-code/skills/capture/SKILL.md +0 -50
  277. package/adapters/codex/skills/oms-capture/SKILL.md +0 -16
  278. package/adapters/hermes/skills/capture/SKILL.md +0 -16
  279. package/core/skills/capture/SKILL.md +0 -50
  280. package/dist/adapt/HostAdapter.d.ts +0 -21
  281. package/dist/adapt/HostAdapter.js +0 -10
  282. package/dist/adapt/HostAdapter.js.map +0 -1
  283. package/dist/adapt/claudeCode.d.ts +0 -9
  284. package/dist/adapt/claudeCode.js +0 -15
  285. package/dist/adapt/claudeCode.js.map +0 -1
  286. package/dist/adapt/codex.d.ts +0 -9
  287. package/dist/adapt/codex.js +0 -15
  288. package/dist/adapt/codex.js.map +0 -1
  289. package/dist/adapt/hermes.d.ts +0 -9
  290. package/dist/adapt/hermes.js +0 -15
  291. package/dist/adapt/hermes.js.map +0 -1
  292. package/dist/cli/semantic-metadata-commands.d.ts +0 -3
  293. package/dist/cli/semantic-metadata-commands.js +0 -115
  294. package/dist/cli/semantic-metadata-commands.js.map +0 -1
  295. package/dist/engine/compile/cascade.d.ts +0 -35
  296. package/dist/engine/compile/cascade.js +0 -59
  297. package/dist/engine/compile/cascade.js.map +0 -1
  298. package/dist/engine/compile/cot.d.ts +0 -30
  299. package/dist/engine/compile/cot.js +0 -153
  300. package/dist/engine/compile/cot.js.map +0 -1
  301. package/dist/engine/compile/phases.d.ts +0 -47
  302. package/dist/engine/compile/phases.js +0 -101
  303. package/dist/engine/compile/phases.js.map +0 -1
  304. package/dist/engine/compile/provenance.d.ts +0 -45
  305. package/dist/engine/compile/provenance.js +0 -103
  306. package/dist/engine/compile/provenance.js.map +0 -1
  307. package/dist/engine/compile/sha-cache.d.ts +0 -42
  308. package/dist/engine/compile/sha-cache.js +0 -86
  309. package/dist/engine/compile/sha-cache.js.map +0 -1
  310. package/dist/engine/compile/types.d.ts +0 -71
  311. package/dist/engine/compile/types.js +0 -9
  312. package/dist/engine/compile/types.js.map +0 -1
  313. package/dist/engine/compile/worker.d.ts +0 -47
  314. package/dist/engine/compile/worker.js +0 -75
  315. package/dist/engine/compile/worker.js.map +0 -1
  316. package/dist/engine/distill/analyzer.d.ts +0 -51
  317. package/dist/engine/distill/analyzer.js +0 -279
  318. package/dist/engine/distill/analyzer.js.map +0 -1
  319. package/dist/engine/distill/clean-room.d.ts +0 -46
  320. package/dist/engine/distill/clean-room.js +0 -131
  321. package/dist/engine/distill/clean-room.js.map +0 -1
  322. package/dist/engine/distill/report.d.ts +0 -23
  323. package/dist/engine/distill/report.js +0 -107
  324. package/dist/engine/distill/report.js.map +0 -1
  325. package/dist/engine/distill/types.d.ts +0 -89
  326. package/dist/engine/distill/types.js +0 -9
  327. package/dist/engine/distill/types.js.map +0 -1
  328. package/dist/engine/embed/pull.d.ts +0 -51
  329. package/dist/engine/embed/pull.js +0 -90
  330. package/dist/engine/embed/pull.js.map +0 -1
  331. package/dist/engine/graph/community.d.ts +0 -38
  332. package/dist/engine/graph/community.js +0 -122
  333. package/dist/engine/graph/community.js.map +0 -1
  334. package/dist/engine/index.d.ts +0 -5
  335. package/dist/engine/index.js +0 -2
  336. package/dist/engine/index.js.map +0 -1
  337. package/dist/engine/mcp/index.d.ts +0 -15
  338. package/dist/engine/mcp/index.js +0 -19
  339. package/dist/engine/mcp/index.js.map +0 -1
  340. package/dist/engine/mcp/retrieve-mapper.d.ts +0 -38
  341. package/dist/engine/mcp/retrieve-mapper.js +0 -96
  342. package/dist/engine/mcp/retrieve-mapper.js.map +0 -1
  343. package/dist/engine/setup/ambiguity.d.ts +0 -39
  344. package/dist/engine/setup/ambiguity.js +0 -50
  345. package/dist/engine/setup/ambiguity.js.map +0 -1
  346. package/dist/engine/setup/types.d.ts +0 -71
  347. package/dist/engine/setup/types.js +0 -22
  348. package/dist/engine/setup/types.js.map +0 -1
  349. package/dist/engine/setup/writer.d.ts +0 -32
  350. package/dist/engine/setup/writer.js +0 -77
  351. package/dist/engine/setup/writer.js.map +0 -1
  352. package/dist/engine/wiki/collection.d.ts +0 -91
  353. package/dist/engine/wiki/collection.js +0 -188
  354. package/dist/engine/wiki/collection.js.map +0 -1
  355. package/dist/engine/wiki/ledger.d.ts +0 -59
  356. package/dist/engine/wiki/ledger.js +0 -130
  357. package/dist/engine/wiki/ledger.js.map +0 -1
  358. package/dist/engine/wiki/lint.d.ts +0 -38
  359. package/dist/engine/wiki/lint.js +0 -186
  360. package/dist/engine/wiki/lint.js.map +0 -1
  361. package/dist/engine/wiki/navigation.d.ts +0 -40
  362. package/dist/engine/wiki/navigation.js +0 -83
  363. package/dist/engine/wiki/navigation.js.map +0 -1
  364. package/dist/engine/wiki/types.d.ts +0 -54
  365. package/dist/engine/wiki/types.js +0 -7
  366. package/dist/engine/wiki/types.js.map +0 -1
  367. package/dist/ontology/loader.d.ts +0 -13
  368. package/dist/ontology/loader.js.map +0 -1
  369. package/dist/ontology/resolver.d.ts +0 -13
  370. package/dist/ontology/resolver.js.map +0 -1
  371. package/dist/ontology/types.d.ts +0 -72
  372. package/dist/ontology/types.js +0 -12
  373. package/dist/ontology/types.js.map +0 -1
  374. package/dist/retrieve/embedding-sync.d.ts +0 -3
  375. package/dist/retrieve/embedding-sync.js +0 -21
  376. package/dist/retrieve/embedding-sync.js.map +0 -1
  377. package/dist/runtime/assets.d.ts +0 -7
  378. package/dist/runtime/assets.js +0 -13
  379. package/dist/runtime/assets.js.map +0 -1
  380. package/dist/search/semantic-collections.d.ts +0 -32
  381. package/dist/search/semantic-collections.js +0 -68
  382. package/dist/search/semantic-collections.js.map +0 -1
  383. package/dist/search/semantic-contexts.d.ts +0 -21
  384. package/dist/search/semantic-contexts.js +0 -28
  385. package/dist/search/semantic-contexts.js.map +0 -1
  386. package/dist/search/semantic-diagnostics.d.ts +0 -16
  387. package/dist/search/semantic-diagnostics.js +0 -110
  388. package/dist/search/semantic-diagnostics.js.map +0 -1
  389. package/dist/search/semantic-documents.d.ts +0 -3
  390. package/dist/search/semantic-documents.js +0 -150
  391. package/dist/search/semantic-documents.js.map +0 -1
  392. package/dist/search/semantic-embedding-hash.d.ts +0 -3
  393. package/dist/search/semantic-embedding-hash.js +0 -30
  394. package/dist/search/semantic-embedding-hash.js.map +0 -1
  395. package/dist/search/semantic-embedding-provider.d.ts +0 -9
  396. package/dist/search/semantic-embedding-provider.js +0 -58
  397. package/dist/search/semantic-embedding-provider.js.map +0 -1
  398. package/dist/search/semantic-index-build.d.ts +0 -13
  399. package/dist/search/semantic-index-build.js +0 -101
  400. package/dist/search/semantic-index-build.js.map +0 -1
  401. package/dist/search/semantic-index-core.d.ts +0 -21
  402. package/dist/search/semantic-index-core.js +0 -106
  403. package/dist/search/semantic-index-core.js.map +0 -1
  404. package/dist/search/semantic-index-io.d.ts +0 -19
  405. package/dist/search/semantic-index-io.js +0 -214
  406. package/dist/search/semantic-index-io.js.map +0 -1
  407. package/dist/search/semantic-index-types.d.ts +0 -50
  408. package/dist/search/semantic-index-types.js +0 -2
  409. package/dist/search/semantic-index-types.js.map +0 -1
  410. package/dist/search/semantic-index.d.ts +0 -4
  411. package/dist/search/semantic-index.js +0 -4
  412. package/dist/search/semantic-index.js.map +0 -1
  413. package/dist/search/semantic-listing.d.ts +0 -12
  414. package/dist/search/semantic-listing.js +0 -64
  415. package/dist/search/semantic-listing.js.map +0 -1
  416. package/dist/search/semantic-maintenance-shared.d.ts +0 -15
  417. package/dist/search/semantic-maintenance-shared.js +0 -43
  418. package/dist/search/semantic-maintenance-shared.js.map +0 -1
  419. package/dist/search/semantic-maintenance-types.d.ts +0 -103
  420. package/dist/search/semantic-maintenance-types.js +0 -2
  421. package/dist/search/semantic-maintenance-types.js.map +0 -1
  422. package/dist/search/semantic-maintenance.d.ts +0 -4
  423. package/dist/search/semantic-maintenance.js +0 -5
  424. package/dist/search/semantic-maintenance.js.map +0 -1
  425. package/dist/search/semantic-provider-types.d.ts +0 -34
  426. package/dist/search/semantic-provider-types.js +0 -2
  427. package/dist/search/semantic-provider-types.js.map +0 -1
  428. package/dist/search/semantic-query-types.d.ts +0 -83
  429. package/dist/search/semantic-query-types.js +0 -2
  430. package/dist/search/semantic-query-types.js.map +0 -1
  431. package/dist/search/semantic-query.d.ts +0 -2
  432. package/dist/search/semantic-query.js +0 -188
  433. package/dist/search/semantic-query.js.map +0 -1
  434. package/dist/search/semantic-sqlite-db.d.ts +0 -18
  435. package/dist/search/semantic-sqlite-db.js +0 -87
  436. package/dist/search/semantic-sqlite-db.js.map +0 -1
  437. package/dist/search/semantic-sqlite-query.d.ts +0 -2
  438. package/dist/search/semantic-sqlite-query.js +0 -128
  439. package/dist/search/semantic-sqlite-query.js.map +0 -1
  440. package/dist/search/semantic-sqlite-read.d.ts +0 -5
  441. package/dist/search/semantic-sqlite-read.js +0 -104
  442. package/dist/search/semantic-sqlite-read.js.map +0 -1
  443. package/dist/search/semantic-sqlite-write.d.ts +0 -7
  444. package/dist/search/semantic-sqlite-write.js +0 -66
  445. package/dist/search/semantic-sqlite-write.js.map +0 -1
  446. package/dist/search/semantic-store.d.ts +0 -15
  447. package/dist/search/semantic-store.js +0 -17
  448. package/dist/search/semantic-store.js.map +0 -1
  449. package/dist/search/semantic-sync-types.d.ts +0 -47
  450. package/dist/search/semantic-sync-types.js +0 -2
  451. package/dist/search/semantic-sync-types.js.map +0 -1
  452. package/dist/search/semantic-sync.d.ts +0 -13
  453. package/dist/search/semantic-sync.js +0 -131
  454. package/dist/search/semantic-sync.js.map +0 -1
  455. package/dist/search/semantic-test-fixtures.d.ts +0 -1
  456. package/dist/search/semantic-test-fixtures.js +0 -38
  457. package/dist/search/semantic-test-fixtures.js.map +0 -1
  458. package/dist/search/semantic-token.d.ts +0 -25
  459. package/dist/search/semantic-token.js +0 -114
  460. package/dist/search/semantic-token.js.map +0 -1
  461. package/dist/search/semantic-types.d.ts +0 -5
  462. package/dist/search/semantic-types.js +0 -2
  463. package/dist/search/semantic-types.js.map +0 -1
  464. package/dist/search/semantic.d.ts +0 -6
  465. package/dist/search/semantic.js +0 -6
  466. package/dist/search/semantic.js.map +0 -1
@@ -1,54 +1,55 @@
1
1
  ---
2
2
  name: compile
3
3
  version: 0.1.0
4
- description: Stateless per-concept compile worker — takes a concept name, source materials, and graph context; returns a synthesized Markdown page body with SHA-incremental skip, nashsu 2-step CoT, atomicstrata 2-phase separation, lucasastorian cascade backlinks, and provenance-weighted synthesis context.
4
+ description: Agent-guided concept compile — synthesize a concept wiki page from source materials with incremental skip, two-phase write separation, cascade backlinks, and provenance-weighted context.
5
5
  trigger: /compile
6
6
  tags: [compile, wiki, synthesis, sha, incremental, second-brain, oms]
7
7
  ---
8
8
 
9
9
  ## compile
10
10
 
11
- Compile a concept page from source materials using the OMS compile engine.
11
+ Synthesize a concept page from source materials. There is no `oms compile` CLI
12
+ and no TypeScript compile worker — follow this recipe as the agent.
12
13
 
13
14
  ### When to use
14
15
 
15
- Use `compile` when you need to synthesize a concept wiki page from one or more source materials. The worker skips recompile when material SHA is unchanged (incremental by default).
16
+ Use `compile` when you need to synthesize a concept wiki page from one or more
17
+ source materials. Skip rewrite when the material fingerprint is unchanged.
16
18
 
17
19
  ### Inputs
18
20
 
19
- - `concept` — human-readable concept name (used in LLM prompts)
20
- - `materials` — list of `{ path, text, grade }` items (grade resolved from folder->grade map)
21
- - `graph` — compile graph providing `getBacklinks(docPath)` (use `createNullGraph()` when unavailable)
22
- - `llm` — injected LLM provider (use `createDeterministicStub()` for offline/tests)
23
- - `dotLlmwiki` — absolute path to `.llmwiki/` dotfolder (SHA cache location)
21
+ - `concept` — human-readable concept name (used in prompts)
22
+ - `materials` — list of `{ path, text, grade }` items (grade from folder→grade map)
23
+ - backlinks — wiki pages that already link to this concept (empty if unknown)
24
24
  - `conceptId` — stable cache key (vault-relative path recommended)
25
25
 
26
+ Gather materials with MCP `oms_retrieve_context` or `oms_get_document`.
27
+
26
28
  ### Output
27
29
 
28
- Returns `CascadeResult`:
29
- - `body` — synthesized Markdown with `[[wikilinks]]` (empty string when SHA unchanged / skipped)
30
+ - `body` — synthesized Markdown with `[[wikilinks]]` (empty when skipped)
30
31
  - `sha` — SHA-256 fingerprint of the input materials
31
32
  - `provenance` — grades of contributing materials
32
- - `affected_backlinks` — vault paths of wiki pages that link to this concept (for M3 staleness)
33
+ - `affected_backlinks` — vault paths of wiki pages that link to this concept
33
34
 
34
35
  ### Recipe
35
36
 
36
- 1. Run Phase A (`phaseA`) to load and grade all source materials (pure read, no vault mutation).
37
- 2. Call `compile(opts)` with the Phase A materials, graph, llm, and cache path.
38
- 3. Check `wasSkipped(result)` — if true, skip downstream processing.
39
- 4. If not skipped, run Phase B (`phaseB`) to write the body to `processed/` tier.
40
- 5. Pass `result.affected_backlinks` to the wiki collection owner (M3) to mark stale pages.
37
+ 1. **Phase A** — load and grade all source materials (pure read, no vault mutation).
38
+ 2. Fingerprint the materials. If `{dotLlmwiki}/sha-cache.json` already has the
39
+ same SHA for `conceptId`, skip the rest.
40
+ 3. **Phase B** — write the synthesized body to the `processed/` tier only.
41
+ 4. Pass `affected_backlinks` to the wiki skill so those pages can be marked stale.
41
42
 
42
43
  ### Phase constraints
43
44
 
44
45
  - Phase A and Phase B never overlap in one execution context.
45
46
  - Phase B writes to `processed/` ONLY — never to `wiki/` directly.
46
- - Promotion from `processed/` to `wiki/` is the M3 collection owner's responsibility.
47
+ - Promotion from `processed/` to `wiki/` is the wiki skill's responsibility.
47
48
 
48
49
  ### Provenance weighting
49
50
 
50
51
  Materials are sorted authored > curated > external-raw in synthesis context.
51
- Authored materials are labelled `[AUTHORED — preserve individual voice]` in the LLM prompt.
52
+ Authored materials are labelled `[AUTHORED — preserve individual voice]` in the prompt.
52
53
 
53
54
  ### SHA cache
54
55
 
@@ -17,6 +17,7 @@ tags:
17
17
  # Distill
18
18
 
19
19
  Run adversarial absorption analysis on a target and produce a structured report.
20
+ There is no TypeScript distill engine — follow this recipe as the agent.
20
21
 
21
22
  ## Usage
22
23
 
@@ -26,15 +27,15 @@ Run adversarial absorption analysis on a target and produce a structured report.
26
27
 
27
28
  ## Steps
28
29
 
29
- 1. Load the target as inert read-only text via `prepareCleanRoom(target)`.
30
- The target is NEVER executed — it is treated as data only.
31
- 2. Snapshot system state SHA before analysis (`snapshotSha`).
32
- 3. Run red-team adversarial analysis via `runAnalysis(spec, provider)`.
33
- Inject an LLM provider for production; inject the stub for dry-runs.
34
- 4. Generate the absorption report via `generateReport(result, targetName)`.
35
- The report has exactly 3 sections: §1 Patterns, §2 Risks, §3 Attribution.
36
- 5. Verify mutation-detector: SHA after must equal SHA before (`detectMutation`).
37
- Throw if state was mutated — distill must be fully stateless.
30
+ 1. Load the target as inert read-only text. The target is NEVER executed — it
31
+ is treated as data only.
32
+ 2. Snapshot a content hash of the working tree (or target file) before analysis.
33
+ 3. Run red-team adversarial analysis. Use a real model for production; keep
34
+ the pass read-only.
35
+ 4. Generate the absorption report. The report has exactly 3 sections:
36
+ §1 Patterns, §2 Risks, §3 Attribution.
37
+ 5. Verify the hash after analysis equals the hash before. Stop if anything
38
+ was mutated — distill must be fully stateless.
38
39
  6. Return the report string. Write it only if the caller explicitly requests it.
39
40
  No vault write, no code mutation happens inside distill.
40
41
 
@@ -54,20 +55,8 @@ The report is the only output. It contains:
54
55
 
55
56
  ## Constraints
56
57
 
57
- - Standalone: does not import from `src/engine/compile/` or `src/engine/wiki/`.
58
+ - Standalone: does not depend on compile or wiki.
58
59
  - Vault-agnostic: `OMS_VAULT` environment variable is NOT required.
59
- - Stateless: no daemon, no watcher, no `setInterval` (R2).
60
- - Clean-room: target content is inert text — never executed (R6).
60
+ - Stateless: no daemon, no watcher, no `setInterval`.
61
+ - Clean-room: target content is inert text — never executed.
61
62
  - No vault write occurs inside distill — the caller decides what to do with the report.
62
-
63
- ## Provider injection
64
-
65
- Inject an `AnalyzerProvider` to control the LLM backend:
66
-
67
- ```typescript
68
- import { createStubAnalyzerProvider } from "src/engine/distill/analyzer.js";
69
- // Deterministic stub — no network; use in tests and dry-runs.
70
- const provider = createStubAnalyzerProvider();
71
- ```
72
-
73
- For production, wrap a real LLM client in the `AnalyzerProvider` interface.
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: link
3
+ version: 0.1.0
4
+ description: Two-path note-linking skill — Path A (pre-write): compose a new note body that already carries [[wikilinks]] to existing term notes; Path B (retrofit): add missing links to notes that already exist, via oms linkify or oms_link_apply.
5
+ trigger: /link
6
+ tags: [link, wikilink, linkify, term, backlink, second-brain, oms]
7
+ ---
8
+
9
+ ## link
10
+
11
+ Keep the vault interlinked. There is no autolink daemon — follow this recipe as
12
+ the agent. Requires `OMS_VAULT` (or a resolved vault target).
13
+
14
+ ## Which path?
15
+
16
+ Determine which path applies **before acting**:
17
+
18
+ | | Path A — pre-write | Path B — retrofit |
19
+ |---|---|---|
20
+ | **When to use** | You are about to write or rewrite a note | The note already exists on disk |
21
+ | **Entry point** | MCP `oms_link_suggest` on a sibling note, then MCP `write` | `oms linkify` (report) → `oms linkify --apply --yes`, or MCP `oms_link_suggest` → `oms_link_apply` |
22
+ | **Writes to** | The new note only | Existing notes in scope |
23
+ | **Prerequisite** | Term notes exist to link at | Term notes exist to link at |
24
+
25
+ These paths are **mutually exclusive and never combined in a single invocation.**
26
+
27
+ ---
28
+
29
+ ## The link universe — term notes only
30
+
31
+ A link target is a note bound to the `term` concept in `vault/.oms/taxonomy.yaml`.
32
+ Notes bound to any other concept are never proposed as targets, in either path.
33
+ Surface forms of a target are its **basename** and its frontmatter **`aliases`**.
34
+
35
+ If a run reports `0 term note(s) available as link targets`, the vault has no
36
+ term layer yet — build one with the `wiki` skill (Path B) first. Linking is not
37
+ the tool that creates vocabulary; it is the tool that connects it.
38
+
39
+ ## Three rules the engine enforces — do not fight them
40
+
41
+ 1. **Surface-anchored.** A candidate exists only because the term's basename or
42
+ alias literally appears in the note. Retrieval never invents a link. Do not
43
+ hand-add a `[[link]]` to a note whose title does not appear in the text —
44
+ write the sentence that mentions it instead.
45
+ 2. **First occurrence only.** One link per target note per body. A term linked
46
+ ten times is noise, not navigation.
47
+ 3. **Ambiguity is reported, never auto-resolved.** When 2+ notes claim one span,
48
+ the candidate carries `ambiguous: true` and every `rivalPaths` entry. Ask the
49
+ user which note is meant, or skip the span. Never guess.
50
+
51
+ Protected regions are masked out before matching: frontmatter, fenced and inline
52
+ code, existing wikilinks and markdown links, image embeds, HTML, headings, URLs,
53
+ block ids, and tags. A "missing" link inside any of those is correct behavior.
54
+
55
+ ---
56
+
57
+ ## Path A — pre-write linking
58
+
59
+ *(Use while drafting. The goal is that the body arrives on disk already linked,
60
+ so no retrofit pass is ever needed for this note.)*
61
+
62
+ ### Agent-guided steps
63
+
64
+ 1. Establish the vocabulary **before** drafting: call MCP `oms_link_suggest` on
65
+ an existing note in the same folder (or run `oms linkify --folder <folder>`
66
+ in report mode) and read the `targetPath` list. That list IS the vault's
67
+ current term vocabulary.
68
+ 2. Draft the body using those exact surface forms, and write `[[wikilinks]]`
69
+ inline as you compose — first mention of each term only.
70
+ 3. Commit through MCP `write`. Host `Write`/`Edit` never touches vault `.md`.
71
+ 4. Re-check with `oms_link_suggest` on the committed note. Zero candidates means
72
+ the draft was already fully linked; remaining candidates are terms you missed.
73
+
74
+ ### Example agent steps (Path A)
75
+
76
+ ```
77
+ User: "Write a note about our retrieval pipeline."
78
+
79
+ 1. oms_link_suggest { notePath: "notes/software-engineering/indexing.md" }
80
+ → targets: notes/terms/embedding.md, notes/terms/reranker.md, notes/terms/chunk.md
81
+ 2. Draft body mentioning embedding / reranker / chunk, each first mention
82
+ written as [[embedding]], [[reranker]], [[chunk]]
83
+ 3. write { mode: "create", notePath: "notes/software-engineering/retrieval-pipeline.md", ... }
84
+ 4. oms_link_suggest on the new note → 0 candidates ✓
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Path B — retrofit existing notes
90
+
91
+ *(Use when the note is already on disk. Report first, always.)*
92
+
93
+ ### Batch — `oms linkify` (whole vault or one folder)
94
+
95
+ ```bash
96
+ oms linkify --folder notes # report only, writes nothing
97
+ oms linkify --folder notes --apply --yes # rewrite in place
98
+ ```
99
+
100
+ `--apply` without `--yes` refuses before reading a single note and writes
101
+ nothing. Show the user the report and get agreement before adding `--yes`.
102
+ Every write still goes through the capture kernel, so path safety and the
103
+ concept contract hold exactly as they do for MCP `write`.
104
+
105
+ ### Single note — `oms_link_suggest` → `oms_link_apply`
106
+
107
+ Use when the user wants to accept some candidates and reject others:
108
+
109
+ 1. `oms_link_suggest { notePath, folder? }` → candidates + `baseContentHash`.
110
+ 2. Present the candidates; drop ambiguous ones the user does not resolve.
111
+ 3. `oms_link_apply { notePath, baseContentHash, candidateIds, folder? }` —
112
+ pass back the **same** `baseContentHash` and the **same** `folder` scope.
113
+
114
+ `oms_link_apply` refuses without writing when the note changed since the
115
+ suggest call (`note-changed`), when a candidate's text moved (`candidate-drift`),
116
+ or when accepted candidates overlap. A refusal is a correct outcome: re-run
117
+ `oms_link_suggest` for fresh offsets rather than retrying the stale ids.
118
+
119
+ ### Example agent steps (Path B)
120
+
121
+ ```
122
+ User: "Link up the notes I wrote last week."
123
+
124
+ 1. oms linkify --folder notes ← report only
125
+ → 14 candidate(s) across 9 note(s); 2 marked ambiguous
126
+ 2. Show the report; ask which note the 2 ambiguous spans mean
127
+ 3. Accepted whole folder → oms linkify --folder notes --apply --yes
128
+ Accepted per-note → oms_link_suggest → oms_link_apply with the chosen ids
129
+ 4. Run `oms doctor` (non-blocking, exits 0)
130
+ ```
@@ -51,7 +51,6 @@ For semantic retrieval, keep semantic-index and search controls on the OMS retri
51
51
  - pass `semanticMode: "query" | "search" | "vsearch"` to choose hybrid, lexical, or vector search
52
52
  - pass `semanticIntent`, `semanticLex`, `semanticVec`, `semanticHyde`, or `semanticSearches` for typed query documents
53
53
  - pass `semanticMinScore`, `semanticAll`, `semanticFull`, `semanticLineNumbers`, or `semanticFullPath` when the retrieval task needs search flags
54
- - pass `semanticStorage: "qmd-sqlite"` for the default qmd-compatible SQLite store, or `semanticStorage: "oms-native-json"` only for the legacy JSON fallback
55
54
  - pass `embeddingSyncBeforeSearch: true` when the native semantic index must be fresh before retrieval
56
55
  - use `oms_sync_embeddings` for an explicit semantic-index sync without doing a retrieval query
57
56
  - use `oms_semantic_query`, `oms_semantic_status`, `oms_semantic_collections`, and `oms_semantic_contexts` for qmd-compatible semantic follow-ups on the native OMS index
@@ -157,11 +157,10 @@ Paths outside `agent_writable_zone` are read-only to all agents.
157
157
  > Interview output is written ONLY to `vault/.oms/taxonomy.yaml`.
158
158
  > Writing to `core/ontology/taxonomy.yaml` or any engine path is FORBIDDEN.
159
159
 
160
- This guard is enforced by construction in `src/engine/setup/writer.ts`:
160
+ This guard is enforced by `oms setup` (`src/cli/setup-command.ts`) and by this skill:
161
161
 
162
- - `writeTaxonomyToVaultOverride(vaultRoot, data)` resolves the canonical path as
163
- `{vaultRoot}/.oms/taxonomy.yaml` and refuses any path that escapes `{vaultRoot}/.oms/`.
164
- - Any attempt to write to the engine default throws before touching disk.
162
+ - The only write target is `{vaultRoot}/.oms/taxonomy.yaml`.
163
+ - Never write to `core/ontology/taxonomy.yaml` or any other engine path.
165
164
 
166
165
  **Why this matters:** The engine default at `core/ontology/taxonomy.yaml` is the shared
167
166
  fallback for every vault. Overwriting it would silently propagate one vault's assumptions
@@ -184,11 +183,10 @@ to all future users. Vault-local overrides preserve this separation permanently.
184
183
 
185
184
  4. **Validate completeness** — confirm all 6 output keys are present and non-empty.
186
185
 
187
- 5. **Write** to `{vaultRoot}/.oms/taxonomy.yaml` ONLY via
188
- `writeTaxonomyToVaultOverride(vaultRoot, data)`:
189
- - Create `{vaultRoot}/.oms/` if it does not exist.
190
- - Merge with any existing file (do not clobber unrelated keys).
191
- - Ensure `version: 1` (upgrade from v0 if needed).
186
+ 5. **Write** to `{vaultRoot}/.oms/taxonomy.yaml` ONLY:
187
+ - Prefer `oms setup --vault <path>` for the non-interactive/default path.
188
+ - If writing during the interview, create `{vaultRoot}/.oms/` if needed, merge
189
+ with any existing file (do not clobber unrelated keys), and keep `version: 1`.
192
190
 
193
191
  6. **Confirm** — print the written path and the resolved values. Never silently succeed.
194
192
 
@@ -239,10 +237,10 @@ Run the `doctor` skill to validate existing notes against the resolved conventio
239
237
  oms doctor [--vault <path>]
240
238
  ```
241
239
 
242
- ## Executable helpers
240
+ ## Executable helper
243
241
 
244
- Pure stateless helpers live in `src/engine/setup/` (co-located vitest tests):
242
+ Use the live CLI writer, not a parallel engine setup module:
245
243
 
246
- - `types.ts` — `DimensionScore`, `InterviewConfig`, `TaxonomyOutput`, `BindingDimension`
247
- - `ambiguity.ts` — `computeAmbiguity()`, `meetsThreshold()`, `validateScores()`
248
- - `writer.ts` — `writeTaxonomyToVaultOverride()`, `resolveVaultOverridePath()` (Non-Sticky Guard)
244
+ ```bash
245
+ oms setup [--vault <path>] [--yes]
246
+ ```
@@ -19,7 +19,7 @@ checker is safe to call at any time — it is read-only by default.
19
19
  ### Inputs
20
20
 
21
21
  - `vaultRoot` — absolute path to the vault root directory
22
- - `ontology` — loaded `Ontology` object (use `loadOntology(ontologyDir)` from `src/ontology/loader.ts`)
22
+ - `ontology` — loaded `Ontology` object (use `loadOntology(ontologyDir)` from `src/core/ontology/loader.ts`)
23
23
  - `options.autofixEnabled` — optional human-gate flag (default `false`); set `true` ONLY after explicit user confirmation; currently a no-op reserved for future implementation
24
24
 
25
25
  ### Output
@@ -1,35 +1,55 @@
1
1
  ---
2
2
  name: wiki
3
3
  version: 0.1.0
4
- description: Promote compiled concepts from processed/ into the wiki/ query surface, maintain the 5-state staleness ledger, regenerate navigation surfaces (index.md + log.md), and run 2-tier lint over the wiki collection.
4
+ description: Two-path wiki skill — Path A: promote compiled concepts from processed/ into the wiki/ query surface, maintain the staleness ledger, and lint; Path B (human authoring): build interlinked terminology notes directly in vault taxonomy folders via write.
5
5
  trigger: /wiki
6
6
  tags: [wiki, collection, staleness, navigation, lint, second-brain, oms]
7
7
  ---
8
8
 
9
9
  ## wiki
10
10
 
11
- Manage the wiki collection — the read-only query surface of the oh-my-secondbrain engine.
11
+ Manage the wiki collection and author interlinked vault notes. There is no
12
+ TypeScript wiki engine — follow this recipe as the agent.
12
13
 
13
- ## What this skill does
14
+ ## Which path?
14
15
 
15
- 1. Verify the M2 compile output exists in `processed/` for the target concept.
16
+ Determine which path applies **before acting**:
17
+
18
+ | | Path A — promotion | Path B — Human authoring |
19
+ |---|---|---|
20
+ | **When to use** | You have compiled `processed/<concept>.md` output | You have only a topic + terms; no compile output exists |
21
+ | **Entry point** | Promote files, then update ledger + index | MCP `write` |
22
+ | **Writes to** | `wiki/` (query surface) | Vault taxonomy folders (`vault/.oms/taxonomy.yaml`) |
23
+ | **Prerequisite** | `processed/<concept>.md` must exist | None — user provides topic and term list |
24
+
25
+ These paths are **mutually exclusive and never combined in a single invocation.**
26
+
27
+ ---
28
+
29
+ ## Path A — promotion
30
+
31
+ *(Use only when `processed/<concept>.md` already exists.)*
32
+
33
+ ### What this skill does
34
+
35
+ 1. Verify the compile output exists in `processed/` for the target concept.
16
36
  2. Check the staleness ledger (`.llmwiki/staleness.json`) for current state.
17
- 3. Run `runCollection()` to promote `processed/→wiki/`, update the ledger, flip cascade backlinks, detect stubs and orphans, and regenerate navigation surfaces.
37
+ 3. Promote `processed/→wiki/`, update the ledger, flip cascade backlinks, detect stubs and orphans, and regenerate navigation surfaces.
18
38
  4. Regenerate `wiki/index.md` (global catalog) and append an entry to `wiki/log.md`.
19
- 5. Run `runLint()` — apply auto-fixes (index consistency, broken links, See-Also) and report findings (conflicts, orphans, outdated refs) to stdout.
39
+ 5. Lint — apply auto-fixes (index consistency, broken links, See-Also) and report findings (conflicts, orphans, outdated refs).
20
40
 
21
- ## 3-phase hard separation
41
+ ### 3-phase hard separation
22
42
 
23
43
  ```
24
- Research (M1) → Compile (M2, sequential) → Wiki (read-only query surface)
44
+ Research → Compile (sequential) → Wiki (read-only query surface)
25
45
  ```
26
46
 
27
47
  A wiki query never triggers compile. Compile never writes `wiki/` directly.
28
- `promoteToWiki()` in `collection.ts` is the sole entry point into `wiki/`.
48
+ Promotion is the sole entry point into `wiki/`.
29
49
 
30
- **Sync boundary:** `processed/` is internal compile state and is **NEVER synced to the Obsidian vault** — only `wiki/` crosses the Obsidian sync boundary. `processed/` stays non-synced (engine-internal); `wiki/` is the synced, user-visible surface.
50
+ **Sync boundary:** `processed/` is internal compile state and is **NEVER synced to the Obsidian vault** — only `wiki/` crosses the Obsidian sync boundary.
31
51
 
32
- ## Staleness states
52
+ ### Staleness states
33
53
 
34
54
  | State | Meaning |
35
55
  |-------|---------|
@@ -41,7 +61,7 @@ A wiki query never triggers compile. Compile never writes `wiki/` directly.
41
61
 
42
62
  Full-rebuild escape hatch: delete `.llmwiki/staleness.json` — every page resets to DIRTY on the next collection run.
43
63
 
44
- ## Lint tiers
64
+ ### Lint tiers
45
65
 
46
66
  **Auto-fix** (runs automatically, mutates `wiki/` files):
47
67
  - Index consistency — page in `wiki/` but absent from `index.md`
@@ -53,28 +73,87 @@ Full-rebuild escape hatch: delete `.llmwiki/staleness.json` — every page reset
53
73
  - Orphan pages
54
74
  - Outdated refs (DIRTY pages in the ledger)
55
75
 
56
- ## Engine
57
-
58
- Implemented in `src/engine/wiki/`:
59
-
60
- - `collection.ts` — `runCollection()` orchestrates the full cycle
61
- - `ledger.ts` — 5-state FSM, `loadLedger()` / `saveLedger()` / `resetLedger()`
62
- - `navigation.ts` — `regenerateIndex()` + `appendLog()`
63
- - `lint.ts` — `runLint()`
64
- - `types.ts` — local type definitions
65
-
66
- ## Example agent steps
76
+ ### Example agent steps (Path A)
67
77
 
68
78
  ```
69
79
  User: "Promote the Alpha concept into the wiki after compile."
70
80
 
71
81
  1. Verify processed/alpha.md exists (Phase-B compile output)
72
82
  2. Load ledger from .llmwiki/staleness.json
73
- 3. runCollection({ conceptId: "concepts/alpha.md", conceptName: "Alpha", ... })
74
- → promotes processed/alpha.md → wiki/alpha.md
75
- → marks concepts/alpha.md CLEAN in ledger
76
- → flips CLEAN backlinks to DIRTY
77
- → detects stubs (dangling wikilinks) and orphans
78
- → regenerates wiki/index.md and appends to wiki/log.md
79
- 4. runLint({ wikiDir, ledger }) → apply auto-fixes, print report-only findings
83
+ 3. Copy processed/alpha.md → wiki/alpha.md
84
+ → mark concepts/alpha.md CLEAN in ledger
85
+ → flip CLEAN backlinks to DIRTY
86
+ → detect stubs (dangling wikilinks) and orphans
87
+ → regenerate wiki/index.md and append to wiki/log.md
88
+ 4. Apply auto-fixes; print report-only findings
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Path B — Human authoring
94
+
95
+ *(Use when you have only a topic + terms and no compiled `processed/` output.)*
96
+
97
+ Build an interlinked cluster of vault notes: one hub/MOC note plus one standalone note
98
+ per coined term, cross-linked with Obsidian `[[wikilinks]]` and committed through
99
+ MCP `write`. Writes to vault taxonomy folders declared
100
+ in `vault/.oms/taxonomy.yaml` — **never to `wiki/`**.
101
+
102
+ Implements [#43](https://github.com/GoBeromsu/oh-my-second-brain/issues/43).
103
+
104
+ ### Admission gate — coined terms vs general nouns
105
+
106
+ Before creating any note, apply this test to every candidate term:
107
+
108
+ > **Does the word exist in ordinary language and shift meaning by domain?**
109
+ > → Explain it as a `## Term` section inside the hub note (the hub supplies the context).
110
+ >
111
+ > **Does it only ever mean one specific technical thing — a coined or proper term?**
112
+ > → Give it its own standalone terminology note.
113
+
114
+ **Kubernetes example:**
115
+
116
+ | Term | Classification | Placement |
117
+ |------|---------------|-----------|
118
+ | `Pod` | General noun (grouping in many domains) | Section in the Kubernetes hub note |
119
+ | `Service` | General noun (a service in many domains) | Section in the Kubernetes hub note |
120
+ | `Deployment` | General noun (deploying software anywhere) | Section in the Kubernetes hub note |
121
+ | `Ingress` | General noun (network ingress is domain-agnostic) | Section in the Kubernetes hub note |
122
+ | `ReplicaSet` | Coined Kubernetes term, no prior meaning | Standalone note → `[[ReplicaSet]]` |
123
+ | `StatefulSet` | Coined Kubernetes term, no prior meaning | Standalone note → `[[StatefulSet]]` |
124
+ | `DaemonSet` | Coined Kubernetes term, no prior meaning | Standalone note → `[[DaemonSet]]` |
125
+ | `CronJob` | Coined compound, specific k8s resource type | Standalone note → `[[CronJob]]` |
126
+
127
+ Apply this gate **before** calling MCP `write`. General-noun terms never become standalone notes.
128
+
129
+ ### Agent-guided steps (Path B, v0)
130
+
131
+ 1. Ask the user for the **topic** and **term list** (or extract terms from freeform source text).
132
+ 2. Resolve the **target concept/folder** from `vault/.oms/taxonomy.yaml`.
133
+ 3. Apply the **admission gate** to every term.
134
+ 4. **Deduplicate**: call MCP `write` with `mode: "create"` per coined term; if status is `rejected` because the note exists, reuse the existing `[[wikilink]]`.
135
+ 5. Draft one note per coined term — frontmatter from the concept's required fields + definition + `## See Also` back-link to the hub.
136
+ 6. Draft the hub/MOC note — general-noun `## Term` sections + `## See Also` listing all coined-term `[[wikilinks]]`.
137
+ 7. Commit terms first, hub last, via MCP `write`.
138
+ 8. Run `oms doctor` (non-blocking, exits 0).
139
+
140
+ ### Example agent steps (Path B)
141
+
142
+ ```
143
+ User: "Build a Kubernetes wiki: Pod, Service, Deployment, Ingress, ReplicaSet, StatefulSet, DaemonSet, CronJob"
144
+
145
+ Admission gate:
146
+ Pod, Service, Deployment, Ingress → general nouns → hub sections
147
+ ReplicaSet, StatefulSet, DaemonSet, CronJob → coined terms → own notes
148
+
149
+ Dedup check: MCP write create per coined term → proceed when not already present
150
+
151
+ → vault/notes/software-engineering/replicaset.md (coined, committed first)
152
+ → vault/notes/software-engineering/statefulset.md (coined, committed first)
153
+ → vault/notes/software-engineering/daemonset.md (coined, committed first)
154
+ → vault/notes/software-engineering/cronjob.md (coined, committed first)
155
+ → vault/notes/software-engineering/kubernetes.md (hub: Pod/Service/Deployment/Ingress as
156
+ sections; See Also: [[ReplicaSet]] etc.)
157
+
158
+ oms doctor ← verify (exits 0, non-blocking)
80
159
  ```
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: write
3
+ description: Write a vault note through the Oh My Second Brain kernel contract.
4
+ ---
5
+
6
+ # write
7
+
8
+ Vault notes go through MCP `write` only. Do not use host Write/Edit for vault `.md` files.
9
+
10
+ `mode` is `create`, `append`, or `update`. The kernel owns `.oms` and returns one status:
11
+
12
+ - `ask` — fill the missing or invalid fields and call `write` again
13
+ - `inbox` — tell the user; do not invent a folder
14
+ - `written` — done
15
+ - `rejected` — fix `violations` or `reason` and call `write` again
@@ -1,6 +1,10 @@
1
- import type { Ontology } from "../ontology/types.js";
1
+ import { type WriteContractViolation, type WriteFieldDescriptor } from "../conventions/write-contract.js";
2
+ import { type WriteRejection, type WriteReceipt, type WriteTargetSource } from "../conventions/write-protocol.js";
3
+ import type { Concept, Ontology } from "../core/ontology/types.js";
2
4
  export type CapturePrepareAction = "ready" | "ask-missing-fields" | "route-to-inbox";
3
5
  export type CaptureWriteMode = "create" | "append";
6
+ export type WriteMode = "create" | "append" | "update";
7
+ export type WriteStatus = "ask" | "inbox" | "written" | "rejected";
4
8
  export interface CapturePrepareInput {
5
9
  vault: string;
6
10
  ontology: Ontology;
@@ -16,10 +20,17 @@ export interface CapturePlan {
16
20
  notePath: string;
17
21
  missingFields: string[];
18
22
  frontmatter: Record<string, unknown>;
23
+ fields: WriteFieldDescriptor[];
24
+ violations: WriteContractViolation[];
19
25
  reason?: string;
20
26
  }
27
+ export interface WriteTarget {
28
+ vault: string;
29
+ source: WriteTargetSource;
30
+ }
21
31
  export interface CaptureCommitInput {
22
32
  vault: string;
33
+ source: WriteTargetSource;
23
34
  ontology: Ontology;
24
35
  notePath: string;
25
36
  frontmatter: Record<string, unknown>;
@@ -31,6 +42,55 @@ export interface CaptureCommitResult {
31
42
  mode: CaptureWriteMode;
32
43
  notePath: string;
33
44
  }
45
+ export interface WriteNoteInput {
46
+ target: WriteTarget;
47
+ ontology: Ontology;
48
+ mode: WriteMode;
49
+ dryRun: boolean;
50
+ concept?: string;
51
+ folder?: string;
52
+ filename?: string;
53
+ notePath?: string;
54
+ frontmatter?: Record<string, unknown>;
55
+ body?: string;
56
+ /**
57
+ * Test-only DI seam for the postcondition read-back. Defaults to reading the
58
+ * persisted file with node:fs/promises. Exists so tests can force a
59
+ * postcondition failure deterministically without mocking node:fs/promises.
60
+ */
61
+ readBack?: (fullPath: string) => Promise<string>;
62
+ }
63
+ export interface WriteNoteResult {
64
+ status: WriteStatus;
65
+ mode: WriteMode;
66
+ notePath: string;
67
+ concept: string | null;
68
+ folder: string;
69
+ fields: WriteFieldDescriptor[];
70
+ frontmatter: Record<string, unknown>;
71
+ missingFields: string[];
72
+ violations: WriteContractViolation[];
73
+ reason?: string;
74
+ rejection?: WriteRejection;
75
+ receipt?: WriteReceipt;
76
+ }
34
77
  export declare function safeVaultNotePath(vault: string, notePath: string): string;
35
78
  export declare function prepareCapture(input: CapturePrepareInput): CapturePlan;
79
+ export interface StagedEvaluation {
80
+ ok: boolean;
81
+ violations: WriteContractViolation[];
82
+ frontmatter: Record<string, unknown>;
83
+ body: string;
84
+ }
85
+ /**
86
+ * Acceptance Criteria - staged evaluation (pre-persist).
87
+ *
88
+ * Parses the note content that is ABOUT to be written and re-runs the kernel
89
+ * write contract against the RENDERED frontmatter. This catches divergence
90
+ * between the caller-supplied frontmatter and what actually lands on disk
91
+ * (yaml round-trip artifacts such as `NaN` rendering as `.nan` and parsing
92
+ * back as `null`).
93
+ */
94
+ export declare function evaluateStagedNote(stagedContent: string, concept: Concept, notePath: string, strictZones: ReadonlySet<string>): StagedEvaluation;
95
+ export declare function writeNote(input: WriteNoteInput): Promise<WriteNoteResult>;
36
96
  export declare function commitCapture(input: CaptureCommitInput): Promise<CaptureCommitResult>;