@isaacriehm/cairn-core 0.7.0 → 0.7.1

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 (440) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/align-undo/undo.js +2 -2
  3. package/dist/align-undo/undo.js.map +1 -1
  4. package/dist/attention/bulk-accept.js +48 -40
  5. package/dist/attention/bulk-accept.js.map +1 -1
  6. package/dist/attention/dedup.js +23 -10
  7. package/dist/attention/dedup.js.map +1 -1
  8. package/dist/attention/restore.js +2 -2
  9. package/dist/attention/restore.js.map +1 -1
  10. package/dist/attention/scoring.js +1 -1
  11. package/dist/attention/scoring.js.map +1 -1
  12. package/dist/attention/serve/api.d.ts +1 -0
  13. package/dist/attention/serve/api.js +127 -80
  14. package/dist/attention/serve/api.js.map +1 -1
  15. package/dist/attention/serve/index.d.ts +1 -0
  16. package/dist/attention/serve/index.js +21 -7
  17. package/dist/attention/serve/index.js.map +1 -1
  18. package/dist/attention/source-strip.js +41 -46
  19. package/dist/attention/source-strip.js.map +1 -1
  20. package/dist/claude/cache.d.ts +10 -19
  21. package/dist/claude/cache.js +0 -0
  22. package/dist/claude/cache.js.map +1 -1
  23. package/dist/claude/runner.d.ts +4 -6
  24. package/dist/claude/runner.js +242 -203
  25. package/dist/claude/runner.js.map +1 -1
  26. package/dist/claude/types.d.ts +5 -5
  27. package/dist/context/handoff-builder.d.ts +28 -4
  28. package/dist/context/handoff-builder.js +75 -157
  29. package/dist/context/handoff-builder.js.map +1 -1
  30. package/dist/context/spec-delta.js +61 -9
  31. package/dist/context/spec-delta.js.map +1 -1
  32. package/dist/context/task-summary.js +5 -1
  33. package/dist/context/task-summary.js.map +1 -1
  34. package/dist/decision-capture/id.js +1 -1
  35. package/dist/decision-capture/id.js.map +1 -1
  36. package/dist/doctor/index.d.ts +9 -11
  37. package/dist/doctor/index.js +118 -175
  38. package/dist/doctor/index.js.map +1 -1
  39. package/dist/drain/drain.d.ts +1 -1
  40. package/dist/drain/drain.js +16 -16
  41. package/dist/drain/drain.js.map +1 -1
  42. package/dist/drain/index.d.ts +1 -1
  43. package/dist/drain/index.js +1 -1
  44. package/dist/events/reader.d.ts +9 -10
  45. package/dist/events/reader.js +46 -57
  46. package/dist/events/reader.js.map +1 -1
  47. package/dist/events/writer.js +1 -1
  48. package/dist/events/writer.js.map +1 -1
  49. package/dist/fix-align/index.d.ts +1 -1
  50. package/dist/fix-align/index.js +1 -1
  51. package/dist/fix-align/run.d.ts +1 -1
  52. package/dist/fix-align/run.js +4 -3
  53. package/dist/fix-align/run.js.map +1 -1
  54. package/dist/fix-align/sentinel.d.ts +1 -2
  55. package/dist/fix-align/sentinel.js +3 -4
  56. package/dist/fix-align/sentinel.js.map +1 -1
  57. package/dist/gc/apply.js +1 -1
  58. package/dist/gc/apply.js.map +1 -1
  59. package/dist/gc/attested-commits.d.ts +19 -0
  60. package/dist/gc/attested-commits.js +48 -0
  61. package/dist/gc/attested-commits.js.map +1 -0
  62. package/dist/gc/canary.d.ts +11 -21
  63. package/dist/gc/canary.js +18 -24
  64. package/dist/gc/canary.js.map +1 -1
  65. package/dist/gc/citation-integrity.d.ts +11 -14
  66. package/dist/gc/citation-integrity.js +124 -125
  67. package/dist/gc/citation-integrity.js.map +1 -1
  68. package/dist/gc/classify.d.ts +1 -1
  69. package/dist/gc/classify.js +2 -2
  70. package/dist/gc/classify.js.map +1 -1
  71. package/dist/gc/completion-integrity.d.ts +6 -7
  72. package/dist/gc/completion-integrity.js +45 -53
  73. package/dist/gc/completion-integrity.js.map +1 -1
  74. package/dist/gc/doc-gardening.js +1 -9
  75. package/dist/gc/doc-gardening.js.map +1 -1
  76. package/dist/gc/frontmatter.js +2 -2
  77. package/dist/gc/frontmatter.js.map +1 -1
  78. package/dist/gc/index.d.ts +7 -6
  79. package/dist/gc/index.js +3 -2
  80. package/dist/gc/index.js.map +1 -1
  81. package/dist/gc/quality-update.d.ts +6 -10
  82. package/dist/gc/quality-update.js +12 -15
  83. package/dist/gc/quality-update.js.map +1 -1
  84. package/dist/gc/scope-coverage.js +1 -1
  85. package/dist/gc/scope-coverage.js.map +1 -1
  86. package/dist/gc/stub-hits.d.ts +7 -25
  87. package/dist/gc/stub-hits.js +14 -40
  88. package/dist/gc/stub-hits.js.map +1 -1
  89. package/dist/gc/sweep.js +15 -6
  90. package/dist/gc/sweep.js.map +1 -1
  91. package/dist/gc/types.d.ts +5 -5
  92. package/dist/gc/types.js +2 -2
  93. package/dist/gc/walk-source.js +8 -28
  94. package/dist/gc/walk-source.js.map +1 -1
  95. package/dist/hooks/defer.d.ts +9 -20
  96. package/dist/hooks/defer.js +10 -27
  97. package/dist/hooks/defer.js.map +1 -1
  98. package/dist/hooks/post-tool-use/allowlist-reader.d.ts +2 -1
  99. package/dist/hooks/post-tool-use/allowlist-reader.js +49 -34
  100. package/dist/hooks/post-tool-use/allowlist-reader.js.map +1 -1
  101. package/dist/hooks/post-tool-use/index.d.ts +3 -4
  102. package/dist/hooks/post-tool-use/index.js +3 -3
  103. package/dist/hooks/post-tool-use/index.js.map +1 -1
  104. package/dist/hooks/post-tool-use/legend-builder.d.ts +2 -2
  105. package/dist/hooks/post-tool-use/legend-builder.js +2 -2
  106. package/dist/hooks/post-tool-use/legend-builder.js.map +1 -1
  107. package/dist/hooks/post-tool-use/post-write.d.ts +8 -0
  108. package/dist/hooks/post-tool-use/post-write.js +112 -0
  109. package/dist/hooks/post-tool-use/post-write.js.map +1 -0
  110. package/dist/hooks/post-tool-use/read-enricher.d.ts +10 -5
  111. package/dist/hooks/post-tool-use/read-enricher.js +114 -155
  112. package/dist/hooks/post-tool-use/read-enricher.js.map +1 -1
  113. package/dist/hooks/post-tool-use/sot-align.d.ts +12 -0
  114. package/dist/hooks/post-tool-use/sot-align.js +73 -49
  115. package/dist/hooks/post-tool-use/sot-align.js.map +1 -1
  116. package/dist/hooks/post-tool-use/write-guardian.d.ts +40 -8
  117. package/dist/hooks/post-tool-use/write-guardian.js +202 -254
  118. package/dist/hooks/post-tool-use/write-guardian.js.map +1 -1
  119. package/dist/hooks/pre-commit/sot-align-precommit.js +2 -2
  120. package/dist/hooks/pre-commit/sot-align-precommit.js.map +1 -1
  121. package/dist/hooks/runners/index.d.ts +2 -2
  122. package/dist/hooks/runners/index.js +1 -1
  123. package/dist/hooks/runners/index.js.map +1 -1
  124. package/dist/hooks/runners/payload.d.ts +34 -19
  125. package/dist/hooks/runners/payload.js +47 -44
  126. package/dist/hooks/runners/payload.js.map +1 -1
  127. package/dist/hooks/runners/session-end.js +12 -11
  128. package/dist/hooks/runners/session-end.js.map +1 -1
  129. package/dist/hooks/runners/session-start.d.ts +4 -2
  130. package/dist/hooks/runners/session-start.js +88 -261
  131. package/dist/hooks/runners/session-start.js.map +1 -1
  132. package/dist/hooks/runners/stop.js +27 -8
  133. package/dist/hooks/runners/stop.js.map +1 -1
  134. package/dist/hooks/runners/user-prompt-submit.js +7 -1
  135. package/dist/hooks/runners/user-prompt-submit.js.map +1 -1
  136. package/dist/hooks/sot-align-common.d.ts +1 -2
  137. package/dist/hooks/sot-align-common.js +2 -2
  138. package/dist/hooks/sot-align-common.js.map +1 -1
  139. package/dist/index.d.ts +1 -1
  140. package/dist/index.js +12 -3
  141. package/dist/index.js.map +1 -1
  142. package/dist/init/baseline-audit.d.ts +14 -58
  143. package/dist/init/baseline-audit.js +92 -320
  144. package/dist/init/baseline-audit.js.map +1 -1
  145. package/dist/init/brand-derive.d.ts +11 -15
  146. package/dist/init/brand-derive.js +21 -46
  147. package/dist/init/brand-derive.js.map +1 -1
  148. package/dist/init/brand-setup.d.ts +1 -1
  149. package/dist/init/brand-setup.js +1 -1
  150. package/dist/init/detect.d.ts +25 -6
  151. package/dist/init/detect.js +107 -136
  152. package/dist/init/detect.js.map +1 -1
  153. package/dist/init/index.d.ts +2 -2
  154. package/dist/init/index.js +1 -1
  155. package/dist/init/index.js.map +1 -1
  156. package/dist/init/ingest-docs.d.ts +2 -2
  157. package/dist/init/ingest-docs.js +31 -43
  158. package/dist/init/ingest-docs.js.map +1 -1
  159. package/dist/init/init.d.ts +21 -21
  160. package/dist/init/init.js +41 -61
  161. package/dist/init/init.js.map +1 -1
  162. package/dist/init/mapper-merge.js +1 -1
  163. package/dist/init/mapper-merge.js.map +1 -1
  164. package/dist/init/mapper-parallel.d.ts +1 -1
  165. package/dist/init/mapper-parallel.js +2 -1
  166. package/dist/init/mapper-parallel.js.map +1 -1
  167. package/dist/init/mapper.js +1 -1
  168. package/dist/init/mapper.js.map +1 -1
  169. package/dist/init/multi-dev/install.d.ts +5 -5
  170. package/dist/init/multi-dev/install.js +4 -4
  171. package/dist/init/overlay.js +1 -0
  172. package/dist/init/overlay.js.map +1 -1
  173. package/dist/init/phases/1-detect.js +1 -1
  174. package/dist/init/phases/1-detect.js.map +1 -1
  175. package/dist/init/phases/{7c-rules-merge.d.ts → 10-rules-merge.d.ts} +2 -2
  176. package/dist/init/phases/{7c-rules-merge.js → 10-rules-merge.js} +6 -12
  177. package/dist/init/phases/10-rules-merge.js.map +1 -0
  178. package/dist/init/phases/11-baseline.d.ts +7 -0
  179. package/dist/init/phases/{8-baseline.js → 11-baseline.js} +5 -9
  180. package/dist/init/phases/11-baseline.js.map +1 -0
  181. package/dist/init/phases/12-strip.d.ts +10 -0
  182. package/dist/init/phases/{10-strip.js → 12-strip.js} +10 -14
  183. package/dist/init/phases/12-strip.js.map +1 -0
  184. package/dist/init/phases/{12-multidev.d.ts → 13-multidev.d.ts} +2 -2
  185. package/dist/init/phases/{12-multidev.js → 13-multidev.js} +4 -4
  186. package/dist/init/phases/{12-multidev.js.map → 13-multidev.js.map} +1 -1
  187. package/dist/init/phases/3-mapper.d.ts +1 -1
  188. package/dist/init/phases/3-mapper.js +2 -2
  189. package/dist/init/phases/3-mapper.js.map +1 -1
  190. package/dist/init/phases/{3b-seed.d.ts → 4-seed.d.ts} +2 -2
  191. package/dist/init/phases/{3b-seed.js → 4-seed.js} +7 -7
  192. package/dist/init/phases/4-seed.js.map +1 -0
  193. package/dist/init/phases/{4-pilot.d.ts → 5-pilot.d.ts} +2 -2
  194. package/dist/init/phases/{4-pilot.js → 5-pilot.js} +9 -9
  195. package/dist/init/phases/{4-pilot.js.map → 5-pilot.js.map} +1 -1
  196. package/dist/init/phases/{5-brand.d.ts → 6-brand.d.ts} +2 -7
  197. package/dist/init/phases/{5-brand.js → 6-brand.js} +6 -14
  198. package/dist/init/phases/6-brand.js.map +1 -0
  199. package/dist/init/phases/{5b-topic-index.d.ts → 7-topic-index.d.ts} +2 -11
  200. package/dist/init/phases/{5b-topic-index.js → 7-topic-index.js} +9 -18
  201. package/dist/init/phases/7-topic-index.js.map +1 -0
  202. package/dist/init/phases/8-docs-ingest.d.ts +10 -0
  203. package/dist/init/phases/{6-docs-ingest.js → 8-docs-ingest.js} +6 -11
  204. package/dist/init/phases/8-docs-ingest.js.map +1 -0
  205. package/dist/init/phases/9-source-comments.d.ts +6 -0
  206. package/dist/init/phases/{7b-source-comments.js → 9-source-comments.js} +7 -26
  207. package/dist/init/phases/9-source-comments.js.map +1 -0
  208. package/dist/init/phases/index.d.ts +12 -12
  209. package/dist/init/phases/index.js +11 -11
  210. package/dist/init/phases/index.js.map +1 -1
  211. package/dist/init/phases/{parallel-678.d.ts → parallel-8910.d.ts} +7 -8
  212. package/dist/init/phases/{parallel-678.js → parallel-8910.js} +26 -44
  213. package/dist/init/phases/parallel-8910.js.map +1 -0
  214. package/dist/init/phases/source-comments-output-io.d.ts +3 -3
  215. package/dist/init/phases/source-comments-output-io.js +3 -3
  216. package/dist/init/phases/types.d.ts +1 -1
  217. package/dist/init/phases/types.js +10 -10
  218. package/dist/init/phases/types.js.map +1 -1
  219. package/dist/init/rules-merge/discover.d.ts +2 -2
  220. package/dist/init/rules-merge/discover.js +28 -43
  221. package/dist/init/rules-merge/discover.js.map +1 -1
  222. package/dist/init/rules-merge/ingest.d.ts +6 -6
  223. package/dist/init/rules-merge/ingest.js +9 -10
  224. package/dist/init/rules-merge/ingest.js.map +1 -1
  225. package/dist/init/rules-merge/keep-markers.d.ts +1 -1
  226. package/dist/init/rules-merge/keep-markers.js +1 -1
  227. package/dist/init/rules-merge/regenerate.d.ts +3 -3
  228. package/dist/init/rules-merge/regenerate.js +3 -3
  229. package/dist/init/seed.js +17 -24
  230. package/dist/init/seed.js.map +1 -1
  231. package/dist/init/sot-emit.d.ts +27 -9
  232. package/dist/init/sot-emit.js +39 -7
  233. package/dist/init/sot-emit.js.map +1 -1
  234. package/dist/init/source-comments/classify.d.ts +2 -2
  235. package/dist/init/source-comments/classify.js +9 -1
  236. package/dist/init/source-comments/classify.js.map +1 -1
  237. package/dist/init/source-comments/index.d.ts +1 -1
  238. package/dist/init/source-comments/index.js.map +1 -1
  239. package/dist/init/source-comments/ingest.d.ts +2 -2
  240. package/dist/init/source-comments/ingest.js +6 -8
  241. package/dist/init/source-comments/ingest.js.map +1 -1
  242. package/dist/init/source-comments/strip-replace.js +3 -2
  243. package/dist/init/source-comments/strip-replace.js.map +1 -1
  244. package/dist/init/source-comments/walker.d.ts +3 -26
  245. package/dist/init/source-comments/walker.js +18 -30
  246. package/dist/init/source-comments/walker.js.map +1 -1
  247. package/dist/init/topic-index/index.d.ts +1 -1
  248. package/dist/init/topic-index/index.js +3 -3
  249. package/dist/init/topic-index/index.js.map +1 -1
  250. package/dist/init/topic-index/judge.d.ts +5 -9
  251. package/dist/init/topic-index/judge.js +17 -22
  252. package/dist/init/topic-index/judge.js.map +1 -1
  253. package/dist/init/topic-index/resolve.d.ts +5 -4
  254. package/dist/init/topic-index/resolve.js +6 -6
  255. package/dist/init/topic-index/resolve.js.map +1 -1
  256. package/dist/init/topic-index/walk.d.ts +6 -6
  257. package/dist/init/topic-index/walk.js +9 -9
  258. package/dist/init/topic-index/walk.js.map +1 -1
  259. package/dist/lock.js +4 -1
  260. package/dist/lock.js.map +1 -1
  261. package/dist/logger.js +3 -0
  262. package/dist/logger.js.map +1 -1
  263. package/dist/mcp/history/summarizer.js +1 -1
  264. package/dist/mcp/history/summarizer.js.map +1 -1
  265. package/dist/mcp/history/walker.js +1 -1
  266. package/dist/mcp/history/walker.js.map +1 -1
  267. package/dist/mcp/path-allowlist.js +1 -1
  268. package/dist/mcp/path-allowlist.js.map +1 -1
  269. package/dist/mcp/schemas.d.ts +16 -38
  270. package/dist/mcp/schemas.js +8 -22
  271. package/dist/mcp/schemas.js.map +1 -1
  272. package/dist/mcp/server.js +10 -0
  273. package/dist/mcp/server.js.map +1 -1
  274. package/dist/mcp/tools/archive.js +1 -1
  275. package/dist/mcp/tools/archive.js.map +1 -1
  276. package/dist/mcp/tools/attention-wait.js +12 -2
  277. package/dist/mcp/tools/attention-wait.js.map +1 -1
  278. package/dist/mcp/tools/bulk-accept-attention.js +29 -30
  279. package/dist/mcp/tools/bulk-accept-attention.js.map +1 -1
  280. package/dist/mcp/tools/canonical-for-topic.js +37 -15
  281. package/dist/mcp/tools/canonical-for-topic.js.map +1 -1
  282. package/dist/mcp/tools/decision-get.js +2 -2
  283. package/dist/mcp/tools/decision-get.js.map +1 -1
  284. package/dist/mcp/tools/decisions-for-symbol.js +2 -2
  285. package/dist/mcp/tools/decisions-for-symbol.js.map +1 -1
  286. package/dist/mcp/tools/get-full.js +1 -1
  287. package/dist/mcp/tools/get-full.js.map +1 -1
  288. package/dist/mcp/tools/ground-get.js +1 -1
  289. package/dist/mcp/tools/ground-get.js.map +1 -1
  290. package/dist/mcp/tools/in-scope.d.ts +8 -0
  291. package/dist/mcp/tools/in-scope.js +125 -0
  292. package/dist/mcp/tools/in-scope.js.map +1 -0
  293. package/dist/mcp/tools/index.js +7 -10
  294. package/dist/mcp/tools/index.js.map +1 -1
  295. package/dist/mcp/tools/init-phases.d.ts +3 -2
  296. package/dist/mcp/tools/init-phases.js +125 -124
  297. package/dist/mcp/tools/init-phases.js.map +1 -1
  298. package/dist/mcp/tools/invariant-get.js +2 -2
  299. package/dist/mcp/tools/invariant-get.js.map +1 -1
  300. package/dist/mcp/tools/record-decision.d.ts +4 -3
  301. package/dist/mcp/tools/record-decision.js +111 -36
  302. package/dist/mcp/tools/record-decision.js.map +1 -1
  303. package/dist/mcp/tools/reject-candidate.d.ts +1 -1
  304. package/dist/mcp/tools/reject-candidate.js +3 -3
  305. package/dist/mcp/tools/reject-candidate.js.map +1 -1
  306. package/dist/mcp/tools/resolve-attention.d.ts +5 -18
  307. package/dist/mcp/tools/resolve-attention.js +58 -158
  308. package/dist/mcp/tools/resolve-attention.js.map +1 -1
  309. package/dist/mcp/tools/search-candidates.d.ts +1 -1
  310. package/dist/mcp/tools/search-candidates.js +4 -4
  311. package/dist/mcp/tools/search-candidates.js.map +1 -1
  312. package/dist/mcp/tools/search.js +5 -4
  313. package/dist/mcp/tools/search.js.map +1 -1
  314. package/dist/mcp/tools/supersedes-chain.js +2 -2
  315. package/dist/mcp/tools/supersedes-chain.js.map +1 -1
  316. package/dist/mcp/tools/task-create.d.ts +1 -0
  317. package/dist/mcp/tools/task-create.js +2 -0
  318. package/dist/mcp/tools/task-create.js.map +1 -1
  319. package/dist/mcp/tools/timeline.js +1 -1
  320. package/dist/mcp/tools/timeline.js.map +1 -1
  321. package/dist/mcp/tools/types.d.ts +1 -0
  322. package/dist/mcp/tools/types.js +9 -1
  323. package/dist/mcp/tools/types.js.map +1 -1
  324. package/dist/sensors/attestation.d.ts +1 -1
  325. package/dist/sensors/attestation.js +2 -2
  326. package/dist/sensors/attestation.js.map +1 -1
  327. package/dist/sensors/catalog.d.ts +26 -28
  328. package/dist/sensors/catalog.js +79 -81
  329. package/dist/sensors/catalog.js.map +1 -1
  330. package/dist/sensors/decisions.d.ts +1 -1
  331. package/dist/sensors/decisions.js +15 -14
  332. package/dist/sensors/decisions.js.map +1 -1
  333. package/dist/sensors/diff.js +46 -22
  334. package/dist/sensors/diff.js.map +1 -1
  335. package/dist/sensors/runner.d.ts +2 -2
  336. package/dist/sensors/runner.js +3 -3
  337. package/dist/sensors/shell.d.ts +4 -0
  338. package/dist/sensors/shell.js +16 -0
  339. package/dist/sensors/shell.js.map +1 -0
  340. package/dist/sensors/structural.d.ts +3 -2
  341. package/dist/sensors/structural.js +3 -11
  342. package/dist/sensors/structural.js.map +1 -1
  343. package/dist/sensors/stub-catalog.d.ts +2 -1
  344. package/dist/sensors/stub-catalog.js +2 -9
  345. package/dist/sensors/stub-catalog.js.map +1 -1
  346. package/dist/sensors/types.d.ts +3 -4
  347. package/dist/sensors/types.js +1 -2
  348. package/dist/sensors/types.js.map +1 -1
  349. package/dist/session-start/build.js +1 -1
  350. package/dist/session-start/build.js.map +1 -1
  351. package/dist/status-line/event-queue.js +1 -1
  352. package/dist/status-line/index.d.ts +1 -1
  353. package/package.json +3 -2
  354. package/templates/.cairn/config/sensors.yaml +8 -8
  355. package/templates/attention-ui/app.js +61 -36
  356. package/dist/fs.d.ts +0 -5
  357. package/dist/fs.js +0 -11
  358. package/dist/fs.js.map +0 -1
  359. package/dist/ground/alignment-pending.d.ts +0 -28
  360. package/dist/ground/alignment-pending.js +0 -83
  361. package/dist/ground/alignment-pending.js.map +0 -1
  362. package/dist/ground/anchor-map.d.ts +0 -14
  363. package/dist/ground/anchor-map.js +0 -56
  364. package/dist/ground/anchor-map.js.map +0 -1
  365. package/dist/ground/drift.d.ts +0 -8
  366. package/dist/ground/drift.js +0 -23
  367. package/dist/ground/drift.js.map +0 -1
  368. package/dist/ground/file-candidates-map.d.ts +0 -23
  369. package/dist/ground/file-candidates-map.js +0 -76
  370. package/dist/ground/file-candidates-map.js.map +0 -1
  371. package/dist/ground/frontmatter.d.ts +0 -32
  372. package/dist/ground/frontmatter.js +0 -77
  373. package/dist/ground/frontmatter.js.map +0 -1
  374. package/dist/ground/glob.d.ts +0 -10
  375. package/dist/ground/glob.js +0 -46
  376. package/dist/ground/glob.js.map +0 -1
  377. package/dist/ground/index.d.ts +0 -25
  378. package/dist/ground/index.js +0 -19
  379. package/dist/ground/index.js.map +0 -1
  380. package/dist/ground/ledgers.d.ts +0 -14
  381. package/dist/ground/ledgers.js +0 -105
  382. package/dist/ground/ledgers.js.map +0 -1
  383. package/dist/ground/manifest.d.ts +0 -10
  384. package/dist/ground/manifest.js +0 -84
  385. package/dist/ground/manifest.js.map +0 -1
  386. package/dist/ground/paths.d.ts +0 -43
  387. package/dist/ground/paths.js +0 -109
  388. package/dist/ground/paths.js.map +0 -1
  389. package/dist/ground/quality-grades.d.ts +0 -11
  390. package/dist/ground/quality-grades.js +0 -100
  391. package/dist/ground/quality-grades.js.map +0 -1
  392. package/dist/ground/rejected.d.ts +0 -42
  393. package/dist/ground/rejected.js +0 -100
  394. package/dist/ground/rejected.js.map +0 -1
  395. package/dist/ground/schemas.d.ts +0 -582
  396. package/dist/ground/schemas.js +0 -372
  397. package/dist/ground/schemas.js.map +0 -1
  398. package/dist/ground/scope-index.d.ts +0 -96
  399. package/dist/ground/scope-index.js +0 -290
  400. package/dist/ground/scope-index.js.map +0 -1
  401. package/dist/ground/slug.d.ts +0 -60
  402. package/dist/ground/slug.js +0 -103
  403. package/dist/ground/slug.js.map +0 -1
  404. package/dist/ground/sot-bindings.d.ts +0 -14
  405. package/dist/ground/sot-bindings.js +0 -79
  406. package/dist/ground/sot-bindings.js.map +0 -1
  407. package/dist/ground/sot-cache.d.ts +0 -18
  408. package/dist/ground/sot-cache.js +0 -62
  409. package/dist/ground/sot-cache.js.map +0 -1
  410. package/dist/ground/topic-index.d.ts +0 -27
  411. package/dist/ground/topic-index.js +0 -82
  412. package/dist/ground/topic-index.js.map +0 -1
  413. package/dist/ground/walk.d.ts +0 -7
  414. package/dist/ground/walk.js +0 -53
  415. package/dist/ground/walk.js.map +0 -1
  416. package/dist/hooks/post-tool-use/ledger-cache.d.ts +0 -53
  417. package/dist/hooks/post-tool-use/ledger-cache.js +0 -338
  418. package/dist/hooks/post-tool-use/ledger-cache.js.map +0 -1
  419. package/dist/init/phases/10-strip.d.ts +0 -11
  420. package/dist/init/phases/10-strip.js.map +0 -1
  421. package/dist/init/phases/3b-seed.js.map +0 -1
  422. package/dist/init/phases/5-brand.js.map +0 -1
  423. package/dist/init/phases/5b-topic-index.js.map +0 -1
  424. package/dist/init/phases/6-docs-ingest.d.ts +0 -15
  425. package/dist/init/phases/6-docs-ingest.js.map +0 -1
  426. package/dist/init/phases/7b-source-comments.d.ts +0 -15
  427. package/dist/init/phases/7b-source-comments.js.map +0 -1
  428. package/dist/init/phases/7c-rules-merge.js.map +0 -1
  429. package/dist/init/phases/8-baseline.d.ts +0 -10
  430. package/dist/init/phases/8-baseline.js.map +0 -1
  431. package/dist/init/phases/parallel-678.js.map +0 -1
  432. package/dist/mcp/tools/decisions-in-scope.d.ts +0 -7
  433. package/dist/mcp/tools/decisions-in-scope.js +0 -66
  434. package/dist/mcp/tools/decisions-in-scope.js.map +0 -1
  435. package/dist/mcp/tools/invariants-in-scope.d.ts +0 -7
  436. package/dist/mcp/tools/invariants-in-scope.js +0 -81
  437. package/dist/mcp/tools/invariants-in-scope.js.map +0 -1
  438. package/dist/mcp/tools/propose-decision.d.ts +0 -34
  439. package/dist/mcp/tools/propose-decision.js +0 -200
  440. package/dist/mcp/tools/propose-decision.js.map +0 -1
@@ -1,372 +0,0 @@
1
- import { z } from "zod";
2
- export const Audience = z.enum(["ai-only", "dual", "human-only"]);
3
- export const ProvenanceFrontmatter = z
4
- .object({
5
- type: z.string().optional(),
6
- status: z.string().optional(),
7
- audience: Audience.optional(),
8
- generated: z.string().optional(),
9
- "verified-at": z.string().optional(),
10
- "source-commits": z.array(z.string()).optional(),
11
- supersedes: z.string().nullish(),
12
- })
13
- .passthrough();
14
- export const ManifestEntry = z.object({
15
- path: z.string(),
16
- sha256: z.string().length(64),
17
- classification: z.string(),
18
- audience: z.string().optional(),
19
- verified_at: z.string().optional(),
20
- generator: z.string().optional(),
21
- source: z.string().optional(),
22
- related_invariants: z.array(z.string()).optional(),
23
- });
24
- export const Manifest = z.object({
25
- version: z.literal(1),
26
- generated: z.string(),
27
- generator: z.string().optional(),
28
- files: z.array(ManifestEntry),
29
- });
30
- export const DecisionAssertion = z.discriminatedUnion("kind", [
31
- z.object({
32
- id: z.string(),
33
- kind: z.literal("schema_must_contain"),
34
- table: z.string(),
35
- column: z.string(),
36
- column_type: z.string().optional(),
37
- nullable: z.boolean().optional(),
38
- }),
39
- z.object({
40
- id: z.string(),
41
- kind: z.literal("text_must_match"),
42
- pattern: z.string(),
43
- in_globs: z.array(z.string()),
44
- }),
45
- z.object({
46
- id: z.string(),
47
- kind: z.literal("text_must_not_match"),
48
- pattern: z.string(),
49
- in_globs: z.array(z.string()),
50
- }),
51
- z.object({
52
- id: z.string(),
53
- kind: z.literal("index_must_exist"),
54
- table: z.string(),
55
- columns: z.array(z.string()),
56
- where: z.string().optional(),
57
- }),
58
- z.object({
59
- id: z.string(),
60
- kind: z.literal("ast_pattern"),
61
- language: z.string(),
62
- pattern: z.string(),
63
- in_globs: z.array(z.string()),
64
- }),
65
- z.object({
66
- id: z.string(),
67
- kind: z.literal("file_must_not_be_modified"),
68
- path: z.string(),
69
- }),
70
- z.object({
71
- id: z.string(),
72
- kind: z.literal("query_must_filter_by"),
73
- orm: z.string(),
74
- in_globs: z.array(z.string()),
75
- table: z.string(),
76
- columns: z.array(z.string()),
77
- operator: z.enum(["eq", "in", "between", "is_not_null"]),
78
- require_combination: z.enum(["and", "or"]),
79
- }),
80
- z.object({
81
- id: z.string(),
82
- kind: z.literal("route_must_have_guard"),
83
- in_globs: z.array(z.string()),
84
- guard: z.string(),
85
- require_on: z.array(z.string()),
86
- }),
87
- z.object({
88
- id: z.string(),
89
- kind: z.literal("event_must_emit"),
90
- in_globs: z.array(z.string()),
91
- after_method: z.string(),
92
- event_key: z.string(),
93
- payload_must_include: z.array(z.string()).optional(),
94
- }),
95
- z.object({
96
- id: z.string(),
97
- kind: z.literal("service_method_must_call"),
98
- in_globs: z.array(z.string()),
99
- in_method: z.string(),
100
- must_call: z.string(),
101
- before_returning: z.boolean().optional(),
102
- }),
103
- z.object({
104
- id: z.string(),
105
- kind: z.literal("human_review_hint"),
106
- description: z.string(),
107
- }),
108
- ]);
109
- /**
110
- * sot_kind = where the canonical prose lives for this DEC.
111
- * "ledger" — body in this DEC file is canonical (source-comment essay,
112
- * operator-recorded). Lens renders body verbatim.
113
- * "path" — sot_path points at the canonical location (doc paragraph,
114
- * CLAUDE.md section). Lens renders live content from there.
115
- */
116
- export const SotKind = z.enum(["ledger", "path"]);
117
- export const DecisionFrontmatter = z
118
- .object({
119
- id: z.string().regex(/^DEC-[0-9a-f]{7,}$/, "decision id must match DEC-<hash7>"),
120
- title: z.string(),
121
- type: z.literal("adr").optional(),
122
- status: z
123
- .string()
124
- .refine((s) => s === "accepted" ||
125
- s === "superseded" ||
126
- s === "archived" ||
127
- /^draft(?:-from-[a-z-]+)?$/.test(s), "decision status must be draft | draft-from-<source> | accepted | superseded | archived"),
128
- audience: Audience.optional(),
129
- generated: z.string().optional(),
130
- "verified-at": z.string().optional(),
131
- "source-commits": z.array(z.string()).optional(),
132
- decided_at: z.string().optional(),
133
- decided_by: z.string().optional(),
134
- scope_globs: z.array(z.string()).optional(),
135
- supersedes: z.string().nullish(),
136
- superseded_by: z.string().nullish(),
137
- assertions: z.array(DecisionAssertion).optional(),
138
- human_review_hint: z.string().optional(),
139
- related_invariants: z.array(z.string()).optional(),
140
- sot_kind: SotKind,
141
- sot_path: z.string().min(1),
142
- sot_content_hash: z.string().length(64),
143
- related: z.string().nullish(),
144
- derived_from: z.string().nullish(),
145
- })
146
- .passthrough();
147
- export const InvariantFrontmatter = z
148
- .object({
149
- id: z.string().regex(/^INV-[0-9a-f]{7,}$/, "invariant id must match INV-<hash7>"),
150
- title: z.string(),
151
- type: z.literal("invariant").optional(),
152
- status: z.enum(["active", "superseded", "archived"]).optional(),
153
- audience: Audience.optional(),
154
- generated: z.string().optional(),
155
- "verified-at": z.string().optional(),
156
- source_run: z.string().optional(),
157
- source_decision: z.string().nullish(),
158
- introduced_for_bug: z.string().optional(),
159
- sensor: z.string().optional(),
160
- e2e: z.string().optional(),
161
- naming_convention: z.string().optional(),
162
- superseded_by: z.string().nullish(),
163
- sot_kind: SotKind,
164
- sot_path: z.string().min(1),
165
- sot_content_hash: z.string().length(64),
166
- related: z.string().nullish(),
167
- derived_from: z.string().nullish(),
168
- })
169
- .passthrough();
170
- export const DecisionLedgerEntry = z.object({
171
- id: z.string(),
172
- title: z.string(),
173
- status: z.string(),
174
- scope_globs: z.array(z.string()).optional(),
175
- supersedes: z.string().nullish(),
176
- superseded_by: z.string().nullish(),
177
- });
178
- export const InvariantLedgerEntry = z.object({
179
- id: z.string(),
180
- title: z.string(),
181
- status: z.string(),
182
- source_decision: z.string().nullish(),
183
- superseded_by: z.string().nullish(),
184
- });
185
- export const QualityGrade = z.object({
186
- module: z.string(),
187
- score: z.number().min(0).max(100),
188
- pass_rate: z.number().min(0).max(1),
189
- drift_count: z.number().int().nonnegative(),
190
- last_updated: z.string(),
191
- recent_run_count: z.number().int().nonnegative(),
192
- });
193
- export const QualityGrades = z.object({
194
- version: z.literal(1),
195
- generated: z.string(),
196
- modules: z.array(QualityGrade),
197
- });
198
- /**
199
- * Topic-index entry — one row per content-fingerprint slug across all
200
- * scanned sources. `sot_source` is the canonical source path picked by
201
- * priority order (docs/* > CLAUDE.md > AGENTS.md > source comments).
202
- * `candidates` lists every place the same prose appears (one becomes the
203
- * SoT, the rest become §DEC-<id> cites).
204
- *
205
- * `marker_kind` is stamped at walk-time when the SoT block sits under a
206
- * `cairn:` frontmatter key (file-level) or has a `<!-- cairn:decision -->`
207
- * / `<!-- cairn:rule -->` HTML comment within 3 lines of its heading
208
- * (block-level). Phase 6 Stage 3 reads this field directly off the
209
- * topic-index and bypasses Stages 1+2 (file-purpose + section batch
210
- * classifiers) for marked entries — the operator has already declared
211
- * the block authoritative, so Haiku adds no signal.
212
- *
213
- * `content_hash` mirrors the SoT block's body hash at walk-time. Used by
214
- * `cairn_propose_decision` (PR 2) and the alignment hooks to detect
215
- * source drift before promoting a candidate to a draft.
216
- */
217
- export const TopicIndexEntry = z.object({
218
- slug: z.string(),
219
- dec_id: z.string().optional(),
220
- sot_source: z.string(),
221
- candidates: z.array(z.object({
222
- file: z.string(),
223
- kind: z.enum(["doc", "claudemd", "agentsmd", "rule", "source-comment"]),
224
- anchor: z.string().optional(),
225
- line_range: z.tuple([z.number().int(), z.number().int()]).optional(),
226
- })),
227
- created_at: z.string(),
228
- marker_kind: z.enum(["decision", "rule"]).optional(),
229
- content_hash: z.string().length(64).optional(),
230
- });
231
- export const TopicIndex = z.object({
232
- version: z.literal(1),
233
- generated: z.string(),
234
- topics: z.record(z.string(), TopicIndexEntry),
235
- });
236
- /**
237
- * SoT bindings — bidirectional map between DEC ids and their canonical
238
- * source paths. Forward index is one-to-one. Reverse index is one-to-many
239
- * because supersedes chains keep the same sot_path across multiple DEC
240
- * ids.
241
- */
242
- export const SotBindings = z.object({
243
- version: z.literal(1),
244
- generated: z.string(),
245
- forward: z.record(z.string(), z.string()),
246
- reverse: z.record(z.string(), z.array(z.string())),
247
- });
248
- /**
249
- * Sot-cache — tokenized DEC body shingles for Jaccard pre-filter in the
250
- * Layer A alignment hook. Mtime-keyed so the cache rebuilds incrementally
251
- * on PostToolUse Write events.
252
- */
253
- export const SotCacheEntry = z.object({
254
- dec_id: z.string(),
255
- sot_path: z.string(),
256
- body_hash: z.string().length(64),
257
- tokens: z.array(z.string()),
258
- shingles: z.array(z.string()),
259
- mtime_ms: z.number(),
260
- });
261
- export const SotCache = z.object({
262
- version: z.literal(1),
263
- generated: z.string(),
264
- entries: z.record(z.string(), SotCacheEntry),
265
- });
266
- /**
267
- * Anchor-map — external map from topic slug to its current location in
268
- * source. Allows operator's docs to stay pristine (no `<!-- cairn-anchor -->`
269
- * injected) while drift detection reconciles via content_hash.
270
- */
271
- export const AnchorMapEntry = z.object({
272
- file: z.string(),
273
- current_anchor: z.string().optional(),
274
- content_hash: z.string().length(64),
275
- line_range: z.tuple([z.number().int(), z.number().int()]).optional(),
276
- kind: z.enum(["doc", "claudemd", "agentsmd", "rule", "source-comment"]),
277
- });
278
- export const AnchorMap = z.object({
279
- version: z.literal(1),
280
- generated: z.string(),
281
- anchors: z.record(z.string(), AnchorMapEntry),
282
- });
283
- export const DriftEvent = z.object({
284
- ts: z.string(),
285
- kind: z.enum([
286
- "frontmatter_stale",
287
- "generator_drift",
288
- "broken_link",
289
- "orphan_path",
290
- "manifest_hash_changed",
291
- "doc-drift",
292
- "paragraph-deleted",
293
- "pre-commit-drift",
294
- ]),
295
- path: z.string(),
296
- detail: z.string().optional(),
297
- severity: z.enum(["soft", "hard"]).default("soft"),
298
- dec_id: z.string().optional(),
299
- });
300
- /**
301
- * Layer B pre-commit-drift log entry written by the git pre-commit
302
- * hook (`cairn hook pre-commit-align`). Layer C SessionStart drain
303
- * consumes this file, re-checks each entry against the (possibly
304
- * changed) source location, and runs the Haiku judge for ambiguous
305
- * candidates.
306
- *
307
- * Path: `.cairn/staleness/pre-commit-deferred.jsonl`.
308
- *
309
- * `tier: tier1` — deterministic match passed (Jaccard ≥ 0.85, shingle
310
- * ≥ 0.6, length ratio 0.5–2.0). Layer C can auto-cite without Haiku
311
- * if the block survives.
312
- *
313
- * `tier: tier2-3` — Jaccard pre-filter survivors only; Tier 1 didn't
314
- * fire. Layer C invokes Haiku dedup judge.
315
- */
316
- export const PreCommitDriftCandidate = z.object({
317
- id: z.string(),
318
- similarity: z.number(),
319
- body_hash: z.string(),
320
- sot_path: z.string(),
321
- });
322
- export const PreCommitDriftLogEntry = z.object({
323
- ts: z.string(),
324
- file: z.string(),
325
- block_start_line: z.number(),
326
- block_end_line: z.number(),
327
- block_content_hash: z.string(),
328
- block_prose: z.string(),
329
- tier: z.enum(["tier1", "tier2-3"]),
330
- candidates: z.array(PreCommitDriftCandidate),
331
- });
332
- /**
333
- * Rejected-candidate ledger entry (`.cairn/ground/_rejected.yaml`).
334
- *
335
- * Records topic-index slugs the operator (or `ai-curator`) decided are
336
- * *not* canonical — false positives, research notes, planning prose,
337
- * etc. The drift sensor reads this file and suppresses any candidate
338
- * whose slug appears here; phase 6 / `cairn ingest` skip rejected slugs
339
- * on the next pass instead of re-proposing them.
340
- *
341
- * Dedup is by slug. First writer wins the `reason` string; subsequent
342
- * writes only refresh `rejected_at`. Phase 5b GC drops entries whose
343
- * slug is no longer present in the freshly-built topic-index.
344
- */
345
- export const RejectedEntry = z.object({
346
- slug: z.string(),
347
- rejected_at: z.string(),
348
- rejected_by: z.enum(["operator", "ai-curator", "cairn-init"]),
349
- reason: z.string(),
350
- sot_source: z.string(),
351
- line_range: z.tuple([z.number().int(), z.number().int()]).optional(),
352
- });
353
- export const RejectedYaml = z.object({
354
- version: z.literal(1),
355
- generated: z.string(),
356
- rejected: z.array(RejectedEntry),
357
- });
358
- /**
359
- * `.cairn/ground/file-candidates-map.yaml` — per-file count of
360
- * topic-index entries with `dec_id IS NULL`. Built at the end of phase
361
- * 5b (and refreshed whenever `dec_id` is stamped — phase 6, the PR 2
362
- * `cairn_propose_decision` tool, etc.). The read-enrich hook consults
363
- * this map to inject a candidate-count warning when an AI agent reads a
364
- * file with unpromoted candidates, without scanning the whole topic
365
- * index per Read.
366
- */
367
- export const FileCandidatesMap = z.object({
368
- version: z.literal(1),
369
- generated: z.string(),
370
- file_candidates: z.record(z.string(), z.number().int().nonnegative()),
371
- });
372
- //# sourceMappingURL=schemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/ground/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAGlE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAA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C,CAAC,MAAM,EAAE;IACrB,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;CACtE,CAAC,CAAC"}
@@ -1,96 +0,0 @@
1
- /**
2
- * Scope index — forward map from every file path in the repo to the decisions
3
- * and invariants that apply to that file.
4
- *
5
- * Built at init by the Tier-2 mapper LLM, maintained by the GC sweep + the
6
- * MCP record-decision tool when scope edits land. Read by the read-enricher
7
- * / write-guardian hooks (via cached accessor in
8
- * `hooks/post-tool-use/ledger-cache.ts`) and by the GC scope-coverage pass.
9
- *
10
- * Spec: docs/FILESYSTEM_LAYOUT.md §2.1.
11
- */
12
- export interface ScopeIndexEntry {
13
- decisions: string[];
14
- invariants: string[];
15
- unscoped?: true;
16
- }
17
- /**
18
- * Mapper LLMs occasionally emit ledger-entry PROSE ("HTTP layer is the only
19
- * public surface…") into `decisions[]` / `invariants[]` instead of bare IDs,
20
- * because the user prompt lists them as `${id} — ${title}` and the JSON-mode
21
- * schema only constrains the type to `string`. This coercer extracts the
22
- * first ID-shaped token from each string and silently drops anything that
23
- * doesn't match — IDs only, deduplicated, order preserved.
24
- */
25
- export declare function coerceDecisionIds(raw: readonly unknown[]): string[];
26
- export declare function coerceInvariantIds(raw: readonly unknown[]): string[];
27
- export interface ScopeIndex {
28
- generated: string;
29
- files: Record<string, ScopeIndexEntry>;
30
- }
31
- export declare function scopeIndexPath(repoRoot: string): string;
32
- export declare function readScopeIndex(repoRoot: string): ScopeIndex | null;
33
- export declare function lookupScope(index: ScopeIndex, repoRelativePath: string): ScopeIndexEntry | null;
34
- export declare function writeScopeIndex(repoRoot: string, index: ScopeIndex): void;
35
- export interface RescanScopeIndexResult {
36
- filesScanned: number;
37
- entriesAdded: number;
38
- entriesUpdated: number;
39
- entriesUnchanged: number;
40
- /** True when scope-index.yaml was rewritten. */
41
- dirty: boolean;
42
- }
43
- /**
44
- * Deterministic regex sweep — walk every git-tracked source file, parse
45
- * `§INV-NNNN` / `§DEC-NNNN` cite tokens, and sync the scope-index so the
46
- * in-scope tools never lag behind source-cite reality. No LLM, no
47
- * incremental tracking complexity. Cheap enough to run on every
48
- * SessionStart (~100ms on 50k files).
49
- *
50
- * Honors `unscoped: true` entries — never touches them. Skips files with
51
- * no citations and no prior entry to avoid polluting the index. When a
52
- * file's cite set differs from its scope-index entry (added, removed, or
53
- * stale ids), the entry is rewritten with the deterministically-sorted
54
- * current set.
55
- */
56
- export declare function rescanScopeIndex(repoRoot: string): RescanScopeIndexResult;
57
- /**
58
- * Single-file scope-index sync from in-memory content. Called by the
59
- * PostToolUse(Write/Edit) hook so an agent's writes don't leave the
60
- * scope-index stale until the next SessionStart rescan. Same regex
61
- * parser as `rescanScopeIndex`, but bounded to one file — O(1) cost,
62
- * no walker.
63
- *
64
- * Honors `unscoped: true` entries (skips them). Honors the same skip
65
- * rule the rescan does: file with no citations and no prior entry is
66
- * a no-op so we don't pollute the index with empty rows.
67
- */
68
- export declare function syncFileScopeFromContent(repoRoot: string, repoRelPath: string, content: string): {
69
- dirty: boolean;
70
- };
71
- export interface RebuildScopeIndexOptions {
72
- repoRoot: string;
73
- /** Hard timeout for the mapper LLM call (ms). Default 300000. */
74
- timeoutMs?: number;
75
- }
76
- export interface RebuildScopeIndexResult {
77
- /** Absolute path to the file written. */
78
- path: string;
79
- /** Total scope-index entries after the rescan (added + updated + unchanged). */
80
- filesClassified: number;
81
- /** Wall-clock ms for the rescan. */
82
- durationMs: number;
83
- }
84
- /**
85
- * `cairn scope rebuild` — full deterministic resync of `.cairn/ground/
86
- * scope-index.yaml` from current source-cite reality. Used to be a
87
- * Sonnet call (`runMapper`-style) that re-classified files via the
88
- * Tier-2 mapper, but classification was always the wrong abstraction
89
- * — bare-symbol citations in source are the canonical source of truth,
90
- * `rescanScopeIndex` parses them deterministically, and the result
91
- * matches what the read-enricher legend actually shows.
92
- *
93
- * No LLM. No tokens. No mapper. Just a regex sweep over git-tracked
94
- * source files and an atomic write.
95
- */
96
- export declare function rebuildScopeIndex(opts: RebuildScopeIndexOptions): Promise<RebuildScopeIndexResult>;