@isaacriehm/cairn-core 0.1.10 → 0.3.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 (399) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/claude/runner.d.ts +1 -1
  3. package/dist/claude/runner.js +62 -1
  4. package/dist/claude/runner.js.map +1 -1
  5. package/dist/claude/types.d.ts +14 -7
  6. package/dist/claude/types.js +5 -7
  7. package/dist/claude/types.js.map +1 -1
  8. package/dist/context/index.d.ts +4 -4
  9. package/dist/context/index.js +3 -4
  10. package/dist/context/index.js.map +1 -1
  11. package/dist/context/spec-delta.js +3 -4
  12. package/dist/context/spec-delta.js.map +1 -1
  13. package/dist/context/task-summary.d.ts +18 -0
  14. package/dist/context/task-summary.js +89 -0
  15. package/dist/context/task-summary.js.map +1 -0
  16. package/dist/decision-capture/id.d.ts +21 -4
  17. package/dist/decision-capture/id.js +56 -5
  18. package/dist/decision-capture/id.js.map +1 -1
  19. package/dist/decision-capture/index.d.ts +7 -22
  20. package/dist/decision-capture/index.js +7 -17
  21. package/dist/decision-capture/index.js.map +1 -1
  22. package/dist/doctor/index.d.ts +2 -2
  23. package/dist/doctor/index.js +5 -60
  24. package/dist/doctor/index.js.map +1 -1
  25. package/dist/events/index.d.ts +1 -1
  26. package/dist/events/index.js +1 -1
  27. package/dist/events/writer.d.ts +1 -1
  28. package/dist/events/writer.js +1 -1
  29. package/dist/gc/canary.d.ts +13 -23
  30. package/dist/gc/canary.js +36 -92
  31. package/dist/gc/canary.js.map +1 -1
  32. package/dist/gc/citation-integrity.d.ts +6 -6
  33. package/dist/gc/citation-integrity.js +64 -20
  34. package/dist/gc/citation-integrity.js.map +1 -1
  35. package/dist/gc/frontmatter.js +1 -1
  36. package/dist/gc/generator-drift.js +1 -1
  37. package/dist/gc/generator-drift.js.map +1 -1
  38. package/dist/gc/index.d.ts +2 -2
  39. package/dist/gc/index.js +1 -1
  40. package/dist/gc/index.js.map +1 -1
  41. package/dist/gc/quality-update.d.ts +4 -4
  42. package/dist/gc/quality-update.js +5 -5
  43. package/dist/gc/quality-update.js.map +1 -1
  44. package/dist/gc/types.d.ts +1 -30
  45. package/dist/ground/index.d.ts +2 -2
  46. package/dist/ground/index.js +1 -1
  47. package/dist/ground/index.js.map +1 -1
  48. package/dist/ground/ledgers.d.ts +0 -4
  49. package/dist/ground/ledgers.js +10 -8
  50. package/dist/ground/ledgers.js.map +1 -1
  51. package/dist/ground/manifest.js +0 -4
  52. package/dist/ground/manifest.js.map +1 -1
  53. package/dist/ground/paths.js +0 -1
  54. package/dist/ground/paths.js.map +1 -1
  55. package/dist/ground/quality-grades.js +3 -1
  56. package/dist/ground/quality-grades.js.map +1 -1
  57. package/dist/ground/schemas.d.ts +2 -7
  58. package/dist/ground/schemas.js +7 -2
  59. package/dist/ground/schemas.js.map +1 -1
  60. package/dist/ground/scope-index.d.ts +62 -14
  61. package/dist/ground/scope-index.js +215 -45
  62. package/dist/ground/scope-index.js.map +1 -1
  63. package/dist/hooks/bypass-detection.js +14 -17
  64. package/dist/hooks/bypass-detection.js.map +1 -1
  65. package/dist/hooks/defer.d.ts +50 -0
  66. package/dist/hooks/defer.js +87 -0
  67. package/dist/hooks/defer.js.map +1 -0
  68. package/dist/hooks/post-tool-use/citation-scanner.d.ts +7 -5
  69. package/dist/hooks/post-tool-use/citation-scanner.js +15 -9
  70. package/dist/hooks/post-tool-use/citation-scanner.js.map +1 -1
  71. package/dist/hooks/post-tool-use/copy-scanner.js +1 -1
  72. package/dist/hooks/post-tool-use/copy-scanner.js.map +1 -1
  73. package/dist/hooks/post-tool-use/ledger-cache.d.ts +10 -2
  74. package/dist/hooks/post-tool-use/ledger-cache.js +58 -4
  75. package/dist/hooks/post-tool-use/ledger-cache.js.map +1 -1
  76. package/dist/hooks/post-tool-use/legend-builder.d.ts +3 -3
  77. package/dist/hooks/post-tool-use/legend-builder.js +30 -8
  78. package/dist/hooks/post-tool-use/legend-builder.js.map +1 -1
  79. package/dist/hooks/post-tool-use/read-enricher.d.ts +1 -1
  80. package/dist/hooks/post-tool-use/read-enricher.js +68 -21
  81. package/dist/hooks/post-tool-use/read-enricher.js.map +1 -1
  82. package/dist/hooks/post-tool-use/write-guardian.js +148 -18
  83. package/dist/hooks/post-tool-use/write-guardian.js.map +1 -1
  84. package/dist/hooks/runners/index.d.ts +3 -0
  85. package/dist/hooks/runners/index.js +2 -0
  86. package/dist/hooks/runners/index.js.map +1 -1
  87. package/dist/hooks/runners/payload.d.ts +1 -1
  88. package/dist/hooks/runners/payload.js +27 -12
  89. package/dist/hooks/runners/payload.js.map +1 -1
  90. package/dist/hooks/runners/session-start.js +250 -75
  91. package/dist/hooks/runners/session-start.js.map +1 -1
  92. package/dist/hooks/runners/stop.d.ts +9 -12
  93. package/dist/hooks/runners/stop.js +129 -41
  94. package/dist/hooks/runners/stop.js.map +1 -1
  95. package/dist/hooks/runners/user-prompt-submit.d.ts +15 -0
  96. package/dist/hooks/runners/user-prompt-submit.js +149 -0
  97. package/dist/hooks/runners/user-prompt-submit.js.map +1 -0
  98. package/dist/hooks/seed-attested.d.ts +25 -0
  99. package/dist/hooks/seed-attested.js +84 -0
  100. package/dist/hooks/seed-attested.js.map +1 -0
  101. package/dist/hooks/user-prompt-submit.d.ts +7 -0
  102. package/dist/hooks/user-prompt-submit.js +12 -0
  103. package/dist/hooks/user-prompt-submit.js.map +1 -0
  104. package/dist/index.d.ts +3 -6
  105. package/dist/index.js +14 -12
  106. package/dist/index.js.map +1 -1
  107. package/dist/init/baseline-audit.d.ts +5 -1
  108. package/dist/init/baseline-audit.js +25 -2
  109. package/dist/init/baseline-audit.js.map +1 -1
  110. package/dist/init/glob-inference.d.ts +16 -0
  111. package/dist/init/glob-inference.js +108 -0
  112. package/dist/init/glob-inference.js.map +1 -0
  113. package/dist/init/index.d.ts +4 -0
  114. package/dist/init/index.js +2 -0
  115. package/dist/init/index.js.map +1 -1
  116. package/dist/init/ingest-docs.d.ts +1 -1
  117. package/dist/init/ingest-docs.js +19 -6
  118. package/dist/init/ingest-docs.js.map +1 -1
  119. package/dist/init/init.js +17 -94
  120. package/dist/init/init.js.map +1 -1
  121. package/dist/init/mapper-merge.d.ts +8 -2
  122. package/dist/init/mapper-merge.js +50 -32
  123. package/dist/init/mapper-merge.js.map +1 -1
  124. package/dist/init/mapper-parallel.d.ts +2 -3
  125. package/dist/init/mapper-parallel.js +9 -38
  126. package/dist/init/mapper-parallel.js.map +1 -1
  127. package/dist/init/mapper-prompts.js +1 -1
  128. package/dist/init/mapper-prompts.js.map +1 -1
  129. package/dist/init/mapper.d.ts +7 -128
  130. package/dist/init/mapper.js +30 -7
  131. package/dist/init/mapper.js.map +1 -1
  132. package/dist/init/module-slicer.d.ts +1 -1
  133. package/dist/init/module-slicer.js +1 -1
  134. package/dist/init/multi-dev/install.d.ts +9 -10
  135. package/dist/init/multi-dev/install.js +15 -84
  136. package/dist/init/multi-dev/install.js.map +1 -1
  137. package/dist/init/overlay.d.ts +14 -0
  138. package/dist/init/overlay.js +65 -0
  139. package/dist/init/overlay.js.map +1 -0
  140. package/dist/init/phases/1-detect.d.ts +10 -0
  141. package/dist/init/phases/1-detect.js +36 -0
  142. package/dist/init/phases/1-detect.js.map +1 -0
  143. package/dist/init/phases/10-strip.d.ts +11 -0
  144. package/dist/init/phases/10-strip.js +79 -0
  145. package/dist/init/phases/10-strip.js.map +1 -0
  146. package/dist/init/phases/12-multidev.d.ts +6 -0
  147. package/dist/init/phases/12-multidev.js +34 -0
  148. package/dist/init/phases/12-multidev.js.map +1 -0
  149. package/dist/init/phases/2-walker.d.ts +8 -0
  150. package/dist/init/phases/2-walker.js +34 -0
  151. package/dist/init/phases/2-walker.js.map +1 -0
  152. package/dist/init/phases/3-mapper.d.ts +14 -0
  153. package/dist/init/phases/3-mapper.js +56 -0
  154. package/dist/init/phases/3-mapper.js.map +1 -0
  155. package/dist/init/phases/3b-seed.d.ts +18 -0
  156. package/dist/init/phases/3b-seed.js +140 -0
  157. package/dist/init/phases/3b-seed.js.map +1 -0
  158. package/dist/init/phases/4-pilot.d.ts +10 -0
  159. package/dist/init/phases/4-pilot.js +108 -0
  160. package/dist/init/phases/4-pilot.js.map +1 -0
  161. package/dist/init/phases/5-brand.d.ts +10 -0
  162. package/dist/init/phases/5-brand.js +66 -0
  163. package/dist/init/phases/5-brand.js.map +1 -0
  164. package/dist/init/phases/6-docs-ingest.d.ts +11 -0
  165. package/dist/init/phases/6-docs-ingest.js +39 -0
  166. package/dist/init/phases/6-docs-ingest.js.map +1 -0
  167. package/dist/init/phases/7b-source-comments.d.ts +6 -0
  168. package/dist/init/phases/7b-source-comments.js +34 -0
  169. package/dist/init/phases/7b-source-comments.js.map +1 -0
  170. package/dist/init/phases/7c-rules-merge.d.ts +6 -0
  171. package/dist/init/phases/7c-rules-merge.js +34 -0
  172. package/dist/init/phases/7c-rules-merge.js.map +1 -0
  173. package/dist/init/phases/8-baseline.d.ts +10 -0
  174. package/dist/init/phases/8-baseline.js +52 -0
  175. package/dist/init/phases/8-baseline.js.map +1 -0
  176. package/dist/init/phases/index.d.ts +15 -0
  177. package/dist/init/phases/index.js +16 -0
  178. package/dist/init/phases/index.js.map +1 -0
  179. package/dist/init/phases/orchestrator.d.ts +49 -0
  180. package/dist/init/phases/orchestrator.js +85 -0
  181. package/dist/init/phases/orchestrator.js.map +1 -0
  182. package/dist/init/phases/state-io.d.ts +19 -0
  183. package/dist/init/phases/state-io.js +73 -0
  184. package/dist/init/phases/state-io.js.map +1 -0
  185. package/dist/init/phases/types.d.ts +93 -0
  186. package/dist/init/phases/types.js +30 -0
  187. package/dist/init/phases/types.js.map +1 -0
  188. package/dist/init/prompts.d.ts +6 -8
  189. package/dist/init/prompts.js +3 -6
  190. package/dist/init/prompts.js.map +1 -1
  191. package/dist/init/rules-merge/ingest.js +1 -1
  192. package/dist/init/seed.js +11 -2
  193. package/dist/init/seed.js.map +1 -1
  194. package/dist/init/source-comments/classify.d.ts +1 -41
  195. package/dist/init/source-comments/classify.js +68 -37
  196. package/dist/init/source-comments/classify.js.map +1 -1
  197. package/dist/init/source-comments/index.d.ts +2 -2
  198. package/dist/init/source-comments/index.js +2 -2
  199. package/dist/init/source-comments/index.js.map +1 -1
  200. package/dist/init/source-comments/ingest.d.ts +38 -2
  201. package/dist/init/source-comments/ingest.js +237 -4
  202. package/dist/init/source-comments/ingest.js.map +1 -1
  203. package/dist/init/source-comments/strip-replace.d.ts +10 -19
  204. package/dist/init/source-comments/strip-replace.js +26 -2
  205. package/dist/init/source-comments/strip-replace.js.map +1 -1
  206. package/dist/init/source-comments/walker.d.ts +9 -2
  207. package/dist/init/source-comments/walker.js +38 -19
  208. package/dist/init/source-comments/walker.js.map +1 -1
  209. package/dist/init/submodules.d.ts +3 -2
  210. package/dist/init/types.d.ts +3 -5
  211. package/dist/init/types.js +3 -5
  212. package/dist/init/types.js.map +1 -1
  213. package/dist/init/visual.d.ts +4 -9
  214. package/dist/init/visual.js +1 -16
  215. package/dist/init/visual.js.map +1 -1
  216. package/dist/init/walker.d.ts +0 -6
  217. package/dist/init/walker.js +2 -3
  218. package/dist/init/walker.js.map +1 -1
  219. package/dist/join/index.js +49 -2
  220. package/dist/join/index.js.map +1 -1
  221. package/dist/logger.d.ts +1 -2
  222. package/dist/logger.js +5 -6
  223. package/dist/logger.js.map +1 -1
  224. package/dist/mcp/context.d.ts +2 -3
  225. package/dist/mcp/context.js.map +1 -1
  226. package/dist/mcp/errors.d.ts +1 -1
  227. package/dist/mcp/errors.js.map +1 -1
  228. package/dist/mcp/history/prompt.d.ts +2 -1
  229. package/dist/mcp/history/walker.js +1 -1
  230. package/dist/mcp/history/walker.js.map +1 -1
  231. package/dist/mcp/path-allowlist.d.ts +0 -6
  232. package/dist/mcp/path-allowlist.js +0 -10
  233. package/dist/mcp/path-allowlist.js.map +1 -1
  234. package/dist/mcp/schemas.d.ts +34 -72
  235. package/dist/mcp/schemas.js +40 -70
  236. package/dist/mcp/schemas.js.map +1 -1
  237. package/dist/mcp/serve.d.ts +1 -1
  238. package/dist/mcp/serve.js +2 -5
  239. package/dist/mcp/serve.js.map +1 -1
  240. package/dist/mcp/server.js +10 -4
  241. package/dist/mcp/server.js.map +1 -1
  242. package/dist/mcp/telemetry.d.ts +8 -1
  243. package/dist/mcp/telemetry.js +16 -0
  244. package/dist/mcp/telemetry.js.map +1 -1
  245. package/dist/mcp/tools/decision-get.js +37 -29
  246. package/dist/mcp/tools/decision-get.js.map +1 -1
  247. package/dist/mcp/tools/decisions-in-scope.js +22 -3
  248. package/dist/mcp/tools/decisions-in-scope.js.map +1 -1
  249. package/dist/mcp/tools/ground-get.js +2 -2
  250. package/dist/mcp/tools/ground-get.js.map +1 -1
  251. package/dist/mcp/tools/index.js +6 -2
  252. package/dist/mcp/tools/index.js.map +1 -1
  253. package/dist/mcp/tools/init-phases.d.ts +24 -0
  254. package/dist/mcp/tools/init-phases.js +140 -0
  255. package/dist/mcp/tools/init-phases.js.map +1 -0
  256. package/dist/mcp/tools/invariant-get.js +1 -1
  257. package/dist/mcp/tools/invariant-get.js.map +1 -1
  258. package/dist/mcp/tools/invariants-in-scope.js +26 -7
  259. package/dist/mcp/tools/invariants-in-scope.js.map +1 -1
  260. package/dist/mcp/tools/query-history.js +3 -3
  261. package/dist/mcp/tools/query-history.js.map +1 -1
  262. package/dist/mcp/tools/resolve-attention.d.ts +6 -4
  263. package/dist/mcp/tools/resolve-attention.js +253 -24
  264. package/dist/mcp/tools/resolve-attention.js.map +1 -1
  265. package/dist/mcp/tools/search.js +3 -4
  266. package/dist/mcp/tools/search.js.map +1 -1
  267. package/dist/mcp/tools/task-create.d.ts +15 -0
  268. package/dist/mcp/tools/task-create.js +96 -0
  269. package/dist/mcp/tools/task-create.js.map +1 -0
  270. package/dist/mcp/tools/timeline.js +3 -7
  271. package/dist/mcp/tools/timeline.js.map +1 -1
  272. package/dist/profiles/types.d.ts +2 -2
  273. package/dist/profiles/types.js +1 -1
  274. package/dist/sensors/catalog.js +8 -3
  275. package/dist/sensors/catalog.js.map +1 -1
  276. package/dist/session/id.d.ts +1 -3
  277. package/dist/session/id.js +1 -1
  278. package/dist/session/id.js.map +1 -1
  279. package/dist/session-start/build.d.ts +7 -11
  280. package/dist/session-start/build.js +62 -34
  281. package/dist/session-start/build.js.map +1 -1
  282. package/dist/session-start/index.d.ts +2 -2
  283. package/dist/session-start/index.js +2 -2
  284. package/dist/session-start/index.js.map +1 -1
  285. package/dist/session-start/templates.d.ts +20 -4
  286. package/dist/session-start/templates.js +45 -35
  287. package/dist/session-start/templates.js.map +1 -1
  288. package/dist/status-line/format.d.ts +20 -9
  289. package/dist/status-line/format.js +45 -35
  290. package/dist/status-line/format.js.map +1 -1
  291. package/dist/status-line/index.d.ts +3 -4
  292. package/dist/status-line/index.js +1 -1
  293. package/dist/status-line/index.js.map +1 -1
  294. package/dist/status-line/reader.d.ts +9 -6
  295. package/dist/status-line/reader.js +50 -18
  296. package/dist/status-line/reader.js.map +1 -1
  297. package/dist/status-line/writer.d.ts +6 -9
  298. package/dist/status-line/writer.js +10 -12
  299. package/dist/status-line/writer.js.map +1 -1
  300. package/dist/trace/index.d.ts +44 -0
  301. package/dist/trace/index.js +51 -0
  302. package/dist/trace/index.js.map +1 -0
  303. package/package.json +2 -3
  304. package/templates/.archive/README.md +3 -3
  305. package/templates/.cairn/JOIN.md +3 -9
  306. package/templates/.cairn/config/sensors.yaml +16 -19
  307. package/templates/.cairn/config/stub-patterns.yaml +4 -4
  308. package/templates/.cairn/config/trust-policy.yaml +3 -35
  309. package/templates/.cairn/config/workflow.md +13 -194
  310. package/templates/.cairn/git-hooks/commit-msg +15 -4
  311. package/templates/.cairn/git-hooks/pre-commit +22 -13
  312. package/templates/.cairn/ground/canonical-map/topics.yaml +3 -26
  313. package/templates/.cairn/ground/capabilities/snippets.yaml +0 -1
  314. package/templates/.cairn/ground/manifest.yaml +5 -8
  315. package/templates/.cairn/ground/product/personas.yaml +0 -1
  316. package/dist/context/checkpoint.d.ts +0 -10
  317. package/dist/context/checkpoint.js +0 -29
  318. package/dist/context/checkpoint.js.map +0 -1
  319. package/dist/decision-capture/capture.d.ts +0 -57
  320. package/dist/decision-capture/capture.js +0 -186
  321. package/dist/decision-capture/capture.js.map +0 -1
  322. package/dist/decision-capture/extractor.d.ts +0 -20
  323. package/dist/decision-capture/extractor.js +0 -103
  324. package/dist/decision-capture/extractor.js.map +0 -1
  325. package/dist/decision-capture/prompt.d.ts +0 -15
  326. package/dist/decision-capture/prompt.js +0 -68
  327. package/dist/decision-capture/prompt.js.map +0 -1
  328. package/dist/decision-capture/refinement-prompt.d.ts +0 -25
  329. package/dist/decision-capture/refinement-prompt.js +0 -146
  330. package/dist/decision-capture/refinement-prompt.js.map +0 -1
  331. package/dist/decision-capture/refinement-schema.d.ts +0 -52
  332. package/dist/decision-capture/refinement-schema.js +0 -61
  333. package/dist/decision-capture/refinement-schema.js.map +0 -1
  334. package/dist/decision-capture/refinement.d.ts +0 -60
  335. package/dist/decision-capture/refinement.js +0 -439
  336. package/dist/decision-capture/refinement.js.map +0 -1
  337. package/dist/decision-capture/schema.d.ts +0 -70
  338. package/dist/decision-capture/schema.js +0 -71
  339. package/dist/decision-capture/schema.js.map +0 -1
  340. package/dist/decision-capture/types.d.ts +0 -201
  341. package/dist/decision-capture/types.js +0 -20
  342. package/dist/decision-capture/types.js.map +0 -1
  343. package/dist/decision-capture/writer.d.ts +0 -90
  344. package/dist/decision-capture/writer.js +0 -267
  345. package/dist/decision-capture/writer.js.map +0 -1
  346. package/dist/frontend-types.d.ts +0 -243
  347. package/dist/frontend-types.js +0 -15
  348. package/dist/frontend-types.js.map +0 -1
  349. package/dist/hooks/index.d.ts +0 -12
  350. package/dist/hooks/index.js +0 -13
  351. package/dist/hooks/index.js.map +0 -1
  352. package/dist/inbox.d.ts +0 -17
  353. package/dist/inbox.js +0 -30
  354. package/dist/inbox.js.map +0 -1
  355. package/dist/mcp/tools/append-run-note.d.ts +0 -18
  356. package/dist/mcp/tools/append-run-note.js +0 -47
  357. package/dist/mcp/tools/append-run-note.js.map +0 -1
  358. package/dist/mcp/tools/append.d.ts +0 -8
  359. package/dist/mcp/tools/append.js +0 -37
  360. package/dist/mcp/tools/append.js.map +0 -1
  361. package/dist/mcp/tools/ask-operator.d.ts +0 -34
  362. package/dist/mcp/tools/ask-operator.js +0 -97
  363. package/dist/mcp/tools/ask-operator.js.map +0 -1
  364. package/dist/mcp/tools/drop-task.d.ts +0 -12
  365. package/dist/mcp/tools/drop-task.js +0 -68
  366. package/dist/mcp/tools/drop-task.js.map +0 -1
  367. package/dist/mcp/tools/record-run-event.d.ts +0 -10
  368. package/dist/mcp/tools/record-run-event.js +0 -32
  369. package/dist/mcp/tools/record-run-event.js.map +0 -1
  370. package/dist/prompt.d.ts +0 -19
  371. package/dist/prompt.js +0 -50
  372. package/dist/prompt.js.map +0 -1
  373. package/dist/tier0/classify.d.ts +0 -10
  374. package/dist/tier0/classify.js +0 -110
  375. package/dist/tier0/classify.js.map +0 -1
  376. package/dist/tier0/index.d.ts +0 -2
  377. package/dist/tier0/index.js +0 -2
  378. package/dist/tier0/index.js.map +0 -1
  379. package/dist/tier0/types.d.ts +0 -24
  380. package/dist/tier0/types.js +0 -9
  381. package/dist/tier0/types.js.map +0 -1
  382. package/dist/tightener/index.d.ts +0 -4
  383. package/dist/tightener/index.js +0 -4
  384. package/dist/tightener/index.js.map +0 -1
  385. package/dist/tightener/prompt.d.ts +0 -3
  386. package/dist/tightener/prompt.js +0 -67
  387. package/dist/tightener/prompt.js.map +0 -1
  388. package/dist/tightener/schema.d.ts +0 -68
  389. package/dist/tightener/schema.js +0 -44
  390. package/dist/tightener/schema.js.map +0 -1
  391. package/dist/tightener/tighten.d.ts +0 -2
  392. package/dist/tightener/tighten.js +0 -66
  393. package/dist/tightener/tighten.js.map +0 -1
  394. package/dist/tightener/types.d.ts +0 -74
  395. package/dist/tightener/types.js +0 -6
  396. package/dist/tightener/types.js.map +0 -1
  397. package/templates/.claude/settings.json +0 -57
  398. package/templates/.mcp.json +0 -8
  399. package/templates/README.md +0 -24
@@ -21,7 +21,7 @@ This directory holds files that were once canonical but are no longer current. *
21
21
 
22
22
  ## What does NOT live here
23
23
 
24
- - Files marked `[STALE]` in canonical paths — Cairn rejects this pattern. Stale files are MOVED here, never banner-flagged in place. (See `docs/PRIMER.md` §11 anti-patterns.)
24
+ - Files marked `[STALE]` in canonical paths — Cairn rejects this pattern. Stale files are MOVED here, never banner-flagged in place.
25
25
  - Branches or tagged refs — `.archive/` is filesystem-only.
26
26
  - Secrets — `.env*` patterns stay in `.gitignore` regardless.
27
27
 
@@ -54,7 +54,7 @@ PreToolUse-style interception is **not** used (operator decision 2026-05-04). Th
54
54
 
55
55
  ## Writing to `.archive/`
56
56
 
57
- Only via `cairn_archive(path, reason)`. Direct moves are accepted but discouraged because they bypass the audit log. The MCP tool records the reason, the operator who issued the move (frontend-adapter user-id), and the timestamp.
57
+ Only via `cairn_archive(path, reason)`. Direct moves are accepted but discouraged because they bypass the audit log. The MCP tool records the reason and timestamp.
58
58
 
59
59
  ## Why we don't delete
60
60
 
@@ -64,4 +64,4 @@ Only via `cairn_archive(path, reason)`. Direct moves are accepted but discourage
64
64
 
65
65
  ## Restoring an archived file
66
66
 
67
- `cairn restore <path>` (CLI subcommand, future) — moves a file out of `.archive/<bucket>/` back to its original location and writes a `cairn_record_run_event` of the restoration. Use sparingly.
67
+ `cairn restore <path>` (CLI subcommand, future) — moves a file out of `.archive/<bucket>/` back to its original location and logs the restoration. Use sparingly.
@@ -14,10 +14,12 @@ If you opened this project with Claude Code and the Cairn plugin is
14
14
  enabled, the SessionStart hook detects an unbootstrapped clone and surfaces
15
15
  an inline `[a]` bootstrap prompt. Pick `[a]` once and you are done.
16
16
 
17
- If the plugin isn't installed yet:
17
+ If the plugin isn't installed yet, register the marketplace once and
18
+ install:
18
19
 
19
20
  ```bash
20
21
  # Inside Claude Code
22
+ /plugin marketplace add isaacriehm/cairn
21
23
  /plugin install cairn@isaacriehm-cairn
22
24
  ```
23
25
 
@@ -40,14 +42,6 @@ cairn join # idempotent; safe to re-run
40
42
  versioned pre-commit / post-commit / commit-msg hooks run.
41
43
  3. Creates `.cairn/sessions/` for this clone if missing.
42
44
 
43
- ## Path C — `package.json` `prepare` (Node projects only)
44
-
45
- For Node projects the adoption flow already wires
46
- `prepare: cairn join || true` into `package.json`. Running
47
- `npm install` / `pnpm install` runs `cairn join` for you. The `|| true`
48
- lets the install succeed even if Cairn isn't yet on PATH; the failure
49
- surfaces at first commit attempt instead.
50
-
51
45
  ## Verifying
52
46
 
53
47
  ```bash
@@ -1,15 +1,13 @@
1
1
  # Cairn sensor registry.
2
2
  #
3
- # Sensors are mechanical checks the orchestrator runs against an agent's diff.
3
+ # Sensors are mechanical checks run against an agent's diff.
4
4
  # Listed here are the GENERIC kinds that ship with the Cairn package. Stack
5
- # profiles (typescript-next-nest, python-fastapi, rails, go, rust, unknown see
6
- # INTEGRATION_PLAN.md §16.1) propose profile-specific sensors at adoption; the
7
- # operator confirms each one. Project-specific sensors live in the adopting
8
- # project's extension block (see workflow.md).
5
+ # profiles propose profile-specific sensors at adoption; the operator confirms
6
+ # each one. Project-specific sensors live in the adopting project's extension
7
+ # block (see workflow.md).
9
8
  #
10
- # Per operator answer S1: Cairn package code does NOT hardcode any specific
11
- # project's sensor names. All concrete sensor identifiers below are
12
- # stack-profile-agnostic primitives.
9
+ # Cairn package code does NOT hardcode any specific project's sensor names.
10
+ # All concrete sensor identifiers below are stack-profile-agnostic primitives.
13
11
 
14
12
  version: 1
15
13
 
@@ -80,11 +78,11 @@ sensors:
80
78
  - every_run
81
79
  fail_severity: hard
82
80
 
83
- # ── §V invariant sensors (auto-registered by backprop) ───────────────────
81
+ # ── §INV invariant sensors (auto-registered by backprop) ────────────────
84
82
  - id: invariant-suite
85
83
  layer: invariants
86
84
  kind: invariant_runner
87
- description: "Runs every active §V invariant's linked sensor script (see backprop protocol — PRIMER §13). Active invariants accumulate over time; superseded ones are skipped."
85
+ description: "Runs every active §INV invariant's linked sensor script. Active invariants accumulate over time; superseded ones are skipped."
88
86
  triggers:
89
87
  - every_run
90
88
  sources:
@@ -95,25 +93,25 @@ sensors:
95
93
  - id: reviewer-subagent
96
94
  layer: C
97
95
  kind: inferential
98
- description: "Same model as implementer; fresh context. Reads only spec.tightened.md + diff + decisions ledger + in-scope assertions. Anti-completionist framing. For high-stakes runs, also enforces query-scope completeness (Codex audit Q1)."
96
+ description: "Same model as implementer; fresh context. Reads only spec.tightened.md + diff + decisions ledger + in-scope assertions. Anti-completionist framing. For high-stakes runs, also enforces query-scope completeness."
99
97
  model_strategy: same_as_implementer
100
98
  triggers:
101
99
  - all_layer_d_sensors_passed
102
- fail_severity: soft # produces verdict; orchestrator gates on operator override or auto-fail
100
+ fail_severity: soft
103
101
 
104
102
  # ── Layer E — high-stakes E2E / demo ─────────────────────────────────────
105
103
  - id: e2e-real-db
106
104
  layer: E
107
105
  kind: e2e
108
- description: "Runs the project's E2E suite against a real database (no mocks). High-stakes UAT MUST include a cross-tenant negative fixture (Codex audit Q1) — a request from user/org B against a resource owned by user/org A returning the expected denial."
106
+ description: "Runs the project's E2E suite against a real database (no mocks). High-stakes UAT MUST include a cross-tenant negative fixture — a request from user/org B against a resource owned by user/org A returning the expected denial."
109
107
  triggers:
110
108
  - high_stakes_glob_match
111
109
  profile_hook: profile.e2e_command
112
110
  fail_severity: hard
113
111
  requires:
114
- cross_tenant_fixture: true # per L43
112
+ cross_tenant_fixture: true
115
113
 
116
- # ── Layer U — UAT-on-phone ───────────────────────────────────────────────
114
+ # ── Layer U — UAT headless ───────────────────────────────────────────────
117
115
  - id: uat-headless-chrome
118
116
  layer: U
119
117
  kind: uat
@@ -131,7 +129,7 @@ sensors:
131
129
  - nightly_cron
132
130
  fail_severity: soft
133
131
 
134
- # ── Local-dirty-overlap gate (per Codex audit Q3) ─────────────────────────
132
+ # ── Local-dirty-overlap gate ──────────────────────────────────────────────
135
133
  - id: local-dirty-overlap
136
134
  layer: pre_dispatch
137
135
  kind: working_tree_check
@@ -139,7 +137,7 @@ sensors:
139
137
  triggers:
140
138
  - pre_dispatch
141
139
  - pre_push
142
- fail_severity: soft # operator decides resolution
140
+ fail_severity: soft
143
141
 
144
142
  # ──────────────────────────────────────────────────────────────────────────────
145
143
  # Scoped-glob keys.
@@ -178,8 +176,7 @@ copy_safety:
178
176
 
179
177
  # ──────────────────────────────────────────────────────────────────────────────
180
178
  # Disable list — sensors known to false-positive at >50% on a given project.
181
- # Default empty; populated per-project via /oops dialog (PRIMER §11 anti-pattern:
182
- # we DO NOT mock or stub sensor results to make them pass).
179
+ # Default empty; populated per-project via the attention flow.
183
180
  # ──────────────────────────────────────────────────────────────────────────────
184
181
 
185
182
  disabled_per_project: []
@@ -1,12 +1,12 @@
1
1
  # Layer A — mechanical stub-pattern catalog.
2
2
  #
3
- # Initial seed (~30 patterns). Grows additively via the /oops dialog
4
- # (PRIMER §10 Layer A; L25). Patterns NEVER added by typed CLI command.
3
+ # Initial seed (~30 patterns). Grows additively via the attention flow.
4
+ # Patterns NEVER added by typed CLI command.
5
5
  #
6
6
  # Each pattern is language-tagged. The orchestrator filters patterns by the
7
7
  # stack profile's language list before running. False-positive cases are not
8
- # silenced by editing this file — they're handled per-failure via the /oops
9
- # dialog (PRIMER §11 anti-pattern: do NOT disable sensors to make diffs pass).
8
+ # silenced by editing this file — they're handled per-failure via the attention
9
+ # flow (do NOT disable sensors to make diffs pass).
10
10
  #
11
11
  # Format:
12
12
  # - id: <stable identifier; cited in failure messages>
@@ -1,14 +1,13 @@
1
1
  # Trust policy.
2
2
  #
3
- # Per-command trust posture (WORKFLOW_GUIDE.md §3 + §8). Three classes:
3
+ # Per-command trust posture. Three classes:
4
4
  #
5
5
  # read_only no friction — runs without any operator confirmation
6
6
  # write_creating light friction — single-tap reaction or button confirm
7
7
  # configuration heavy friction — operator must edit a config file
8
8
  #
9
- # Auto-merge classes (PRIMER §12.2) live in workflow.md trust_posture_defaults
10
- # and the project block; this file governs operator INTERACTION friction, not
11
- # git-push friction.
9
+ # Auto-merge classes live in workflow.md trust_posture_defaults and the project
10
+ # block; this file governs operator INTERACTION friction, not git-push friction.
12
11
 
13
12
  version: 1
14
13
 
@@ -18,12 +17,6 @@ commands:
18
17
  - id: status
19
18
  posture: read_only
20
19
  surface: slash
21
- - id: queue
22
- posture: read_only
23
- surface: slash
24
- - id: eval
25
- posture: read_only
26
- surface: slash
27
20
  - id: agent_list
28
21
  posture: read_only
29
22
  surface: slash
@@ -32,19 +25,6 @@ commands:
32
25
  surface: slash
33
26
 
34
27
  # ── Write-creating — single-tap confirm ────────────────────────────────
35
- - id: task
36
- posture: write_creating
37
- surface: slash
38
- confirmation: none # spec tightener handles ambiguity downstream
39
- - id: run
40
- posture: write_creating
41
- surface: slash
42
- confirmation: reaction_if_outside_pilot_scope
43
- timeout_seconds: 30
44
- - id: oops
45
- posture: write_creating
46
- surface: slash
47
- confirmation: per_step_inline_reaction
48
28
  - id: direction
49
29
  posture: write_creating
50
30
  surface: slash
@@ -60,10 +40,6 @@ commands:
60
40
  - id: ship_anyway
61
41
  posture: write_creating_logged_override
62
42
  surface: slash
63
- confirmation: none # logged for audit; no friction
64
- - id: halt
65
- posture: write_creating
66
- surface: slash
67
43
  confirmation: none
68
44
 
69
45
  # ── Configuration — high-friction by design ─────────────────────────────
@@ -76,12 +52,6 @@ commands:
76
52
  - id: change_pilot_module
77
53
  posture: configuration
78
54
  surface: workflow_yaml_edit
79
- - id: change_collaboration_mode
80
- posture: configuration
81
- surface: workflow_yaml_edit
82
- - id: register_frontend_adapter
83
- posture: configuration
84
- surface: workflow_yaml_edit
85
55
  - id: change_off_limits
86
56
  posture: configuration
87
57
  surface: workflow_yaml_edit
@@ -91,5 +61,3 @@ notification_routing:
91
61
  errors: all_registered_adapters
92
62
  completions: all_registered_adapters
93
63
  paged_events: all_registered_adapters
94
- uat_approval_request: first_registered_adapter
95
- voice_capable_only: discord
@@ -7,98 +7,15 @@ verified-at: 2026-05-02T13:19:00Z
7
7
  source-commits:
8
8
  - manual
9
9
 
10
- # ──────────────────────────────────────────────────────────────────────────────
11
- # Top-level (project-agnostic) configuration.
12
- # This block is read by Cairn package code; values here are universal defaults.
13
- # Project-specific overrides go in the `<project_name>:` extension block below.
14
- # ──────────────────────────────────────────────────────────────────────────────
15
-
16
- collaboration_mode: solo # solo | team — see FILESYSTEM_LAYOUT.md §12
17
- concurrency: 1 # single-task FIFO; do not change without re-reviewing PRIMER §5.4
18
-
19
- frontend_adapters:
20
- - discord # discord | notion | cli | web
21
- # operator may register additional adapters; first-registered owns approval-request routing
22
-
23
- tier_assignment:
24
- intent_classifier: 0 # 0 = Ollama; 1 = Haiku 4.5; 2 = Sonnet 4.6; 3 = Opus 4.7
25
- spec_tightener_short: 1
26
- spec_tightener_long: 2
27
- decision_extractor: 1
28
- attestation_check: 0 # mechanical regex; LLM only on ambiguity
29
- implementer_default: 2
30
- implementer_high_stakes: 3
31
- reviewer: 2 # same model as implementer; context isolation does the work
32
- uat_runner: 2
33
- uat_question_agent: 1
34
- backprop_author: 2
35
- garbage_collector: 1
36
- init_mapper: 2 # one-time at adoption; OK to spend tokens
37
-
38
- # Tier-3 (Opus) auto-escalation policy — per Codex audit Finding #9.
39
- escalation:
40
- tier_3_requires_explicit_approval: true
41
- max_attempts_per_task: 3 # halt + page operator after this many retries
42
- pre_run_cost_projection: true # block dispatch on > 1% daily plan-headroom estimate
43
-
44
- # Run lifecycle thresholds.
45
- timeouts:
46
- stall_event_silence_seconds: 300 # no event in 5 min → kill + retry
47
- uat_decision_seconds: 86400 # 24h before auto-deny
48
- approval_dialog_seconds: 30 # 🟢/🔴 confirm window
49
-
50
- # Anthropic plan-quota self-throttle (per WORKFLOW_GUIDE §2.2).
51
- plan_quota_floor_percent: 20 # below this remaining → Cairn self-throttles to Tier 1 only
52
-
53
- # Spec-tightener gate.
54
- spec_quality_floor: 7 # quality_score < floor → operator dialog OR /ship-anyway
55
-
56
- # Dialog rules.
57
- operator_dialog_max_questions_per_turn: 2 # Codex audit Finding #7 — collapse 3+ to single tightened proposal
58
-
59
- # Trust posture defaults — overridden in project block as needed.
60
- trust_posture_defaults:
61
- safe_class_auto_merge: true
62
- code_class_auto_merge: false
63
- high_stakes_auto_merge: false
64
-
65
- # Decision capture defaults.
66
- decision_extractor:
67
- auto_propose_threshold_confidence: 0.7
68
- require_assertions_at_confirm: true
69
-
70
- # Whisper / voice defaults.
71
- voice:
72
- enabled: true
73
- model: large-v3-turbo
74
- quantization: q5_0
75
- language: en
76
- confidence_floor: 0.85 # below → operator confirm-heard prompt
77
- audio_persistence: forbidden # never write audio to disk
78
-
79
- # Local mirror checkout (Cairn operates here, never user's working tree).
80
- mirror:
81
- base_path: "~/.local/cairn/repos" # one subdir per adopted project
82
- state_path: "~/.local/cairn/state" # PIDs, sockets, runtime
83
- models_path: "~/.local/cairn/models"
84
-
85
- # Retention policy.
86
- retention_days:
87
- runs: 90
88
- transcripts: 90
89
- inbox: 30
90
-
91
10
  # ──────────────────────────────────────────────────────────────────────────────
92
11
  # Project-extension placeholder.
93
12
  #
94
- # At adoption (`npx @isaacriehm/cairn init`), the init script REPLACES this
95
- # block with a real key matching the adopting project's `package.json name`
96
- # (or directory name, lowercased, with non-alphanumerics → underscores).
13
+ # At adoption, the init script REPLACES this block with a real key matching
14
+ # the adopting project's `package.json name` (or directory name, lowercased,
15
+ # with non-alphanumerics → underscores).
97
16
  #
98
17
  # Cairn package code reads this block by `Object.keys()` lookup — never by
99
- # hardcoded project name (per L50 + operator-S1).
100
- #
101
- # Example below uses `<project_name>` as the placeholder key.
18
+ # hardcoded project name.
102
19
  # ──────────────────────────────────────────────────────────────────────────────
103
20
 
104
21
  <project_name>:
@@ -115,116 +32,18 @@ retention_days:
115
32
  safe_class_auto_merge: true
116
33
  code_class_auto_merge: false
117
34
  high_stakes_auto_merge: false
118
- budget_metric:
119
- primary: claude_code_subscription_quota
120
- secondary_dollar_record_only: true
121
- pre_run_projection: true
122
- tier_3_requires_explicit_approval: true
123
- max_attempts_per_task: 3
124
35
 
125
36
  ---
126
37
 
127
- # Per-task prompt template
128
-
129
- Below is the rendered-prompt body the orchestrator injects into every agent run. The template engine substitutes `{{var}}` tokens with run-scoped values resolved at dispatch time.
130
-
131
- ## Identity
132
-
133
- You are running inside Cairn as agent role `{{agent_role}}` for project `{{project_name}}`. Your run-id is `{{run_id}}`. The mirror checkout is at `{{mirror_path}}` pinned to `origin/main` SHA `{{sha_pin}}`. Do not modify files outside the mirror. Do not switch branches.
134
-
135
- ## Task
136
-
137
- {{tightened_spec_body}}
138
-
139
- ## Acceptance criteria
140
-
141
- {{#each acceptance_criteria}}
142
- - {{this}}
143
- {{/each}}
144
-
145
- ## Decisions in scope
146
-
147
- The following accepted decisions bind your work. You MUST NOT contradict them. Their machine-readable assertions will be evaluated against your diff.
148
-
149
- {{#each in_scope_decisions}}
150
- - **{{id}}** — {{title}} ({{scope_summary}})
151
- {{/each}}
152
-
153
- If none, this is empty.
154
-
155
- ## Invariants in scope
156
-
157
- The following §V invariants bind your work. They have sensors that will block your commit if violated.
158
-
159
- {{#each in_scope_invariants}}
160
- - **{{id}}** — {{title}}
161
- {{/each}}
162
-
163
- If none, this is empty.
164
-
165
- ## Off-limits paths
166
-
167
- You MUST NOT modify any of these:
168
-
169
- {{#each off_limits}}
170
- - {{this}}
171
- {{/each}}
172
-
173
- ## Sensors that will run
174
-
175
- After your turn, these sensors will execute against your diff. Their failure messages are remediation prompts — read them and retry.
176
-
177
- {{#each scoped_sensors}}
178
- - `{{id}}` — {{description}}
179
- {{/each}}
180
-
181
- ## Honesty contract (Layer B)
182
-
183
- When you emit your final response, include a fenced YAML block titled `attestation` with these fields filled:
184
-
185
- ```yaml
186
- attestation:
187
- delivered:
188
- - symbol: "<name>"
189
- path: "<path>"
190
- behavior: full | partial | scaffolded
191
- sensors_passed: [<sensor_ids>]
192
- deferred:
193
- - symbol: "<name>"
194
- reason: "<one line>"
195
- known_limitations: []
196
- todos_introduced: 0
197
- stubs_introduced: 0
198
- files_touched: ["<paths>"]
199
- ```
200
-
201
- This will be cross-checked against your actual diff. Any mismatch fails the run.
202
-
203
- ## Tools available
204
-
205
- You have the standard Read/Edit/Write/Bash/Glob/Grep tool surface. You also have the Cairn MCP tools — use these for grounding rather than re-reading large files:
206
-
207
- - `cairn_decision_get(id)` — full ADR + assertions
208
- - `cairn_decisions_in_scope(globs[])` — IDs whose scope overlaps your target
209
- - `cairn_invariant_get(id)` — §V invariant + linked sensor
210
- - `cairn_canonical_for_topic(topic)` — canonical doc path + verified-at
211
- - `cairn_query_history(scope, question)` — the ONLY way to read `.archive/`
212
-
213
- ## Constraints
214
-
215
- - Hard cutovers; no backwards-compat shims, no deprecation notices, no transition regex.
216
- - No `[STALE]` banners — stale docs get archived, not labeled.
217
- - No model-issued confidence scores in user-visible writes.
218
- - No commit, no push — Cairn handles git after sensor + reviewer + UAT pass.
219
-
220
- ## Stop conditions
38
+ # Workflow policy
221
39
 
222
- Stop when the acceptance criteria are met AND the attestation block is complete AND no in-scope assertion or invariant is contradicted.
40
+ This file is the on-disk surface for the **project-extension block** that
41
+ `cairn-core/src/sensors/runner.ts` reads (via `Object.keys()` lookup) and
42
+ that the Phase-3 init mapper patches with discovered globs and sensors.
223
43
 
224
- If you cannot proceed (genuine ambiguity, missing context, contradicting decisions), emit a `blocked_by` field instead of a partial diff:
44
+ The plugin-era cairn does NOT use this file as a per-task prompt template
45
+ — each task's spec lives at `.cairn/tasks/active/<task_id>/spec.tightened.md`
46
+ and is written directly by the `cairn-direction` skill. The reviewer
47
+ subagent reads that spec; nothing renders this markdown body.
225
48
 
226
- ```yaml
227
- blocked_by:
228
- reason: "<one line>"
229
- needed_from_operator: "<one line>"
230
- ```
49
+ If you're looking for the daily flow, see `docs/SYSTEM_OVERVIEW.md` §4.
@@ -3,15 +3,26 @@
3
3
  #
4
4
  # Spec: PLUGIN_ARCHITECTURE §17 Layer 1.
5
5
  #
6
- # Validates DEC/TSK/§V citations in the commit message body when the
6
+ # Validates DEC/TSK/§INV citations in the commit message body when the
7
7
  # project's commit policy requires them. The Cairn CLI owns the policy
8
8
  # (sensors.yaml `commit_msg_policy`) so the hook stays a thin shim.
9
9
 
10
10
  set -e
11
11
 
12
- if ! command -v cairn > /dev/null 2>&1; then
13
- # If Cairn isn't on PATH, the pre-commit hook already blocked.
12
+ REPO_ROOT="$(git rev-parse --show-toplevel 2> /dev/null || true)"
13
+ if [ -z "$REPO_ROOT" ] || [ ! -d "$REPO_ROOT/.cairn" ]; then
14
14
  exit 0
15
15
  fi
16
16
 
17
- exec cairn sensor-run --commit-msg "$1" "$@"
17
+ CAIRN_CMD=""
18
+ if [ -f "$REPO_ROOT/.cairn/.cli-path" ]; then
19
+ CAIRN_CMD="$(head -n1 "$REPO_ROOT/.cairn/.cli-path")"
20
+ fi
21
+ if [ -z "$CAIRN_CMD" ] && command -v cairn > /dev/null 2>&1; then
22
+ CAIRN_CMD="cairn"
23
+ fi
24
+ if [ -z "$CAIRN_CMD" ]; then
25
+ exit 0
26
+ fi
27
+
28
+ eval "$CAIRN_CMD sensor-run --commit-msg \"$1\""
@@ -3,22 +3,31 @@
3
3
  #
4
4
  # Spec: PLUGIN_ARCHITECTURE §17 Layer 1.
5
5
  #
6
- # Fails the commit when:
7
- # - Cairn CLI is missing from PATH
8
- # - sensor-run --staged exits non-zero
6
+ # Fails the commit when sensor-run --staged returns non-zero.
9
7
  #
10
- # To opt out a project: rm .cairn/ (irreversible).
11
- # Bypass for a single commit: git commit --no-verify (CI gate still catches).
8
+ # Resolution order:
9
+ # 1. .cairn/.cli-path (written by `cairn join`; points at the bundled
10
+ # cli.mjs for plugin users, the global cairn shim for CLI users).
11
+ # 2. global `cairn` binary on PATH.
12
+ # 3. exit 0 — no enforcement available; SessionStart bootstrap banner
13
+ # will surface on next Claude Code session and re-run join.
12
14
 
13
15
  set -e
14
16
 
15
- if ! command -v cairn > /dev/null 2>&1; then
16
- echo " Cairn CLI not on PATH"
17
- echo " This project requires Cairn. Install:"
18
- echo " /plugin install cairn@isaacriehm-cairn (Claude Code)"
19
- echo " npm install -g @isaacriehm/cairn (CLI)"
20
- echo " Or: rm -rf .cairn/ to opt the project out (irreversible)"
21
- exit 1
17
+ REPO_ROOT="$(git rev-parse --show-toplevel 2> /dev/null || true)"
18
+ if [ -z "$REPO_ROOT" ] || [ ! -d "$REPO_ROOT/.cairn" ]; then
19
+ exit 0
22
20
  fi
23
21
 
24
- exec cairn sensor-run --staged "$@"
22
+ CAIRN_CMD=""
23
+ if [ -f "$REPO_ROOT/.cairn/.cli-path" ]; then
24
+ CAIRN_CMD="$(head -n1 "$REPO_ROOT/.cairn/.cli-path")"
25
+ fi
26
+ if [ -z "$CAIRN_CMD" ] && command -v cairn > /dev/null 2>&1; then
27
+ CAIRN_CMD="cairn"
28
+ fi
29
+ if [ -z "$CAIRN_CMD" ]; then
30
+ exit 0
31
+ fi
32
+
33
+ eval "$CAIRN_CMD sensor-run --staged"
@@ -4,9 +4,7 @@
4
4
  # the authoritative path for a topic — no fuzzy match, no hallucinated paths.
5
5
  #
6
6
  # Adopters extend this registry as their codebase grows. Unknown topics
7
- # return TOPIC_NOT_REGISTERED — agents must NOT invent topics. Add via
8
- # /direction confirmation when an operator references a recurring topic
9
- # the Cairn agents should know about.
7
+ # return TOPIC_NOT_REGISTERED — agents must NOT invent topics.
10
8
  #
11
9
  # Below is a baseline that ships with `cairn init` so every adoption
12
10
  # has a non-empty registry on day one. Trim or extend per project.
@@ -22,33 +20,12 @@ topics:
22
20
  - topic: cairn-architecture
23
21
  canonical_path: docs/ARCHITECTURE.md
24
22
  audience: dual
25
- - topic: cairn-primer
26
- canonical_path: docs/PRIMER.md
27
- audience: dual
28
23
  - topic: cairn-mcp-surface
29
24
  canonical_path: docs/MCP_SURFACE.md
30
25
  audience: dual
31
26
  - topic: cairn-filesystem-layout
32
27
  canonical_path: docs/FILESYSTEM_LAYOUT.md
33
28
  audience: dual
34
- - topic: cairn-workflow-guide
35
- canonical_path: docs/WORKFLOW_GUIDE.md
36
- audience: dual
37
- - topic: cairn-uat-pipeline
38
- canonical_path: docs/UAT_PIPELINE.md
39
- audience: dual
40
- - topic: cairn-sessionstart-spec
41
- canonical_path: docs/SESSIONSTART_SPEC.md
42
- audience: dual
43
- - topic: two-zone-separation
44
- canonical_path: docs/PRIMER.md
45
- audience: dual
46
- - topic: backprop-protocol
47
- canonical_path: docs/PRIMER.md
48
- audience: dual
49
- - topic: garbage-collection-cadence
50
- canonical_path: docs/PRIMER.md
51
- audience: dual
52
- - topic: anti-patterns
53
- canonical_path: docs/PRIMER.md
29
+ - topic: cairn-plugin-architecture
30
+ canonical_path: docs/PLUGIN_ARCHITECTURE.md
54
31
  audience: dual
@@ -1,3 +1,2 @@
1
1
  # Blessed implementations for security-sensitive patterns.
2
- # See DOCS_SPEC.md §3.5 for shape.
3
2
  snippets: []
@@ -1,16 +1,13 @@
1
1
  # Ground manifest — read-only for agents.
2
2
  #
3
- # Continuously regenerated by `cairn watch` (the grounding daemon) on filesystem
4
- # events. Each entry is one canonical-zone file with its hash, classification,
5
- # audience, verified-at, and (for generated artifacts) the source + generator.
3
+ # Regenerated by the GC sweep and post-commit hook. Each entry is one
4
+ # canonical-zone file with its hash, classification, audience, verified-at,
5
+ # and (for generated artifacts) the source + generator.
6
6
  #
7
- # Agents query the MCP tool surface, NOT this file directly. The daemon is the
8
- # only writer. Modifying this file by hand is meaningless — the daemon overwrites
9
- # on next event.
7
+ # Agents query the MCP tool surface, NOT this file directly.
10
8
  #
11
- # Layout per FILESYSTEM_LAYOUT.md §8.
9
+ # Layout per docs/FILESYSTEM_LAYOUT.md §8.
12
10
 
13
11
  version: 1
14
12
  generated: 2026-05-02T13:19:00Z
15
- generator: cairn-watch
16
13
  files: []
@@ -1,4 +1,3 @@
1
1
  # Product personas — who this is for. Read at every SessionStart.
2
- # See DOCS_SPEC.md §3.4 for shape.
3
2
  status: draft
4
3
  personas: []
@@ -1,10 +0,0 @@
1
- /**
2
- * Daemon-driven checkpoint writer — emits a snapshot of the same handoff
3
- * block content to `.cairn/tasks/active/<taskId>/checkpoint-<ISO>.md`.
4
- *
5
- * Spec: docs/CONTEXT_CONTINUITY_SPEC.md §2.2.
6
- *
7
- * Throws if the task directory is missing — daemons should fail loudly when
8
- * pointed at a stale taskId. Successful writes return the absolute path.
9
- */
10
- export declare function writeCheckpoint(repoRoot: string, taskId: string, _runId: string): Promise<string>;