@isaacriehm/cairn-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (616) hide show
  1. package/LICENSE +21 -0
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/claude/error.d.ts +33 -0
  4. package/dist/claude/error.js +58 -0
  5. package/dist/claude/error.js.map +1 -0
  6. package/dist/claude/index.d.ts +3 -0
  7. package/dist/claude/index.js +3 -0
  8. package/dist/claude/index.js.map +1 -0
  9. package/dist/claude/runner.d.ts +11 -0
  10. package/dist/claude/runner.js +132 -0
  11. package/dist/claude/runner.js.map +1 -0
  12. package/dist/claude/types.d.ts +52 -0
  13. package/dist/claude/types.js +14 -0
  14. package/dist/claude/types.js.map +1 -0
  15. package/dist/context/checkpoint.d.ts +10 -0
  16. package/dist/context/checkpoint.js +29 -0
  17. package/dist/context/checkpoint.js.map +1 -0
  18. package/dist/context/handoff-builder.d.ts +11 -0
  19. package/dist/context/handoff-builder.js +268 -0
  20. package/dist/context/handoff-builder.js.map +1 -0
  21. package/dist/context/index.d.ts +11 -0
  22. package/dist/context/index.js +11 -0
  23. package/dist/context/index.js.map +1 -0
  24. package/dist/context/spec-delta.d.ts +47 -0
  25. package/dist/context/spec-delta.js +237 -0
  26. package/dist/context/spec-delta.js.map +1 -0
  27. package/dist/decision-capture/capture.d.ts +57 -0
  28. package/dist/decision-capture/capture.js +186 -0
  29. package/dist/decision-capture/capture.js.map +1 -0
  30. package/dist/decision-capture/extractor.d.ts +20 -0
  31. package/dist/decision-capture/extractor.js +103 -0
  32. package/dist/decision-capture/extractor.js.map +1 -0
  33. package/dist/decision-capture/id.d.ts +21 -0
  34. package/dist/decision-capture/id.js +60 -0
  35. package/dist/decision-capture/id.js.map +1 -0
  36. package/dist/decision-capture/index.d.ts +25 -0
  37. package/dist/decision-capture/index.js +21 -0
  38. package/dist/decision-capture/index.js.map +1 -0
  39. package/dist/decision-capture/prompt.d.ts +15 -0
  40. package/dist/decision-capture/prompt.js +68 -0
  41. package/dist/decision-capture/prompt.js.map +1 -0
  42. package/dist/decision-capture/refinement-prompt.d.ts +25 -0
  43. package/dist/decision-capture/refinement-prompt.js +146 -0
  44. package/dist/decision-capture/refinement-prompt.js.map +1 -0
  45. package/dist/decision-capture/refinement-schema.d.ts +52 -0
  46. package/dist/decision-capture/refinement-schema.js +61 -0
  47. package/dist/decision-capture/refinement-schema.js.map +1 -0
  48. package/dist/decision-capture/refinement.d.ts +60 -0
  49. package/dist/decision-capture/refinement.js +439 -0
  50. package/dist/decision-capture/refinement.js.map +1 -0
  51. package/dist/decision-capture/schema.d.ts +70 -0
  52. package/dist/decision-capture/schema.js +71 -0
  53. package/dist/decision-capture/schema.js.map +1 -0
  54. package/dist/decision-capture/types.d.ts +201 -0
  55. package/dist/decision-capture/types.js +20 -0
  56. package/dist/decision-capture/types.js.map +1 -0
  57. package/dist/decision-capture/writer.d.ts +90 -0
  58. package/dist/decision-capture/writer.js +267 -0
  59. package/dist/decision-capture/writer.js.map +1 -0
  60. package/dist/doctor/index.d.ts +48 -0
  61. package/dist/doctor/index.js +460 -0
  62. package/dist/doctor/index.js.map +1 -0
  63. package/dist/events/index.d.ts +15 -0
  64. package/dist/events/index.js +14 -0
  65. package/dist/events/index.js.map +1 -0
  66. package/dist/events/paths.d.ts +2 -0
  67. package/dist/events/paths.js +6 -0
  68. package/dist/events/paths.js.map +1 -0
  69. package/dist/events/reader.d.ts +40 -0
  70. package/dist/events/reader.js +139 -0
  71. package/dist/events/reader.js.map +1 -0
  72. package/dist/events/writer.d.ts +61 -0
  73. package/dist/events/writer.js +68 -0
  74. package/dist/events/writer.js.map +1 -0
  75. package/dist/frontend-types.d.ts +243 -0
  76. package/dist/frontend-types.js +15 -0
  77. package/dist/frontend-types.js.map +1 -0
  78. package/dist/gc/apply.d.ts +26 -0
  79. package/dist/gc/apply.js +48 -0
  80. package/dist/gc/apply.js.map +1 -0
  81. package/dist/gc/canary.d.ts +42 -0
  82. package/dist/gc/canary.js +134 -0
  83. package/dist/gc/canary.js.map +1 -0
  84. package/dist/gc/citation-integrity.d.ts +24 -0
  85. package/dist/gc/citation-integrity.js +151 -0
  86. package/dist/gc/citation-integrity.js.map +1 -0
  87. package/dist/gc/classify.d.ts +25 -0
  88. package/dist/gc/classify.js +89 -0
  89. package/dist/gc/classify.js.map +1 -0
  90. package/dist/gc/completion-integrity.d.ts +22 -0
  91. package/dist/gc/completion-integrity.js +165 -0
  92. package/dist/gc/completion-integrity.js.map +1 -0
  93. package/dist/gc/doc-gardening.d.ts +29 -0
  94. package/dist/gc/doc-gardening.js +146 -0
  95. package/dist/gc/doc-gardening.js.map +1 -0
  96. package/dist/gc/frontmatter.d.ts +35 -0
  97. package/dist/gc/frontmatter.js +105 -0
  98. package/dist/gc/frontmatter.js.map +1 -0
  99. package/dist/gc/generator-drift.d.ts +28 -0
  100. package/dist/gc/generator-drift.js +53 -0
  101. package/dist/gc/generator-drift.js.map +1 -0
  102. package/dist/gc/index.d.ts +42 -0
  103. package/dist/gc/index.js +30 -0
  104. package/dist/gc/index.js.map +1 -0
  105. package/dist/gc/quality-update.d.ts +23 -0
  106. package/dist/gc/quality-update.js +69 -0
  107. package/dist/gc/quality-update.js.map +1 -0
  108. package/dist/gc/scope-coverage.d.ts +20 -0
  109. package/dist/gc/scope-coverage.js +70 -0
  110. package/dist/gc/scope-coverage.js.map +1 -0
  111. package/dist/gc/stub-hits.d.ts +31 -0
  112. package/dist/gc/stub-hits.js +78 -0
  113. package/dist/gc/stub-hits.js.map +1 -0
  114. package/dist/gc/sweep.d.ts +56 -0
  115. package/dist/gc/sweep.js +205 -0
  116. package/dist/gc/sweep.js.map +1 -0
  117. package/dist/gc/types.d.ts +129 -0
  118. package/dist/gc/types.js +26 -0
  119. package/dist/gc/types.js.map +1 -0
  120. package/dist/gc/walk-source.d.ts +14 -0
  121. package/dist/gc/walk-source.js +59 -0
  122. package/dist/gc/walk-source.js.map +1 -0
  123. package/dist/ground/drift.d.ts +8 -0
  124. package/dist/ground/drift.js +23 -0
  125. package/dist/ground/drift.js.map +1 -0
  126. package/dist/ground/frontmatter.d.ts +20 -0
  127. package/dist/ground/frontmatter.js +49 -0
  128. package/dist/ground/frontmatter.js.map +1 -0
  129. package/dist/ground/glob.d.ts +10 -0
  130. package/dist/ground/glob.js +46 -0
  131. package/dist/ground/glob.js.map +1 -0
  132. package/dist/ground/index.d.ts +16 -0
  133. package/dist/ground/index.js +11 -0
  134. package/dist/ground/index.js.map +1 -0
  135. package/dist/ground/ledgers.d.ts +18 -0
  136. package/dist/ground/ledgers.js +103 -0
  137. package/dist/ground/ledgers.js.map +1 -0
  138. package/dist/ground/manifest.d.ts +10 -0
  139. package/dist/ground/manifest.js +88 -0
  140. package/dist/ground/manifest.js.map +1 -0
  141. package/dist/ground/paths.d.ts +20 -0
  142. package/dist/ground/paths.js +61 -0
  143. package/dist/ground/paths.js.map +1 -0
  144. package/dist/ground/quality-grades.d.ts +11 -0
  145. package/dist/ground/quality-grades.js +98 -0
  146. package/dist/ground/quality-grades.js.map +1 -0
  147. package/dist/ground/schemas.d.ts +306 -0
  148. package/dist/ground/schemas.js +188 -0
  149. package/dist/ground/schemas.js.map +1 -0
  150. package/dist/ground/scope-index.d.ts +48 -0
  151. package/dist/ground/scope-index.js +120 -0
  152. package/dist/ground/scope-index.js.map +1 -0
  153. package/dist/ground/walk.d.ts +7 -0
  154. package/dist/ground/walk.js +53 -0
  155. package/dist/ground/walk.js.map +1 -0
  156. package/dist/hooks/bypass-detection.d.ts +28 -0
  157. package/dist/hooks/bypass-detection.js +106 -0
  158. package/dist/hooks/bypass-detection.js.map +1 -0
  159. package/dist/hooks/index.d.ts +12 -0
  160. package/dist/hooks/index.js +13 -0
  161. package/dist/hooks/index.js.map +1 -0
  162. package/dist/hooks/post-tool-use/allowlist-reader.d.ts +14 -0
  163. package/dist/hooks/post-tool-use/allowlist-reader.js +69 -0
  164. package/dist/hooks/post-tool-use/allowlist-reader.js.map +1 -0
  165. package/dist/hooks/post-tool-use/citation-scanner.d.ts +23 -0
  166. package/dist/hooks/post-tool-use/citation-scanner.js +59 -0
  167. package/dist/hooks/post-tool-use/citation-scanner.js.map +1 -0
  168. package/dist/hooks/post-tool-use/copy-scanner.d.ts +25 -0
  169. package/dist/hooks/post-tool-use/copy-scanner.js +192 -0
  170. package/dist/hooks/post-tool-use/copy-scanner.js.map +1 -0
  171. package/dist/hooks/post-tool-use/index.d.ts +19 -0
  172. package/dist/hooks/post-tool-use/index.js +15 -0
  173. package/dist/hooks/post-tool-use/index.js.map +1 -0
  174. package/dist/hooks/post-tool-use/ledger-cache.d.ts +32 -0
  175. package/dist/hooks/post-tool-use/ledger-cache.js +236 -0
  176. package/dist/hooks/post-tool-use/ledger-cache.js.map +1 -0
  177. package/dist/hooks/post-tool-use/legend-builder.d.ts +15 -0
  178. package/dist/hooks/post-tool-use/legend-builder.js +84 -0
  179. package/dist/hooks/post-tool-use/legend-builder.js.map +1 -0
  180. package/dist/hooks/post-tool-use/read-enricher.d.ts +13 -0
  181. package/dist/hooks/post-tool-use/read-enricher.js +157 -0
  182. package/dist/hooks/post-tool-use/read-enricher.js.map +1 -0
  183. package/dist/hooks/post-tool-use/write-guardian.d.ts +17 -0
  184. package/dist/hooks/post-tool-use/write-guardian.js +176 -0
  185. package/dist/hooks/post-tool-use/write-guardian.js.map +1 -0
  186. package/dist/hooks/read-enrich.d.ts +6 -0
  187. package/dist/hooks/read-enrich.js +11 -0
  188. package/dist/hooks/read-enrich.js.map +1 -0
  189. package/dist/hooks/runners/index.d.ts +12 -0
  190. package/dist/hooks/runners/index.js +11 -0
  191. package/dist/hooks/runners/index.js.map +1 -0
  192. package/dist/hooks/runners/payload.d.ts +32 -0
  193. package/dist/hooks/runners/payload.js +70 -0
  194. package/dist/hooks/runners/payload.js.map +1 -0
  195. package/dist/hooks/runners/session-end.d.ts +7 -0
  196. package/dist/hooks/runners/session-end.js +42 -0
  197. package/dist/hooks/runners/session-end.js.map +1 -0
  198. package/dist/hooks/runners/session-start.d.ts +10 -0
  199. package/dist/hooks/runners/session-start.js +167 -0
  200. package/dist/hooks/runners/session-start.js.map +1 -0
  201. package/dist/hooks/runners/stop.d.ts +18 -0
  202. package/dist/hooks/runners/stop.js +165 -0
  203. package/dist/hooks/runners/stop.js.map +1 -0
  204. package/dist/hooks/session-end.d.ts +5 -0
  205. package/dist/hooks/session-end.js +10 -0
  206. package/dist/hooks/session-end.js.map +1 -0
  207. package/dist/hooks/session-start.d.ts +7 -0
  208. package/dist/hooks/session-start.js +12 -0
  209. package/dist/hooks/session-start.js.map +1 -0
  210. package/dist/hooks/stop.d.ts +5 -0
  211. package/dist/hooks/stop.js +10 -0
  212. package/dist/hooks/stop.js.map +1 -0
  213. package/dist/hooks/write-guard.d.ts +6 -0
  214. package/dist/hooks/write-guard.js +11 -0
  215. package/dist/hooks/write-guard.js.map +1 -0
  216. package/dist/inbox.d.ts +17 -0
  217. package/dist/inbox.js +30 -0
  218. package/dist/inbox.js.map +1 -0
  219. package/dist/index.d.ts +33 -0
  220. package/dist/index.js +32 -0
  221. package/dist/index.js.map +1 -0
  222. package/dist/init/baseline-audit.d.ts +71 -0
  223. package/dist/init/baseline-audit.js +377 -0
  224. package/dist/init/baseline-audit.js.map +1 -0
  225. package/dist/init/brand-setup.d.ts +44 -0
  226. package/dist/init/brand-setup.js +201 -0
  227. package/dist/init/brand-setup.js.map +1 -0
  228. package/dist/init/daemon-autostart.d.ts +16 -0
  229. package/dist/init/daemon-autostart.js +95 -0
  230. package/dist/init/daemon-autostart.js.map +1 -0
  231. package/dist/init/detect.d.ts +25 -0
  232. package/dist/init/detect.js +319 -0
  233. package/dist/init/detect.js.map +1 -0
  234. package/dist/init/index.d.ts +32 -0
  235. package/dist/init/index.js +18 -0
  236. package/dist/init/index.js.map +1 -0
  237. package/dist/init/ingest-docs.d.ts +74 -0
  238. package/dist/init/ingest-docs.js +499 -0
  239. package/dist/init/ingest-docs.js.map +1 -0
  240. package/dist/init/init.d.ts +165 -0
  241. package/dist/init/init.js +1166 -0
  242. package/dist/init/init.js.map +1 -0
  243. package/dist/init/mapper-legacy.d.ts +148 -0
  244. package/dist/init/mapper-legacy.js +238 -0
  245. package/dist/init/mapper-legacy.js.map +1 -0
  246. package/dist/init/mapper-merge.d.ts +38 -0
  247. package/dist/init/mapper-merge.js +238 -0
  248. package/dist/init/mapper-merge.js.map +1 -0
  249. package/dist/init/mapper-parallel.d.ts +48 -0
  250. package/dist/init/mapper-parallel.js +409 -0
  251. package/dist/init/mapper-parallel.js.map +1 -0
  252. package/dist/init/mapper-prompts.d.ts +135 -0
  253. package/dist/init/mapper-prompts.js +189 -0
  254. package/dist/init/mapper-prompts.js.map +1 -0
  255. package/dist/init/mapper.d.ts +211 -0
  256. package/dist/init/mapper.js +151 -0
  257. package/dist/init/mapper.js.map +1 -0
  258. package/dist/init/module-slicer.d.ts +39 -0
  259. package/dist/init/module-slicer.js +809 -0
  260. package/dist/init/module-slicer.js.map +1 -0
  261. package/dist/init/multi-dev/index.d.ts +2 -0
  262. package/dist/init/multi-dev/index.js +2 -0
  263. package/dist/init/multi-dev/index.js.map +1 -0
  264. package/dist/init/multi-dev/install.d.ts +40 -0
  265. package/dist/init/multi-dev/install.js +139 -0
  266. package/dist/init/multi-dev/install.js.map +1 -0
  267. package/dist/init/preflight-guards.d.ts +42 -0
  268. package/dist/init/preflight-guards.js +108 -0
  269. package/dist/init/preflight-guards.js.map +1 -0
  270. package/dist/init/prompts.d.ts +61 -0
  271. package/dist/init/prompts.js +66 -0
  272. package/dist/init/prompts.js.map +1 -0
  273. package/dist/init/rules-merge/discover.d.ts +21 -0
  274. package/dist/init/rules-merge/discover.js +78 -0
  275. package/dist/init/rules-merge/discover.js.map +1 -0
  276. package/dist/init/rules-merge/index.d.ts +10 -0
  277. package/dist/init/rules-merge/index.js +6 -0
  278. package/dist/init/rules-merge/index.js.map +1 -0
  279. package/dist/init/rules-merge/ingest.d.ts +56 -0
  280. package/dist/init/rules-merge/ingest.js +336 -0
  281. package/dist/init/rules-merge/ingest.js.map +1 -0
  282. package/dist/init/rules-merge/keep-markers.d.ts +39 -0
  283. package/dist/init/rules-merge/keep-markers.js +97 -0
  284. package/dist/init/rules-merge/keep-markers.js.map +1 -0
  285. package/dist/init/rules-merge/parse-sections.d.ts +24 -0
  286. package/dist/init/rules-merge/parse-sections.js +71 -0
  287. package/dist/init/rules-merge/parse-sections.js.map +1 -0
  288. package/dist/init/rules-merge/regenerate.d.ts +33 -0
  289. package/dist/init/rules-merge/regenerate.js +163 -0
  290. package/dist/init/rules-merge/regenerate.js.map +1 -0
  291. package/dist/init/secrets.d.ts +18 -0
  292. package/dist/init/secrets.js +76 -0
  293. package/dist/init/secrets.js.map +1 -0
  294. package/dist/init/seed.d.ts +21 -0
  295. package/dist/init/seed.js +96 -0
  296. package/dist/init/seed.js.map +1 -0
  297. package/dist/init/setup-runners.d.ts +15 -0
  298. package/dist/init/setup-runners.js +143 -0
  299. package/dist/init/setup-runners.js.map +1 -0
  300. package/dist/init/source-comments/classify.d.ts +98 -0
  301. package/dist/init/source-comments/classify.js +244 -0
  302. package/dist/init/source-comments/classify.js.map +1 -0
  303. package/dist/init/source-comments/index.d.ts +8 -0
  304. package/dist/init/source-comments/index.js +5 -0
  305. package/dist/init/source-comments/index.js.map +1 -0
  306. package/dist/init/source-comments/ingest.d.ts +51 -0
  307. package/dist/init/source-comments/ingest.js +236 -0
  308. package/dist/init/source-comments/ingest.js.map +1 -0
  309. package/dist/init/source-comments/strip-replace.d.ts +106 -0
  310. package/dist/init/source-comments/strip-replace.js +284 -0
  311. package/dist/init/source-comments/strip-replace.js.map +1 -0
  312. package/dist/init/source-comments/walker.d.ts +65 -0
  313. package/dist/init/source-comments/walker.js +777 -0
  314. package/dist/init/source-comments/walker.js.map +1 -0
  315. package/dist/init/submodules.d.ts +48 -0
  316. package/dist/init/submodules.js +149 -0
  317. package/dist/init/submodules.js.map +1 -0
  318. package/dist/init/types.d.ts +55 -0
  319. package/dist/init/types.js +10 -0
  320. package/dist/init/types.js.map +1 -0
  321. package/dist/init/visual.d.ts +69 -0
  322. package/dist/init/visual.js +265 -0
  323. package/dist/init/visual.js.map +1 -0
  324. package/dist/init/walker.d.ts +82 -0
  325. package/dist/init/walker.js +585 -0
  326. package/dist/init/walker.js.map +1 -0
  327. package/dist/init/workflow-block.d.ts +34 -0
  328. package/dist/init/workflow-block.js +110 -0
  329. package/dist/init/workflow-block.js.map +1 -0
  330. package/dist/join/index.d.ts +67 -0
  331. package/dist/join/index.js +256 -0
  332. package/dist/join/index.js.map +1 -0
  333. package/dist/lock.d.ts +39 -0
  334. package/dist/lock.js +129 -0
  335. package/dist/lock.js.map +1 -0
  336. package/dist/logger.d.ts +13 -0
  337. package/dist/logger.js +78 -0
  338. package/dist/logger.js.map +1 -0
  339. package/dist/mcp/bootstrap-guard.d.ts +29 -0
  340. package/dist/mcp/bootstrap-guard.js +47 -0
  341. package/dist/mcp/bootstrap-guard.js.map +1 -0
  342. package/dist/mcp/context.d.ts +23 -0
  343. package/dist/mcp/context.js +9 -0
  344. package/dist/mcp/context.js.map +1 -0
  345. package/dist/mcp/errors.d.ts +17 -0
  346. package/dist/mcp/errors.js +23 -0
  347. package/dist/mcp/errors.js.map +1 -0
  348. package/dist/mcp/history/index.d.ts +6 -0
  349. package/dist/mcp/history/index.js +5 -0
  350. package/dist/mcp/history/index.js.map +1 -0
  351. package/dist/mcp/history/prompt.d.ts +32 -0
  352. package/dist/mcp/history/prompt.js +99 -0
  353. package/dist/mcp/history/prompt.js.map +1 -0
  354. package/dist/mcp/history/schema.d.ts +58 -0
  355. package/dist/mcp/history/schema.js +41 -0
  356. package/dist/mcp/history/schema.js.map +1 -0
  357. package/dist/mcp/history/summarizer.d.ts +81 -0
  358. package/dist/mcp/history/summarizer.js +196 -0
  359. package/dist/mcp/history/summarizer.js.map +1 -0
  360. package/dist/mcp/history/walker.d.ts +57 -0
  361. package/dist/mcp/history/walker.js +156 -0
  362. package/dist/mcp/history/walker.js.map +1 -0
  363. package/dist/mcp/index.d.ts +13 -0
  364. package/dist/mcp/index.js +9 -0
  365. package/dist/mcp/index.js.map +1 -0
  366. package/dist/mcp/path-allowlist.d.ts +29 -0
  367. package/dist/mcp/path-allowlist.js +71 -0
  368. package/dist/mcp/path-allowlist.js.map +1 -0
  369. package/dist/mcp/result.d.ts +8 -0
  370. package/dist/mcp/result.js +18 -0
  371. package/dist/mcp/result.js.map +1 -0
  372. package/dist/mcp/schemas.d.ts +192 -0
  373. package/dist/mcp/schemas.js +174 -0
  374. package/dist/mcp/schemas.js.map +1 -0
  375. package/dist/mcp/serve.d.ts +15 -0
  376. package/dist/mcp/serve.js +71 -0
  377. package/dist/mcp/serve.js.map +1 -0
  378. package/dist/mcp/server.d.ts +11 -0
  379. package/dist/mcp/server.js +58 -0
  380. package/dist/mcp/server.js.map +1 -0
  381. package/dist/mcp/telemetry.d.ts +15 -0
  382. package/dist/mcp/telemetry.js +13 -0
  383. package/dist/mcp/telemetry.js.map +1 -0
  384. package/dist/mcp/tools/append-run-note.d.ts +18 -0
  385. package/dist/mcp/tools/append-run-note.js +47 -0
  386. package/dist/mcp/tools/append-run-note.js.map +1 -0
  387. package/dist/mcp/tools/append.d.ts +8 -0
  388. package/dist/mcp/tools/append.js +37 -0
  389. package/dist/mcp/tools/append.js.map +1 -0
  390. package/dist/mcp/tools/archive.d.ts +8 -0
  391. package/dist/mcp/tools/archive.js +72 -0
  392. package/dist/mcp/tools/archive.js.map +1 -0
  393. package/dist/mcp/tools/ask-operator.d.ts +34 -0
  394. package/dist/mcp/tools/ask-operator.js +97 -0
  395. package/dist/mcp/tools/ask-operator.js.map +1 -0
  396. package/dist/mcp/tools/canonical-for-topic.d.ts +6 -0
  397. package/dist/mcp/tools/canonical-for-topic.js +40 -0
  398. package/dist/mcp/tools/canonical-for-topic.js.map +1 -0
  399. package/dist/mcp/tools/decision-get.d.ts +6 -0
  400. package/dist/mcp/tools/decision-get.js +49 -0
  401. package/dist/mcp/tools/decision-get.js.map +1 -0
  402. package/dist/mcp/tools/decisions-for-symbol.d.ts +7 -0
  403. package/dist/mcp/tools/decisions-for-symbol.js +42 -0
  404. package/dist/mcp/tools/decisions-for-symbol.js.map +1 -0
  405. package/dist/mcp/tools/decisions-in-scope.d.ts +7 -0
  406. package/dist/mcp/tools/decisions-in-scope.js +47 -0
  407. package/dist/mcp/tools/decisions-in-scope.js.map +1 -0
  408. package/dist/mcp/tools/drop-task.d.ts +12 -0
  409. package/dist/mcp/tools/drop-task.js +68 -0
  410. package/dist/mcp/tools/drop-task.js.map +1 -0
  411. package/dist/mcp/tools/get-full.d.ts +7 -0
  412. package/dist/mcp/tools/get-full.js +46 -0
  413. package/dist/mcp/tools/get-full.js.map +1 -0
  414. package/dist/mcp/tools/ground-get.d.ts +7 -0
  415. package/dist/mcp/tools/ground-get.js +77 -0
  416. package/dist/mcp/tools/ground-get.js.map +1 -0
  417. package/dist/mcp/tools/index.d.ts +3 -0
  418. package/dist/mcp/tools/index.js +40 -0
  419. package/dist/mcp/tools/index.js.map +1 -0
  420. package/dist/mcp/tools/invariant-get.d.ts +6 -0
  421. package/dist/mcp/tools/invariant-get.js +49 -0
  422. package/dist/mcp/tools/invariant-get.js.map +1 -0
  423. package/dist/mcp/tools/invariants-in-scope.d.ts +7 -0
  424. package/dist/mcp/tools/invariants-in-scope.js +62 -0
  425. package/dist/mcp/tools/invariants-in-scope.js.map +1 -0
  426. package/dist/mcp/tools/query-history.d.ts +20 -0
  427. package/dist/mcp/tools/query-history.js +51 -0
  428. package/dist/mcp/tools/query-history.js.map +1 -0
  429. package/dist/mcp/tools/record-decision.d.ts +14 -0
  430. package/dist/mcp/tools/record-decision.js +98 -0
  431. package/dist/mcp/tools/record-decision.js.map +1 -0
  432. package/dist/mcp/tools/record-run-event.d.ts +10 -0
  433. package/dist/mcp/tools/record-run-event.js +32 -0
  434. package/dist/mcp/tools/record-run-event.js.map +1 -0
  435. package/dist/mcp/tools/resolve-attention.d.ts +31 -0
  436. package/dist/mcp/tools/resolve-attention.js +191 -0
  437. package/dist/mcp/tools/resolve-attention.js.map +1 -0
  438. package/dist/mcp/tools/search.d.ts +9 -0
  439. package/dist/mcp/tools/search.js +164 -0
  440. package/dist/mcp/tools/search.js.map +1 -0
  441. package/dist/mcp/tools/supersedes-chain.d.ts +6 -0
  442. package/dist/mcp/tools/supersedes-chain.js +66 -0
  443. package/dist/mcp/tools/supersedes-chain.js.map +1 -0
  444. package/dist/mcp/tools/timeline.d.ts +9 -0
  445. package/dist/mcp/tools/timeline.js +65 -0
  446. package/dist/mcp/tools/timeline.js.map +1 -0
  447. package/dist/mcp/tools/types.d.ts +9 -0
  448. package/dist/mcp/tools/types.js +2 -0
  449. package/dist/mcp/tools/types.js.map +1 -0
  450. package/dist/mirror/clone.d.ts +6 -0
  451. package/dist/mirror/clone.js +48 -0
  452. package/dist/mirror/clone.js.map +1 -0
  453. package/dist/mirror/dirty-overlap.d.ts +13 -0
  454. package/dist/mirror/dirty-overlap.js +42 -0
  455. package/dist/mirror/dirty-overlap.js.map +1 -0
  456. package/dist/mirror/index.d.ts +7 -0
  457. package/dist/mirror/index.js +7 -0
  458. package/dist/mirror/index.js.map +1 -0
  459. package/dist/mirror/paths.d.ts +18 -0
  460. package/dist/mirror/paths.js +45 -0
  461. package/dist/mirror/paths.js.map +1 -0
  462. package/dist/mirror/push.d.ts +9 -0
  463. package/dist/mirror/push.js +27 -0
  464. package/dist/mirror/push.js.map +1 -0
  465. package/dist/mirror/state.d.ts +4 -0
  466. package/dist/mirror/state.js +36 -0
  467. package/dist/mirror/state.js.map +1 -0
  468. package/dist/mirror/sync.d.ts +9 -0
  469. package/dist/mirror/sync.js +33 -0
  470. package/dist/mirror/sync.js.map +1 -0
  471. package/dist/mirror/types.d.ts +77 -0
  472. package/dist/mirror/types.js +2 -0
  473. package/dist/mirror/types.js.map +1 -0
  474. package/dist/paths/index.d.ts +23 -0
  475. package/dist/paths/index.js +50 -0
  476. package/dist/paths/index.js.map +1 -0
  477. package/dist/profiles/index.d.ts +3 -0
  478. package/dist/profiles/index.js +3 -0
  479. package/dist/profiles/index.js.map +1 -0
  480. package/dist/profiles/registry.d.ts +5 -0
  481. package/dist/profiles/registry.js +31 -0
  482. package/dist/profiles/registry.js.map +1 -0
  483. package/dist/profiles/types.d.ts +48 -0
  484. package/dist/profiles/types.js +11 -0
  485. package/dist/profiles/types.js.map +1 -0
  486. package/dist/profiles/unknown.d.ts +9 -0
  487. package/dist/profiles/unknown.js +17 -0
  488. package/dist/profiles/unknown.js.map +1 -0
  489. package/dist/prompt.d.ts +19 -0
  490. package/dist/prompt.js +50 -0
  491. package/dist/prompt.js.map +1 -0
  492. package/dist/sensors/attestation.d.ts +44 -0
  493. package/dist/sensors/attestation.js +262 -0
  494. package/dist/sensors/attestation.js.map +1 -0
  495. package/dist/sensors/catalog.d.ts +41 -0
  496. package/dist/sensors/catalog.js +123 -0
  497. package/dist/sensors/catalog.js.map +1 -0
  498. package/dist/sensors/decisions.d.ts +30 -0
  499. package/dist/sensors/decisions.js +393 -0
  500. package/dist/sensors/decisions.js.map +1 -0
  501. package/dist/sensors/diff.d.ts +27 -0
  502. package/dist/sensors/diff.js +148 -0
  503. package/dist/sensors/diff.js.map +1 -0
  504. package/dist/sensors/index.d.ts +13 -0
  505. package/dist/sensors/index.js +9 -0
  506. package/dist/sensors/index.js.map +1 -0
  507. package/dist/sensors/remediation.d.ts +20 -0
  508. package/dist/sensors/remediation.js +65 -0
  509. package/dist/sensors/remediation.js.map +1 -0
  510. package/dist/sensors/runner.d.ts +44 -0
  511. package/dist/sensors/runner.js +95 -0
  512. package/dist/sensors/runner.js.map +1 -0
  513. package/dist/sensors/structural.d.ts +30 -0
  514. package/dist/sensors/structural.js +204 -0
  515. package/dist/sensors/structural.js.map +1 -0
  516. package/dist/sensors/stub-catalog.d.ts +39 -0
  517. package/dist/sensors/stub-catalog.js +115 -0
  518. package/dist/sensors/stub-catalog.js.map +1 -0
  519. package/dist/sensors/types.d.ts +135 -0
  520. package/dist/sensors/types.js +14 -0
  521. package/dist/sensors/types.js.map +1 -0
  522. package/dist/session/events-marker.d.ts +39 -0
  523. package/dist/session/events-marker.js +74 -0
  524. package/dist/session/events-marker.js.map +1 -0
  525. package/dist/session/id.d.ts +83 -0
  526. package/dist/session/id.js +166 -0
  527. package/dist/session/id.js.map +1 -0
  528. package/dist/session/index.d.ts +14 -0
  529. package/dist/session/index.js +13 -0
  530. package/dist/session/index.js.map +1 -0
  531. package/dist/session-start/build.d.ts +53 -0
  532. package/dist/session-start/build.js +645 -0
  533. package/dist/session-start/build.js.map +1 -0
  534. package/dist/session-start/index.d.ts +18 -0
  535. package/dist/session-start/index.js +18 -0
  536. package/dist/session-start/index.js.map +1 -0
  537. package/dist/session-start/templates.d.ts +6 -0
  538. package/dist/session-start/templates.js +38 -0
  539. package/dist/session-start/templates.js.map +1 -0
  540. package/dist/status-line/format.d.ts +14 -0
  541. package/dist/status-line/format.js +40 -0
  542. package/dist/status-line/format.js.map +1 -0
  543. package/dist/status-line/index.d.ts +29 -0
  544. package/dist/status-line/index.js +14 -0
  545. package/dist/status-line/index.js.map +1 -0
  546. package/dist/status-line/reader.d.ts +13 -0
  547. package/dist/status-line/reader.js +76 -0
  548. package/dist/status-line/reader.js.map +1 -0
  549. package/dist/status-line/writer.d.ts +33 -0
  550. package/dist/status-line/writer.js +72 -0
  551. package/dist/status-line/writer.js.map +1 -0
  552. package/dist/tier0/classify.d.ts +10 -0
  553. package/dist/tier0/classify.js +110 -0
  554. package/dist/tier0/classify.js.map +1 -0
  555. package/dist/tier0/index.d.ts +2 -0
  556. package/dist/tier0/index.js +2 -0
  557. package/dist/tier0/index.js.map +1 -0
  558. package/dist/tier0/ollama.d.ts +22 -0
  559. package/dist/tier0/ollama.js +63 -0
  560. package/dist/tier0/ollama.js.map +1 -0
  561. package/dist/tier0/types.d.ts +24 -0
  562. package/dist/tier0/types.js +9 -0
  563. package/dist/tier0/types.js.map +1 -0
  564. package/dist/tightener/index.d.ts +4 -0
  565. package/dist/tightener/index.js +4 -0
  566. package/dist/tightener/index.js.map +1 -0
  567. package/dist/tightener/prompt.d.ts +3 -0
  568. package/dist/tightener/prompt.js +67 -0
  569. package/dist/tightener/prompt.js.map +1 -0
  570. package/dist/tightener/schema.d.ts +68 -0
  571. package/dist/tightener/schema.js +44 -0
  572. package/dist/tightener/schema.js.map +1 -0
  573. package/dist/tightener/tighten.d.ts +2 -0
  574. package/dist/tightener/tighten.js +66 -0
  575. package/dist/tightener/tighten.js.map +1 -0
  576. package/dist/tightener/types.d.ts +74 -0
  577. package/dist/tightener/types.js +6 -0
  578. package/dist/tightener/types.js.map +1 -0
  579. package/dist/voice/index.d.ts +4 -0
  580. package/dist/voice/index.js +4 -0
  581. package/dist/voice/index.js.map +1 -0
  582. package/dist/voice/model.d.ts +23 -0
  583. package/dist/voice/model.js +46 -0
  584. package/dist/voice/model.js.map +1 -0
  585. package/dist/voice/pipe.d.ts +9 -0
  586. package/dist/voice/pipe.js +47 -0
  587. package/dist/voice/pipe.js.map +1 -0
  588. package/dist/voice/transcribe.d.ts +3 -0
  589. package/dist/voice/transcribe.js +43 -0
  590. package/dist/voice/transcribe.js.map +1 -0
  591. package/dist/voice/types.d.ts +26 -0
  592. package/dist/voice/types.js +9 -0
  593. package/dist/voice/types.js.map +1 -0
  594. package/package.json +54 -0
  595. package/templates/.archive/README.md +67 -0
  596. package/templates/.cairn/JOIN.md +87 -0
  597. package/templates/.cairn/config/sensors.yaml +185 -0
  598. package/templates/.cairn/config/stub-patterns.yaml +231 -0
  599. package/templates/.cairn/config/trust-policy.yaml +95 -0
  600. package/templates/.cairn/config/workflow.md +230 -0
  601. package/templates/.cairn/git-hooks/commit-msg +17 -0
  602. package/templates/.cairn/git-hooks/post-commit +28 -0
  603. package/templates/.cairn/git-hooks/pre-commit +24 -0
  604. package/templates/.cairn/ground/brand/overview.md +24 -0
  605. package/templates/.cairn/ground/brand/voice.md +20 -0
  606. package/templates/.cairn/ground/canonical-map/topics.yaml +54 -0
  607. package/templates/.cairn/ground/capabilities/mcp-tools.yaml +4 -0
  608. package/templates/.cairn/ground/capabilities/skills.yaml +3 -0
  609. package/templates/.cairn/ground/capabilities/snippets.yaml +3 -0
  610. package/templates/.cairn/ground/manifest.yaml +16 -0
  611. package/templates/.cairn/ground/product/personas.yaml +4 -0
  612. package/templates/.cairn/ground/product/positioning.md +21 -0
  613. package/templates/.claude/settings.json +57 -0
  614. package/templates/.github/workflows/cairn-check.yml +31 -0
  615. package/templates/.mcp.json +8 -0
  616. package/templates/README.md +24 -0
@@ -0,0 +1,231 @@
1
+ # Layer A — mechanical stub-pattern catalog.
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.
5
+ #
6
+ # Each pattern is language-tagged. The orchestrator filters patterns by the
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).
10
+ #
11
+ # Format:
12
+ # - id: <stable identifier; cited in failure messages>
13
+ # languages: [<typescript|javascript|python|ruby|go|rust|sql>]
14
+ # description: <one-liner shown in remediation prompt>
15
+ # regex: <ECMAScript regex; multiline-mode>
16
+ # severity: hard | soft
17
+ #
18
+ # Severity:
19
+ # - hard: any match fails the run unconditionally
20
+ # - soft: match contributes to attestation cross-check (a `stubs_introduced: 0`
21
+ # claim becomes a lie if any soft pattern matches)
22
+
23
+ version: 1
24
+
25
+ patterns:
26
+
27
+ # ── TODO / FIXME / XXX / HACK markers ───────────────────────────────────
28
+ - id: todo-marker
29
+ languages: [typescript, javascript, python, ruby, go, rust]
30
+ description: "TODO/FIXME/XXX/HACK comment — flag as introduced-debt."
31
+ regex: '(?://|#|/\*)\s*(TODO|FIXME|XXX|HACK)\b'
32
+ severity: soft
33
+
34
+ # ── "not implemented" throws ─────────────────────────────────────────────
35
+ - id: throw-not-implemented
36
+ languages: [typescript, javascript]
37
+ description: "throw new Error('not implemented') — empty stub disguised as code."
38
+ regex: 'throw\s+new\s+Error\s*\(\s*[''"`][^''"`]*not[\s_]?implemented[^''"`]*[''"`]\s*\)'
39
+ severity: hard
40
+
41
+ - id: throw-todo
42
+ languages: [typescript, javascript]
43
+ description: "throw new Error('TODO ...') — same as not-implemented."
44
+ regex: 'throw\s+new\s+Error\s*\(\s*[''"`]\s*TODO\b'
45
+ severity: hard
46
+
47
+ - id: python-not-implemented
48
+ languages: [python]
49
+ description: "raise NotImplementedError — Python equivalent of the above."
50
+ regex: 'raise\s+NotImplementedError\b'
51
+ severity: hard
52
+
53
+ - id: rust-todo-macro
54
+ languages: [rust]
55
+ description: "todo!() / unimplemented!() macro — Rust placeholder."
56
+ regex: '\b(todo|unimplemented)!\s*\('
57
+ severity: hard
58
+
59
+ - id: rust-panic-todo
60
+ languages: [rust]
61
+ description: "panic!(\"todo\" / \"not implemented\") — disguised stub."
62
+ regex: 'panic!\s*\(\s*"(todo|not\s+implemented)\b'
63
+ severity: hard
64
+
65
+ - id: go-todo-panic
66
+ languages: [go]
67
+ description: "panic(\"TODO\" / \"unimplemented\") — Go placeholder."
68
+ regex: 'panic\s*\(\s*"(TODO|unimplemented|not\s+implemented)'
69
+ severity: hard
70
+
71
+ # ── Empty function bodies pretending to be implementations ──────────────
72
+ - id: empty-async-body
73
+ languages: [typescript, javascript]
74
+ description: "async function with empty body — async fn () => {} masquerades as work."
75
+ regex: 'async\s+(function\s+\w+\s*\([^)]*\)|\([^)]*\)\s*=>)\s*\{\s*\}'
76
+ severity: hard
77
+
78
+ - id: arrow-returning-undefined
79
+ languages: [typescript, javascript]
80
+ description: "() => {} or () => undefined — placeholder lambda."
81
+ regex: '=>\s*(\{\s*\}|undefined)\s*[,;)]'
82
+ severity: soft
83
+
84
+ - id: python-pass-only
85
+ languages: [python]
86
+ description: "Function whose only body is `pass` — Python empty stub."
87
+ regex: 'def\s+\w+\s*\([^)]*\)\s*(->[^:]+)?:\s*\n\s*pass\s*\n'
88
+ severity: hard
89
+
90
+ # ── "as any" / type escape hatches ──────────────────────────────────────
91
+ - id: ts-as-any
92
+ languages: [typescript]
93
+ description: "`as any` — type escape hatch; almost always indicates undone work."
94
+ regex: '\bas\s+any\b'
95
+ severity: soft
96
+
97
+ - id: ts-any-cast-bang
98
+ languages: [typescript]
99
+ description: "Non-null assertion + any cast pattern: `(x as any)!` — double evasion."
100
+ regex: '\(\s*[\w.]+\s+as\s+any\s*\)!'
101
+ severity: hard
102
+
103
+ # ── Type-checker / linter suppressions without justification ────────────
104
+ - id: ts-ignore-bare
105
+ languages: [typescript, javascript]
106
+ description: "`// @ts-ignore` without a reason comment on the same/next line."
107
+ regex: '//\s*@ts-ignore\s*$'
108
+ severity: hard
109
+
110
+ - id: ts-expect-error-bare
111
+ languages: [typescript, javascript]
112
+ description: "`// @ts-expect-error` without a reason."
113
+ regex: '//\s*@ts-expect-error\s*$'
114
+ severity: hard
115
+
116
+ - id: eslint-disable-bare
117
+ languages: [typescript, javascript]
118
+ description: "eslint-disable-next-line without rule name + reason."
119
+ regex: '//\s*eslint-disable(-next-line)?\s*$'
120
+ severity: hard
121
+
122
+ # ── Returning empty/null/zero collections as fake results ───────────────
123
+ - id: only-return-null
124
+ languages: [typescript, javascript]
125
+ description: "Function whose entire body is `return null;` (one-line stub)."
126
+ regex: '\{\s*return\s+null\s*;?\s*\}'
127
+ severity: soft
128
+
129
+ - id: only-return-undefined
130
+ languages: [typescript, javascript]
131
+ description: "Function whose entire body is `return;` or `return undefined;`."
132
+ regex: '\{\s*return\s*(undefined)?\s*;?\s*\}'
133
+ severity: soft
134
+
135
+ - id: only-return-empty-array
136
+ languages: [typescript, javascript]
137
+ description: "Function whose entire body is `return [];` (suspicious for query funcs)."
138
+ regex: '\{\s*return\s*\[\s*\]\s*;?\s*\}'
139
+ severity: soft
140
+
141
+ - id: only-return-empty-object
142
+ languages: [typescript, javascript]
143
+ description: "Function whose entire body is `return {};`."
144
+ regex: '\{\s*return\s*\{\s*\}\s*;?\s*\}'
145
+ severity: soft
146
+
147
+ - id: only-resolve-void
148
+ languages: [typescript, javascript]
149
+ description: "Function whose entire body is `return Promise.resolve();`."
150
+ regex: '\{\s*return\s+Promise\.resolve\s*\(\s*\)\s*;?\s*\}'
151
+ severity: hard
152
+
153
+ # ── Console-log-as-implementation ───────────────────────────────────────
154
+ - id: console-log-stub
155
+ languages: [typescript, javascript]
156
+ description: "console.log('not implemented') / console.warn('TODO ...') as the only body."
157
+ regex: 'console\.(log|warn|error)\s*\(\s*[''"`][^''"`]*(not\s+implemented|TODO|stub|placeholder)'
158
+ severity: hard
159
+
160
+ # ── Decorator + always-undefined fields (NestJS / class-validator) ──────
161
+ - id: optional-always-undefined
162
+ languages: [typescript]
163
+ description: "@IsOptional() field with no other validators or assignment — fake-thoroughness DTO field."
164
+ regex: '@IsOptional\s*\(\s*\)\s*\n\s*\w+\??:\s*\w+\s*;\s*$'
165
+ severity: soft
166
+
167
+ # ── Dead/commented-out code blocks ──────────────────────────────────────
168
+ - id: commented-block-3-plus-lines
169
+ languages: [typescript, javascript, python, ruby, go, rust]
170
+ description: "Block of 3+ consecutive commented-out code lines (not doc comments)."
171
+ regex: '(?:^[\t ]*//[^\n]*\n){3,}'
172
+ severity: soft
173
+
174
+ - id: commented-out-import
175
+ languages: [typescript, javascript]
176
+ description: "Commented-out import statement — usually leftover from undone work."
177
+ regex: '^\s*//\s*import\s+'
178
+ severity: soft
179
+
180
+ # ── Test placeholders ───────────────────────────────────────────────────
181
+ - id: it-skip-no-reason
182
+ languages: [typescript, javascript]
183
+ description: "it.skip / describe.skip / test.skip without a // reason — silent skip is a stub."
184
+ regex: '\b(it|describe|test|specify)\.skip\s*\([^)]*\)\s*[^/]*$'
185
+ severity: soft
186
+
187
+ - id: xit-bare
188
+ languages: [typescript, javascript]
189
+ description: "xit / xdescribe — Jasmine-era skip macro."
190
+ regex: '\b(xit|xdescribe|xtest)\s*\('
191
+ severity: hard
192
+
193
+ # ── Suppress-unused tricks ──────────────────────────────────────────────
194
+ - id: void-suppress-unused
195
+ languages: [typescript, javascript]
196
+ description: "`void unused;` to suppress tsc-unused — usually means feature half-implemented."
197
+ regex: '^\s*void\s+\w+\s*;\s*$'
198
+ severity: soft
199
+
200
+ - id: underscore-prefixed-arg
201
+ languages: [typescript]
202
+ description: "Function arg renamed `_unused` to escape the linter without using it. (Soft — may be legitimate.)"
203
+ regex: '\(\s*_\w+\s*:'
204
+ severity: soft
205
+
206
+ # ── Hard-coded "fake" values ────────────────────────────────────────────
207
+ - id: foo-bar-baz
208
+ languages: [typescript, javascript, python, ruby, go, rust]
209
+ description: "String literal foo / bar / baz / lorem in production-path code."
210
+ regex: '[''"`](foo|bar|baz|qux|lorem)[''"`]'
211
+ severity: soft
212
+
213
+ - id: dummy-placeholder
214
+ languages: [typescript, javascript, python, ruby, go, rust]
215
+ description: "String literal containing 'dummy', 'placeholder', or 'TODO' as the value itself."
216
+ regex: '[''"`](dummy|placeholder|TODO|stub)[''"`]'
217
+ severity: soft
218
+
219
+ # ── Ad-hoc time hacks ───────────────────────────────────────────────────
220
+ - id: setTimeout-await
221
+ languages: [typescript, javascript]
222
+ description: "setTimeout used as `await new Promise(r => setTimeout(r, N))` — pause-as-fix is almost always a stub."
223
+ regex: 'await\s+new\s+Promise\s*\(\s*\w+\s*=>\s*setTimeout\s*\(\s*\w+\s*,\s*\d+'
224
+ severity: soft
225
+
226
+ # ── SQL stubs ───────────────────────────────────────────────────────────
227
+ - id: sql-select-1
228
+ languages: [sql]
229
+ description: "Migration/query containing only `SELECT 1` — placeholder."
230
+ regex: '^\s*SELECT\s+1\s*;?\s*$'
231
+ severity: soft
@@ -0,0 +1,95 @@
1
+ # Trust policy.
2
+ #
3
+ # Per-command trust posture (WORKFLOW_GUIDE.md §3 + §8). Three classes:
4
+ #
5
+ # read_only no friction — runs without any operator confirmation
6
+ # write_creating light friction — single-tap reaction or button confirm
7
+ # configuration heavy friction — operator must edit a config file
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.
12
+
13
+ version: 1
14
+
15
+ commands:
16
+
17
+ # ── Read-only — no friction ───────────────────────────────────────────
18
+ - id: status
19
+ posture: read_only
20
+ surface: slash
21
+ - id: queue
22
+ posture: read_only
23
+ surface: slash
24
+ - id: eval
25
+ posture: read_only
26
+ surface: slash
27
+ - id: agent_list
28
+ posture: read_only
29
+ surface: slash
30
+ - id: help
31
+ posture: read_only
32
+ surface: slash
33
+
34
+ # ── 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
+ - id: direction
49
+ posture: write_creating
50
+ surface: slash
51
+ confirmation: green_red_pre_commit
52
+ - id: archive
53
+ posture: write_creating
54
+ surface: slash
55
+ confirmation: green_confirm_with_reason
56
+ - id: resume
57
+ posture: write_creating
58
+ surface: slash
59
+ confirmation: none
60
+ - id: ship_anyway
61
+ posture: write_creating_logged_override
62
+ surface: slash
63
+ confirmation: none # logged for audit; no friction
64
+ - id: halt
65
+ posture: write_creating
66
+ surface: slash
67
+ confirmation: none
68
+
69
+ # ── Configuration — high-friction by design ─────────────────────────────
70
+ - id: enable_auto_merge_code_class
71
+ posture: configuration
72
+ surface: workflow_yaml_edit
73
+ - id: disable_sensor
74
+ posture: configuration
75
+ surface: workflow_yaml_edit
76
+ - id: change_pilot_module
77
+ posture: configuration
78
+ 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
+ - id: change_off_limits
86
+ posture: configuration
87
+ surface: workflow_yaml_edit
88
+
89
+ # Default routing for out-of-band notifications.
90
+ notification_routing:
91
+ errors: all_registered_adapters
92
+ completions: all_registered_adapters
93
+ paged_events: all_registered_adapters
94
+ uat_approval_request: first_registered_adapter
95
+ voice_capable_only: discord
@@ -0,0 +1,230 @@
1
+ ---
2
+ type: workflow-policy
3
+ status: draft
4
+ audience: dual
5
+ generated: 2026-05-02T13:19:00Z
6
+ verified-at: 2026-05-02T13:19:00Z
7
+ source-commits:
8
+ - manual
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
+ # ──────────────────────────────────────────────────────────────────────────────
92
+ # Project-extension placeholder.
93
+ #
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).
97
+ #
98
+ # 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.
102
+ # ──────────────────────────────────────────────────────────────────────────────
103
+
104
+ <project_name>:
105
+ pilot_module: ALL # full repo, OR a glob like core/src/integrations/**
106
+ off_limits:
107
+ - .git/**
108
+ - .archive/**
109
+ - .env
110
+ - .env.local
111
+ - node_modules/**
112
+ # adopting project extends with its own off-limits paths at init
113
+ high_stakes_globs: [] # populated at init from stack-profile heuristic + operator confirm
114
+ trust_posture:
115
+ safe_class_auto_merge: true
116
+ code_class_auto_merge: false
117
+ 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
+
125
+ ---
126
+
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
221
+
222
+ Stop when the acceptance criteria are met AND the attestation block is complete AND no in-scope assertion or invariant is contradicted.
223
+
224
+ If you cannot proceed (genuine ambiguity, missing context, contradicting decisions), emit a `blocked_by` field instead of a partial diff:
225
+
226
+ ```yaml
227
+ blocked_by:
228
+ reason: "<one line>"
229
+ needed_from_operator: "<one line>"
230
+ ```
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env bash
2
+ # Cairn commit-msg hook (versioned, per-clone activation via core.hooksPath).
3
+ #
4
+ # Spec: PLUGIN_ARCHITECTURE §17 Layer 1.
5
+ #
6
+ # Validates DEC/TSK/§V citations in the commit message body when the
7
+ # project's commit policy requires them. The Cairn CLI owns the policy
8
+ # (sensors.yaml `commit_msg_policy`) so the hook stays a thin shim.
9
+
10
+ set -e
11
+
12
+ if ! command -v cairn > /dev/null 2>&1; then
13
+ # If Cairn isn't on PATH, the pre-commit hook already blocked.
14
+ exit 0
15
+ fi
16
+
17
+ exec cairn sensor-run --commit-msg "$1" "$@"
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+ # Cairn post-commit hook (versioned, per-clone activation via core.hooksPath).
3
+ #
4
+ # Spec: PLUGIN_ARCHITECTURE §17 Layer 1 (bypass tracking).
5
+ #
6
+ # Records the SHA of the commit that just succeeded into
7
+ # `.cairn/.attested-commits`. The Stop hook uses this list to detect
8
+ # `--no-verify` bypasses and surface them inline.
9
+
10
+ set -e
11
+
12
+ if ! command -v git > /dev/null 2>&1; then
13
+ exit 0
14
+ fi
15
+
16
+ REPO_ROOT="$(git rev-parse --show-toplevel 2> /dev/null || true)"
17
+ if [ -z "$REPO_ROOT" ]; then
18
+ exit 0
19
+ fi
20
+
21
+ SHA="$(git rev-parse --verify HEAD 2> /dev/null || true)"
22
+ if [ -z "$SHA" ]; then
23
+ exit 0
24
+ fi
25
+
26
+ mkdir -p "$REPO_ROOT/.cairn"
27
+ echo "$SHA" >> "$REPO_ROOT/.cairn/.attested-commits"
28
+ exit 0
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bash
2
+ # Cairn pre-commit hook (versioned, per-clone activation via core.hooksPath).
3
+ #
4
+ # Spec: PLUGIN_ARCHITECTURE §17 Layer 1.
5
+ #
6
+ # Fails the commit when:
7
+ # - Cairn CLI is missing from PATH
8
+ # - sensor-run --staged exits non-zero
9
+ #
10
+ # To opt out a project: rm .cairn/ (irreversible).
11
+ # Bypass for a single commit: git commit --no-verify (CI gate still catches).
12
+
13
+ set -e
14
+
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
22
+ fi
23
+
24
+ exec cairn sensor-run --staged "$@"
@@ -0,0 +1,24 @@
1
+ ---
2
+ type: rule
3
+ status: draft
4
+ audience: dual
5
+ generated: 2026-05-04T00:00:00Z
6
+ verified-at: 2026-05-04T00:00:00Z
7
+ source-commits:
8
+ - manual
9
+ ---
10
+
11
+ # Brand overview
12
+
13
+ <!--
14
+ Fill this in. This file is injected at every SessionStart so the AI knows
15
+ what your product looks and sounds like before it makes design decisions.
16
+ Keep it short — one paragraph max, < 200 tokens. Cover: product personality,
17
+ tone, what to avoid. Detailed colors/typography go in colors.yaml /
18
+ typography.yaml.
19
+
20
+ While status is `draft`, the AI will see a [DRAFT] hint in its context and
21
+ ask before making design decisions. Flip status to `accepted` once filled.
22
+ -->
23
+
24
+ (operator: replace this paragraph with your brand summary)
@@ -0,0 +1,20 @@
1
+ ---
2
+ type: rule
3
+ status: draft
4
+ audience: dual
5
+ generated: 2026-05-04T00:00:00Z
6
+ verified-at: 2026-05-04T00:00:00Z
7
+ source-commits:
8
+ - manual
9
+ ---
10
+
11
+ # Brand voice
12
+
13
+ <!--
14
+ Tone, vocabulary, communication style. Read at every SessionStart so the AI
15
+ knows how to talk in this project. Keep tight — < 200 tokens.
16
+
17
+ Flip status to `accepted` once filled.
18
+ -->
19
+
20
+ (operator: replace this paragraph with how Claude should communicate)