@vibe-agent-toolkit/cli 0.2.0-rc.7 → 0.2.0-rc.9

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 (395) hide show
  1. package/README.md +0 -1
  2. package/dist/bin/vat +34 -19
  3. package/dist/bin/vat.js +34 -19
  4. package/dist/bin/vat.js.map +1 -1
  5. package/dist/bin.js +5 -2
  6. package/dist/bin.js.map +1 -1
  7. package/dist/commands/agent/build.d.ts.map +1 -1
  8. package/dist/commands/agent/build.js +2 -1
  9. package/dist/commands/agent/build.js.map +1 -1
  10. package/dist/commands/agent/import.d.ts.map +1 -1
  11. package/dist/commands/agent/import.js +3 -2
  12. package/dist/commands/agent/import.js.map +1 -1
  13. package/dist/commands/agent/install-path.d.ts +36 -0
  14. package/dist/commands/agent/install-path.d.ts.map +1 -0
  15. package/dist/commands/agent/install-path.js +44 -0
  16. package/dist/commands/agent/install-path.js.map +1 -0
  17. package/dist/commands/agent/install.d.ts.map +1 -1
  18. package/dist/commands/agent/install.js +22 -10
  19. package/dist/commands/agent/install.js.map +1 -1
  20. package/dist/commands/agent/installed.d.ts.map +1 -1
  21. package/dist/commands/agent/installed.js +22 -12
  22. package/dist/commands/agent/installed.js.map +1 -1
  23. package/dist/commands/agent/list.d.ts.map +1 -1
  24. package/dist/commands/agent/list.js +2 -1
  25. package/dist/commands/agent/list.js.map +1 -1
  26. package/dist/commands/agent/run.d.ts.map +1 -1
  27. package/dist/commands/agent/run.js +2 -1
  28. package/dist/commands/agent/run.js.map +1 -1
  29. package/dist/commands/agent/uninstall.d.ts.map +1 -1
  30. package/dist/commands/agent/uninstall.js +13 -6
  31. package/dist/commands/agent/uninstall.js.map +1 -1
  32. package/dist/commands/agent/validate.d.ts.map +1 -1
  33. package/dist/commands/agent/validate.js +3 -2
  34. package/dist/commands/agent/validate.js.map +1 -1
  35. package/dist/commands/ard/emit.d.ts +72 -23
  36. package/dist/commands/ard/emit.d.ts.map +1 -1
  37. package/dist/commands/ard/emit.js +109 -56
  38. package/dist/commands/ard/emit.js.map +1 -1
  39. package/dist/commands/ard/index.d.ts +1 -1
  40. package/dist/commands/ard/index.d.ts.map +1 -1
  41. package/dist/commands/ard/index.js +4 -3
  42. package/dist/commands/ard/index.js.map +1 -1
  43. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  44. package/dist/commands/audit/distributed-tree.js +9 -6
  45. package/dist/commands/audit/distributed-tree.js.map +1 -1
  46. package/dist/commands/audit/provenance.d.ts.map +1 -1
  47. package/dist/commands/audit/provenance.js +4 -3
  48. package/dist/commands/audit/provenance.js.map +1 -1
  49. package/dist/commands/audit/scan-population.d.ts +158 -0
  50. package/dist/commands/audit/scan-population.d.ts.map +1 -0
  51. package/dist/commands/audit/scan-population.js +292 -0
  52. package/dist/commands/audit/scan-population.js.map +1 -0
  53. package/dist/commands/audit-settings.d.ts.map +1 -1
  54. package/dist/commands/audit-settings.js +6 -5
  55. package/dist/commands/audit-settings.js.map +1 -1
  56. package/dist/commands/audit.d.ts +16 -14
  57. package/dist/commands/audit.d.ts.map +1 -1
  58. package/dist/commands/audit.js +304 -389
  59. package/dist/commands/audit.js.map +1 -1
  60. package/dist/commands/build.d.ts.map +1 -1
  61. package/dist/commands/build.js +25 -24
  62. package/dist/commands/build.js.map +1 -1
  63. package/dist/commands/cache/clear.d.ts +17 -3
  64. package/dist/commands/cache/clear.d.ts.map +1 -1
  65. package/dist/commands/cache/clear.js +34 -13
  66. package/dist/commands/cache/clear.js.map +1 -1
  67. package/dist/commands/cache/index.d.ts.map +1 -1
  68. package/dist/commands/cache/index.js +19 -10
  69. package/dist/commands/cache/index.js.map +1 -1
  70. package/dist/commands/claude/context.d.ts +2 -2
  71. package/dist/commands/claude/context.d.ts.map +1 -1
  72. package/dist/commands/claude/context.js +7 -6
  73. package/dist/commands/claude/context.js.map +1 -1
  74. package/dist/commands/claude/index.d.ts +12 -11
  75. package/dist/commands/claude/index.d.ts.map +1 -1
  76. package/dist/commands/claude/index.js +14 -16
  77. package/dist/commands/claude/index.js.map +1 -1
  78. package/dist/commands/claude/marketplace/changelog-utils.d.ts +1 -1
  79. package/dist/commands/claude/marketplace/changelog-utils.d.ts.map +1 -1
  80. package/dist/commands/claude/marketplace/changelog-utils.js +1 -2
  81. package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
  82. package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
  83. package/dist/commands/claude/marketplace/git-publish.js +22 -12
  84. package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
  85. package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
  86. package/dist/commands/claude/marketplace/license-utils.js +0 -1
  87. package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
  88. package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
  89. package/dist/commands/claude/marketplace/publish-tree.js +0 -6
  90. package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
  91. package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
  92. package/dist/commands/claude/marketplace/publish.js +2 -1
  93. package/dist/commands/claude/marketplace/publish.js.map +1 -1
  94. package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
  95. package/dist/commands/claude/marketplace/validate.js +26 -16
  96. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  97. package/dist/commands/claude/org/api-keys.d.ts +0 -3
  98. package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
  99. package/dist/commands/claude/org/api-keys.js +2 -1
  100. package/dist/commands/claude/org/api-keys.js.map +1 -1
  101. package/dist/commands/claude/org/helpers.d.ts +17 -22
  102. package/dist/commands/claude/org/helpers.d.ts.map +1 -1
  103. package/dist/commands/claude/org/helpers.js +6 -22
  104. package/dist/commands/claude/org/helpers.js.map +1 -1
  105. package/dist/commands/claude/org/invites.d.ts +0 -3
  106. package/dist/commands/claude/org/invites.d.ts.map +1 -1
  107. package/dist/commands/claude/org/invites.js +3 -2
  108. package/dist/commands/claude/org/invites.js.map +1 -1
  109. package/dist/commands/claude/org/skills.d.ts +19 -1
  110. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  111. package/dist/commands/claude/org/skills.js +147 -111
  112. package/dist/commands/claude/org/skills.js.map +1 -1
  113. package/dist/commands/claude/org/users.d.ts +0 -3
  114. package/dist/commands/claude/org/users.d.ts.map +1 -1
  115. package/dist/commands/claude/org/users.js +3 -2
  116. package/dist/commands/claude/org/users.js.map +1 -1
  117. package/dist/commands/claude/org/workspaces.d.ts +0 -3
  118. package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
  119. package/dist/commands/claude/org/workspaces.js +6 -5
  120. package/dist/commands/claude/org/workspaces.js.map +1 -1
  121. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  122. package/dist/commands/claude/plugin/build.js +23 -52
  123. package/dist/commands/claude/plugin/build.js.map +1 -1
  124. package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
  125. package/dist/commands/claude/plugin/helpers.js +0 -6
  126. package/dist/commands/claude/plugin/helpers.js.map +1 -1
  127. package/dist/commands/claude/plugin/install.d.ts +12 -0
  128. package/dist/commands/claude/plugin/install.d.ts.map +1 -1
  129. package/dist/commands/claude/plugin/install.js +71 -60
  130. package/dist/commands/claude/plugin/install.js.map +1 -1
  131. package/dist/commands/claude/plugin/list.d.ts.map +1 -1
  132. package/dist/commands/claude/plugin/list.js +3 -2
  133. package/dist/commands/claude/plugin/list.js.map +1 -1
  134. package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
  135. package/dist/commands/claude/plugin/plugin-changelog.js +0 -2
  136. package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
  137. package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
  138. package/dist/commands/claude/plugin/plugin-files.js +3 -6
  139. package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
  140. package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
  141. package/dist/commands/claude/plugin/plugin-validators.js +3 -6
  142. package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
  143. package/dist/commands/claude/plugin/tree-copy.d.ts +2 -1
  144. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  145. package/dist/commands/claude/plugin/tree-copy.js +15 -14
  146. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  147. package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
  148. package/dist/commands/claude/plugin/uninstall.js +4 -4
  149. package/dist/commands/claude/plugin/uninstall.js.map +1 -1
  150. package/dist/commands/consistency-check.d.ts +17 -15
  151. package/dist/commands/consistency-check.d.ts.map +1 -1
  152. package/dist/commands/consistency-check.js +149 -104
  153. package/dist/commands/consistency-check.js.map +1 -1
  154. package/dist/commands/corpus/report.d.ts.map +1 -1
  155. package/dist/commands/corpus/report.js +1 -2
  156. package/dist/commands/corpus/report.js.map +1 -1
  157. package/dist/commands/corpus/runner.d.ts.map +1 -1
  158. package/dist/commands/corpus/runner.js +2 -6
  159. package/dist/commands/corpus/runner.js.map +1 -1
  160. package/dist/commands/corpus/scan.d.ts.map +1 -1
  161. package/dist/commands/corpus/scan.js +2 -3
  162. package/dist/commands/corpus/scan.js.map +1 -1
  163. package/dist/commands/corpus/seed.d.ts +4 -4
  164. package/dist/commands/corpus/seed.d.ts.map +1 -1
  165. package/dist/commands/corpus/seed.js +1 -3
  166. package/dist/commands/corpus/seed.js.map +1 -1
  167. package/dist/commands/doctor.d.ts.map +1 -1
  168. package/dist/commands/doctor.js +55 -37
  169. package/dist/commands/doctor.js.map +1 -1
  170. package/dist/commands/inventory.d.ts.map +1 -1
  171. package/dist/commands/inventory.js +6 -7
  172. package/dist/commands/inventory.js.map +1 -1
  173. package/dist/commands/mcp/list-collections.d.ts.map +1 -1
  174. package/dist/commands/mcp/list-collections.js +2 -1
  175. package/dist/commands/mcp/list-collections.js.map +1 -1
  176. package/dist/commands/mcp/serve.d.ts.map +1 -1
  177. package/dist/commands/mcp/serve.js +3 -2
  178. package/dist/commands/mcp/serve.js.map +1 -1
  179. package/dist/commands/okf/index.d.ts.map +1 -1
  180. package/dist/commands/okf/index.js +14 -2
  181. package/dist/commands/okf/index.js.map +1 -1
  182. package/dist/commands/okf/validate.d.ts +157 -48
  183. package/dist/commands/okf/validate.d.ts.map +1 -1
  184. package/dist/commands/okf/validate.js +109 -76
  185. package/dist/commands/okf/validate.js.map +1 -1
  186. package/dist/commands/phase-utils.d.ts +11 -10
  187. package/dist/commands/phase-utils.d.ts.map +1 -1
  188. package/dist/commands/phase-utils.js +30 -14
  189. package/dist/commands/phase-utils.js.map +1 -1
  190. package/dist/commands/positional-args.d.ts.map +1 -1
  191. package/dist/commands/positional-args.js +2 -1
  192. package/dist/commands/positional-args.js.map +1 -1
  193. package/dist/commands/rag/clear-command.d.ts.map +1 -1
  194. package/dist/commands/rag/clear-command.js +2 -1
  195. package/dist/commands/rag/clear-command.js.map +1 -1
  196. package/dist/commands/rag/index-command.d.ts.map +1 -1
  197. package/dist/commands/rag/index-command.js +4 -1
  198. package/dist/commands/rag/index-command.js.map +1 -1
  199. package/dist/commands/rag/query-command.d.ts.map +1 -1
  200. package/dist/commands/rag/query-command.js +2 -1
  201. package/dist/commands/rag/query-command.js.map +1 -1
  202. package/dist/commands/rag/stats-command.d.ts.map +1 -1
  203. package/dist/commands/rag/stats-command.js +2 -1
  204. package/dist/commands/rag/stats-command.js.map +1 -1
  205. package/dist/commands/resources/check-progress.d.ts +6 -0
  206. package/dist/commands/resources/check-progress.d.ts.map +1 -1
  207. package/dist/commands/resources/check-progress.js +15 -4
  208. package/dist/commands/resources/check-progress.js.map +1 -1
  209. package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
  210. package/dist/commands/resources/check-supervisor.js +14 -7
  211. package/dist/commands/resources/check-supervisor.js.map +1 -1
  212. package/dist/commands/resources/check.d.ts +315 -205
  213. package/dist/commands/resources/check.d.ts.map +1 -1
  214. package/dist/commands/resources/check.js +368 -327
  215. package/dist/commands/resources/check.js.map +1 -1
  216. package/dist/commands/resources/index.d.ts.map +1 -1
  217. package/dist/commands/resources/index.js +159 -39
  218. package/dist/commands/resources/index.js.map +1 -1
  219. package/dist/commands/resources/query.d.ts +2 -2
  220. package/dist/commands/resources/query.d.ts.map +1 -1
  221. package/dist/commands/resources/query.js +24 -18
  222. package/dist/commands/resources/query.js.map +1 -1
  223. package/dist/commands/resources/scan.d.ts.map +1 -1
  224. package/dist/commands/resources/scan.js +4 -8
  225. package/dist/commands/resources/scan.js.map +1 -1
  226. package/dist/commands/resources/validate.d.ts +1 -1
  227. package/dist/commands/resources/validate.d.ts.map +1 -1
  228. package/dist/commands/resources/validate.js +0 -1
  229. package/dist/commands/resources/validate.js.map +1 -1
  230. package/dist/commands/skill/review-checklist.d.ts +3 -2
  231. package/dist/commands/skill/review-checklist.d.ts.map +1 -1
  232. package/dist/commands/skill/review-checklist.js +4 -2
  233. package/dist/commands/skill/review-checklist.js.map +1 -1
  234. package/dist/commands/skill/review.d.ts +247 -0
  235. package/dist/commands/skill/review.d.ts.map +1 -1
  236. package/dist/commands/skill/review.js +90 -60
  237. package/dist/commands/skill/review.js.map +1 -1
  238. package/dist/commands/skill/test/configure.d.ts.map +1 -1
  239. package/dist/commands/skill/test/configure.js +0 -1
  240. package/dist/commands/skill/test/configure.js.map +1 -1
  241. package/dist/commands/skill/test/run.d.ts +12 -6
  242. package/dist/commands/skill/test/run.d.ts.map +1 -1
  243. package/dist/commands/skill/test/run.js +120 -65
  244. package/dist/commands/skill/test/run.js.map +1 -1
  245. package/dist/commands/skills/build.d.ts +83 -3
  246. package/dist/commands/skills/build.d.ts.map +1 -1
  247. package/dist/commands/skills/build.js +162 -40
  248. package/dist/commands/skills/build.js.map +1 -1
  249. package/dist/commands/skills/install.d.ts +2 -1
  250. package/dist/commands/skills/install.d.ts.map +1 -1
  251. package/dist/commands/skills/install.js +20 -30
  252. package/dist/commands/skills/install.js.map +1 -1
  253. package/dist/commands/skills/list.d.ts.map +1 -1
  254. package/dist/commands/skills/list.js +14 -18
  255. package/dist/commands/skills/list.js.map +1 -1
  256. package/dist/commands/skills/package.d.ts +1 -1
  257. package/dist/commands/skills/package.d.ts.map +1 -1
  258. package/dist/commands/skills/package.js +6 -8
  259. package/dist/commands/skills/package.js.map +1 -1
  260. package/dist/commands/skills/scope-guard.d.ts.map +1 -1
  261. package/dist/commands/skills/scope-guard.js +2 -4
  262. package/dist/commands/skills/scope-guard.js.map +1 -1
  263. package/dist/commands/skills/shared.d.ts.map +1 -1
  264. package/dist/commands/skills/shared.js +2 -4
  265. package/dist/commands/skills/shared.js.map +1 -1
  266. package/dist/commands/skills/skill-discovery.d.ts +15 -13
  267. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  268. package/dist/commands/skills/skill-discovery.js +23 -5
  269. package/dist/commands/skills/skill-discovery.js.map +1 -1
  270. package/dist/commands/skills/source-resolvers.d.ts +15 -0
  271. package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
  272. package/dist/commands/skills/source-resolvers.js +25 -4
  273. package/dist/commands/skills/source-resolvers.js.map +1 -1
  274. package/dist/commands/validate.d.ts +1 -1
  275. package/dist/commands/validate.d.ts.map +1 -1
  276. package/dist/commands/validate.js +39 -14
  277. package/dist/commands/validate.js.map +1 -1
  278. package/dist/commands/verify.d.ts +17 -5
  279. package/dist/commands/verify.d.ts.map +1 -1
  280. package/dist/commands/verify.js +161 -104
  281. package/dist/commands/verify.js.map +1 -1
  282. package/dist/index.d.ts +0 -1
  283. package/dist/index.d.ts.map +1 -1
  284. package/dist/index.js +5 -1
  285. package/dist/index.js.map +1 -1
  286. package/dist/report-schemas.d.ts +45 -0
  287. package/dist/report-schemas.d.ts.map +1 -0
  288. package/dist/report-schemas.js +100 -0
  289. package/dist/report-schemas.js.map +1 -0
  290. package/dist/skill-resolution/classify.js +2 -2
  291. package/dist/skill-resolution/classify.js.map +1 -1
  292. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  293. package/dist/skill-resolution/resolve-skill-reference.js +50 -55
  294. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  295. package/dist/utils/agent-discovery.d.ts.map +1 -1
  296. package/dist/utils/agent-discovery.js +22 -11
  297. package/dist/utils/agent-discovery.js.map +1 -1
  298. package/dist/utils/agent-runner.d.ts.map +1 -1
  299. package/dist/utils/agent-runner.js +0 -1
  300. package/dist/utils/agent-runner.js.map +1 -1
  301. package/dist/utils/claude-context-lens.d.ts +34 -0
  302. package/dist/utils/claude-context-lens.d.ts.map +1 -0
  303. package/dist/utils/claude-context-lens.js +39 -0
  304. package/dist/utils/claude-context-lens.js.map +1 -0
  305. package/dist/utils/command-error.d.ts +63 -62
  306. package/dist/utils/command-error.d.ts.map +1 -1
  307. package/dist/utils/command-error.js +80 -76
  308. package/dist/utils/command-error.js.map +1 -1
  309. package/dist/utils/config-loader.d.ts +2 -1
  310. package/dist/utils/config-loader.d.ts.map +1 -1
  311. package/dist/utils/config-loader.js +3 -6
  312. package/dist/utils/config-loader.js.map +1 -1
  313. package/dist/utils/corpus-target.d.ts +5 -27
  314. package/dist/utils/corpus-target.d.ts.map +1 -1
  315. package/dist/utils/corpus-target.js +7 -33
  316. package/dist/utils/corpus-target.js.map +1 -1
  317. package/dist/utils/help-loader.d.ts.map +1 -1
  318. package/dist/utils/help-loader.js +0 -1
  319. package/dist/utils/help-loader.js.map +1 -1
  320. package/dist/utils/issue-rendering.d.ts +2 -2
  321. package/dist/utils/issue-rendering.js +2 -2
  322. package/dist/utils/optional-backend.d.ts.map +1 -1
  323. package/dist/utils/optional-backend.js +2 -1
  324. package/dist/utils/optional-backend.js.map +1 -1
  325. package/dist/utils/output.d.ts +9 -0
  326. package/dist/utils/output.d.ts.map +1 -1
  327. package/dist/utils/output.js +16 -0
  328. package/dist/utils/output.js.map +1 -1
  329. package/dist/utils/package-json.d.ts +24 -0
  330. package/dist/utils/package-json.d.ts.map +1 -0
  331. package/dist/utils/package-json.js +49 -0
  332. package/dist/utils/package-json.js.map +1 -0
  333. package/dist/utils/project-root-policy.d.ts.map +1 -1
  334. package/dist/utils/project-root-policy.js +0 -2
  335. package/dist/utils/project-root-policy.js.map +1 -1
  336. package/dist/utils/projection-lenses.d.ts +98 -0
  337. package/dist/utils/projection-lenses.d.ts.map +1 -0
  338. package/dist/utils/projection-lenses.js +203 -0
  339. package/dist/utils/projection-lenses.js.map +1 -0
  340. package/dist/utils/projection-query.d.ts +38 -14
  341. package/dist/utils/projection-query.d.ts.map +1 -1
  342. package/dist/utils/projection-query.js +78 -17
  343. package/dist/utils/projection-query.js.map +1 -1
  344. package/dist/utils/projection-store.d.ts +61 -42
  345. package/dist/utils/projection-store.d.ts.map +1 -1
  346. package/dist/utils/projection-store.js +155 -59
  347. package/dist/utils/projection-store.js.map +1 -1
  348. package/dist/utils/relation-limits.d.ts +50 -0
  349. package/dist/utils/relation-limits.d.ts.map +1 -0
  350. package/dist/utils/relation-limits.js +50 -0
  351. package/dist/utils/relation-limits.js.map +1 -0
  352. package/dist/utils/resource-loader.js +2 -2
  353. package/dist/utils/resource-loader.js.map +1 -1
  354. package/dist/utils/skill-discovery.d.ts.map +1 -1
  355. package/dist/utils/skill-discovery.js +2 -1
  356. package/dist/utils/skill-discovery.js.map +1 -1
  357. package/dist/utils/skill-packaging-config.d.ts +63 -1
  358. package/dist/utils/skill-packaging-config.d.ts.map +1 -1
  359. package/dist/utils/skill-packaging-config.js +56 -1
  360. package/dist/utils/skill-packaging-config.js.map +1 -1
  361. package/dist/utils/url-redact.d.ts.map +1 -1
  362. package/dist/utils/url-redact.js +4 -6
  363. package/dist/utils/url-redact.js.map +1 -1
  364. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  365. package/dist/utils/user-context-scanner.js +0 -2
  366. package/dist/utils/user-context-scanner.js.map +1 -1
  367. package/dist/utils/validate-help-files.d.ts.map +1 -1
  368. package/dist/utils/validate-help-files.js +3 -4
  369. package/dist/utils/validate-help-files.js.map +1 -1
  370. package/dist/utils/vat-bin-path.d.ts.map +1 -1
  371. package/dist/utils/vat-bin-path.js +0 -1
  372. package/dist/utils/vat-bin-path.js.map +1 -1
  373. package/dist/version.d.ts.map +1 -1
  374. package/dist/version.js +1 -3
  375. package/dist/version.js.map +1 -1
  376. package/docs/audit.md +44 -53
  377. package/docs/doctor.md +1 -0
  378. package/docs/index.md +18 -10
  379. package/docs/rag.md +0 -1
  380. package/docs/resources.md +0 -1
  381. package/docs/skill-test.md +10 -9
  382. package/docs/skills.md +6 -7
  383. package/package.json +23 -28
  384. package/schemas/ard-emit.json +149 -0
  385. package/schemas/okf-validate.json +170 -0
  386. package/schemas/resources-check.json +229 -0
  387. package/schemas/skill-review.json +230 -0
  388. package/dist/commands/claude/budget.d.ts +0 -170
  389. package/dist/commands/claude/budget.d.ts.map +0 -1
  390. package/dist/commands/claude/budget.js +0 -464
  391. package/dist/commands/claude/budget.js.map +0 -1
  392. package/dist/utils/context-budget-issues.d.ts +0 -108
  393. package/dist/utils/context-budget-issues.d.ts.map +0 -1
  394. package/dist/utils/context-budget-issues.js +0 -280
  395. package/dist/utils/context-budget-issues.js.map +0 -1
@@ -1,464 +0,0 @@
1
- /**
2
- * `vat claude budget [paths...]` — is the always-loaded context at a working
3
- * location over its budget?
4
- *
5
- * ## Why this is a command and not a check inside `vat resources validate`
6
- *
7
- * It used to be one: default-on, with a `--no-context-budget` opt-out. That is
8
- * gone, in both directions — `vat resources validate` has no knowledge of the
9
- * budget at all any more, not a flag, not a default. The ruling behind the move
10
- * is short: *a validation run must not emit findings nobody asked for.* An
11
- * `info` finding attached to a lane people run for link and anchor errors is a
12
- * finding they scroll past, and a check people scroll past is a check they
13
- * eventually silence.
14
- *
15
- * ## The sibling split: `context` QUERIES, `budget` CHECKS
16
- *
17
- * `vat claude context` answers a question and
18
- * never gates — totals, admissions, the declared limits, no verdict, always
19
- * exit 0. This command is the other half of that pair: it applies a THRESHOLD,
20
- * produces findings with severities an adopter can configure, and lets an
21
- * adopter who promotes the code to `error` fail their build with it. Two verbs
22
- * because they are two acts, and folding a verdict into the query would make
23
- * the query's number a number people learn to stop reading.
24
- *
25
- * ## Everything below is orchestration — deliberately
26
- *
27
- * Which directories exist, what each pays, and whether that is over budget are
28
- * all decided in `@vibe-agent-toolkit/resources` (`buildClaudeContextPopulation`
29
- * and `sweepAlwaysLoadedBudgets`); the wording and grouping of the findings in
30
- * `utils/context-budget-issues.ts`; severity resolution in the two shared
31
- * filters every other lane runs. This module populates one tree, calls them in
32
- * order, and renders. It decides nothing about context loading of its own,
33
- * which is the CLI-stays-dumb rule applied to the lane where the temptation is
34
- * strongest.
35
- *
36
- * ⛔ The threshold is never re-spelled here. It is a MEASURED quantity that
37
- * lives beside the detector (`DEFAULT_ALWAYS_LOADED_CONTEXT_TOKENS`), and a
38
- * literal in this package would be a second source of truth that nothing
39
- * compares.
40
- *
41
- * ## The stated bounds ride ONCE on the REPORT, in every format
42
- *
43
- * The sibling query publishes 23 stated limits; this command applies a threshold
44
- * to the same measurement, so it publishes {@link ALWAYS_LOADED_BUDGET_LIMITS}
45
- * and {@link CLAUDE_CONTEXT_BOUNDS_STATEMENT} beside its verdict — the half that
46
- * GATES is the half whose bounds a reader most needs. Both are imported, never
47
- * restated: the sentence is domain content owned beside the list it frames.
48
- *
49
- * ⛔ They belong to the REPORT, never to a finding. A per-finding copy is the
50
- * defect this lane already shipped once on the query side, and it is invisible to
51
- * any assertion that checks presence rather than counting occurrences.
52
- */
53
- import { ALWAYS_LOADED_BUDGET_LIMITS, buildClaudeContextPopulation, CLAUDE_CONTEXT_BOUNDS_STATEMENT, DEFAULT_ALWAYS_LOADED_CONTEXT_TOKENS, sweepAlwaysLoadedBudgets, } from '@vibe-agent-toolkit/resources';
54
- import { applyAllowFilter, calculateValidationStatus, countBySeverity, } from '@vibe-agent-toolkit/schema';
55
- import { findProjectRoot } from '@vibe-agent-toolkit/utils';
56
- import { Command, Option } from 'commander';
57
- import { handleCommandError } from '../../utils/command-error.js';
58
- import { loadConfig } from '../../utils/config-loader.js';
59
- import { contextBudgetIssues, scopeSweepToPaths } from '../../utils/context-budget-issues.js';
60
- import { targetPathWithin } from '../../utils/corpus-target.js';
61
- import { resolveIssueSeverity } from '../../utils/issue-severity.js';
62
- import { createLogger } from '../../utils/logger.js';
63
- import { writeJsonOutput, writeStdoutSync, writeYamlOutput } from '../../utils/output.js';
64
- import { populationWiring } from '../../utils/population-wiring.js';
65
- import { withPopulationCache } from '../../utils/projection-store.js';
66
- import { runIntegrityFinding } from '../../utils/run-integrity.js';
67
- import { gitTrackerForProjectRoot } from '../audit/distributed-tree.js';
68
- /** How this command names itself in a refusal. */
69
- const COMMAND_NAME = 'vat claude budget';
70
- /** Soft wrap width for the printed limit statements. */
71
- const WRAP_COLUMNS = 96;
72
- /** How the corpus root itself is named to a reader — it has no path of its own. */
73
- const CORPUS_ROOT_LABEL = '<corpus root>';
74
- /**
75
- * Create the `vat claude budget [paths...]` command.
76
- *
77
- * @returns The configured Commander command
78
- */
79
- export function createBudgetCommand() {
80
- const command = new Command('budget');
81
- command
82
- .description('Check whether the always-loaded context at a working location exceeds its budget')
83
- .argument('[paths...]', 'Directories to check, with everything beneath them (default: the whole tree)')
84
- .addOption(new Option('--format <format>', 'Output format: text (default), yaml, or json').choices([
85
- 'text',
86
- 'yaml',
87
- 'json',
88
- ]).default('text'))
89
- .option('--debug', 'Verbose logging to stderr')
90
- .action(claudeBudgetCommand)
91
- .addHelpText('after', `
92
- Description:
93
- Reports ALWAYS_LOADED_CONTEXT_BUDGET for each instruction chain whose
94
- always-loaded context exceeds the budget. The measured chain is the
95
- repo-root CLAUDE.md, every CLAUDE.md on the path down to the working
96
- location, one level of @ imports from each, and any unscoped rules file in
97
- the root .claude/rules/. An AGENTS.md is measured only where a CLAUDE.md
98
- imports it (@AGENTS.md) — Claude Code does not load it by name, so a repo
99
- standardised on AGENTS.md alone has nothing here to measure. Path-scoped
100
- rules (a paths: list) are excluded: they load when the agent touches a
101
- matching file, not at launch.
102
-
103
- ONE finding per chain, not per directory: directories loading the same files
104
- share a finding, which names how many working locations pay it. Naming paths
105
- narrows WHICH chains are reported; the payer count stays the whole tree's,
106
- because that is the number that was measured.
107
-
108
- This is the CHECK. 'vat claude context' is the QUERY — same lane, no
109
- threshold and no verdict.
110
-
111
- Configuration (vibe-agent-toolkit.config.yaml):
112
- resources.validation.thresholds.alwaysLoadedContextTokens moves the budget
113
- (default ${String(DEFAULT_ALWAYS_LOADED_CONTEXT_TOKENS)}). resources.validation.severity.ALWAYS_LOADED_CONTEXT_BUDGET
114
- silences it (ignore) or promotes it to warning/error. A project with no
115
- config file is checked at the same default budget.
116
-
117
- Output:
118
- - threshold: the budget every chain was measured against
119
- - scope/unmatchedScope: what was asked about, and what matched nothing.
120
- A path that matched nothing was NOT checked, so it is
121
- reported as a RESOURCE_CHECK_BROKEN error rather than
122
- passing quietly -- and that code is not configurable
123
- - status/issueCounts: the worst actionable severity, plus every severity
124
- - workingLocations, distinctChains, skippedUnknownLocations: whole-tree
125
- facts, so an empty findings list is legible
126
- - findings: one per over-budget chain, ascending by directory
127
- - limits/boundsStatement: what this verdict does not settle, signed
128
- over-report or under-report. On the REPORT, never on a
129
- finding — they bound the method, not any one chain, so
130
- they are stated exactly once however many chains flag
131
-
132
- Text to stdout by default; --format yaml|json for a program. Diagnostics
133
- and blob-stage refusals go to stderr.
134
-
135
- Exit Codes:
136
- 0 - Reported (findings at the default info severity do not gate)
137
- 1 - A finding resolved to error severity via config, or a requested path
138
- matched no working location so nothing was checked there
139
- 2 - System error (a path outside the corpus root, unreadable tree)
140
-
141
- Example:
142
- $ vat claude budget packages/cli # is it over budget where I work?
143
- `);
144
- return command;
145
- }
146
- /**
147
- * Action handler for `vat claude budget [paths...]`.
148
- *
149
- * @param pathArgs - Directories to check; empty means the whole tree
150
- * @param options - The command's flags
151
- */
152
- export async function claudeBudgetCommand(pathArgs, options) {
153
- const logger = createLogger(options.debug === true ? { debug: true } : {});
154
- const startTime = Date.now();
155
- try {
156
- const root = findProjectRoot(process.cwd()) ?? process.cwd();
157
- // 🔑 Every argument is resolved BEFORE the population. A path outside the
158
- // corpus is a usage error, and finding it afterwards would charge the caller
159
- // a full population — minutes on a cold cache — to be told they mistyped.
160
- const scope = scopeWithin(root, pathArgs);
161
- const config = loadConfig(root);
162
- const validation = config?.resources?.validation;
163
- const threshold = validation?.thresholds?.alwaysLoadedContextTokens
164
- ?? DEFAULT_ALWAYS_LOADED_CONTEXT_TOKENS;
165
- const sweep = await sweepBudgets(root, threshold, logger);
166
- const scoped = scopeSweepToPaths(sweep, scope);
167
- // The same two shared mechanisms every other lane uses, in the same order:
168
- // `validation.allow` suppresses by path glob, then `validation.severity`
169
- // resolves — BOTH directions, so an adopter promoting this code to `error`
170
- // gets an error, which is the case that gets forgotten.
171
- const findings = resolveIssueSeverity(applyAllowFilter(contextBudgetIssues(scoped.sweep), validation ?? {}).emitted, validation);
172
- warnUnmatched(scoped.unmatchedScope, logger);
173
- const report = buildReport({ root, threshold, scope, sweep, scoped, findings });
174
- emit(report, options.format ?? 'text');
175
- // `error` gates, and it is reachable two ways: an adopter promoted
176
- // ALWAYS_LOADED_CONTEXT_BUDGET, or the run checked nothing — see
177
- // {@link nothingCheckedFindings}. At the code's `info` default the first
178
- // never fires, so the budget cannot fail a build unless an adopter asked it
179
- // to; the second is not a severity anybody may configure away.
180
- process.exit(report.issueCounts.errors > 0 ? 1 : 0);
181
- }
182
- catch (error) {
183
- handleCommandError(error, logger, startTime, 'claude budget', options.format);
184
- }
185
- }
186
- /**
187
- * Assemble the report from the run's parts.
188
- *
189
- * ⛔ The counters come from the UNSCOPED sweep. They answer "what was measured",
190
- * and a scope changes only what is reported — sourcing them from the narrowed
191
- * view would let `vat claude budget docs` claim the tree has one chain.
192
- *
193
- * ⛔ This is the ONE place the stated bounds enter the machine-readable output,
194
- * and keeping it a single assignment is what makes "stated once" structural
195
- * rather than a habit: there is no per-finding site left where a copy could be
196
- * reintroduced. They are attached unconditionally — a run that flagged nothing
197
- * used the same method, and a reader acting on "within budget" needs them most.
198
- *
199
- * ⛔ Exported so it can be TESTED. What has to be pinned is a COUNT — that the
200
- * block appears exactly once across a MULTI-finding report — and a presence
201
- * check passes identically with a copy per finding.
202
- *
203
- * ⛔ The run-integrity refusal is DERIVED here from `scoped.unmatchedScope`
204
- * rather than assembled by the caller, which is what makes "a run that checked
205
- * nothing never reports success" unrepresentable instead of merely observed:
206
- * there is no pipeline step left in which a later edit could drop it. See
207
- * {@link nothingCheckedFindings}.
208
- *
209
- * @param input - The run's parts
210
- * @returns The report, ready to serialize
211
- */
212
- export function buildReport(input) {
213
- const { root, threshold, scope, sweep, scoped, findings } = input;
214
- // The run-integrity report LEADS: every budget finding beneath it is noise
215
- // until the operator knows part of what they asked about was never measured.
216
- const reported = [...nothingCheckedFindings(scoped.unmatchedScope), ...findings];
217
- return {
218
- root,
219
- threshold,
220
- scope,
221
- unmatchedScope: scoped.unmatchedScope,
222
- status: calculateValidationStatus(reported),
223
- issueCounts: countBySeverity(reported),
224
- workingLocations: sweep.evaluatedDirectories,
225
- distinctChains: sweep.queriedDirectories,
226
- skippedUnknownLocations: sweep.skippedUnknownLocations,
227
- findings: reported,
228
- boundsStatement: CLAUDE_CONTEXT_BOUNDS_STATEMENT,
229
- limits: ALWAYS_LOADED_BUDGET_LIMITS,
230
- };
231
- }
232
- /**
233
- * Resolve the requested scope, defaulting to the whole tree.
234
- *
235
- * ⚠️ No arguments means the WHOLE TREE, not the current directory — the
236
- * opposite of `vat claude context`'s default, and deliberately so. This is a
237
- * check: the useful bare invocation is "tell me about everything", the way a
238
- * linter run from a subdirectory still lints the project. Naming a directory is
239
- * how a caller asks the narrower question.
240
- *
241
- * @param root - The discovered project root
242
- * @param pathArgs - The path arguments, possibly empty
243
- * @returns Root-relative directories; `['']` for the whole tree
244
- */
245
- function scopeWithin(root, pathArgs) {
246
- if (pathArgs.length === 0)
247
- return [''];
248
- return pathArgs.map((pathArg) => targetPathWithin(root, pathArg, COMMAND_NAME));
249
- }
250
- /**
251
- * Say so, loudly, when a requested path named no working location.
252
- *
253
- * ⛔ `warn` (stderr), never `debug`. The human half of
254
- * {@link nothingCheckedFindings} — the same fact, on the channel a person reads,
255
- * ahead of the report rather than inside it.
256
- *
257
- * @param unmatched - The requested paths that matched nothing
258
- * @param logger - Where the warning goes
259
- */
260
- function warnUnmatched(unmatched, logger) {
261
- if (unmatched.length === 0)
262
- return;
263
- logger.warn(`Warning: no working location matched ${unmatched.join(', ')} — nothing was checked there.`
264
- + ' This is NOT a report that those paths are within budget.');
265
- }
266
- /**
267
- * The refusal for a run whose requested paths named no working location.
268
- *
269
- * 🔑 **A gate that checked nothing must never answer `success`.** This shipped:
270
- * `vat claude budget no/such/dir` reported `status: success` on exit 0, because
271
- * an unmatched scope measures zero chains and zero findings serializes
272
- * identically to "everything you asked about is within budget". The command
273
- * already knew — it warned on stderr that nothing had been checked — and then
274
- * published a document saying the opposite. Only the document gates a build, so
275
- * the two channels disagreed on the half that matters.
276
- *
277
- * 🪤 {@link warnUnmatched} still says the same thing on stderr, and that is not
278
- * the duplication this file bans elsewhere: stderr is the human channel and
279
- * stdout is the parsed document, so the two are one statement per audience. What
280
- * was wrong was never that the warning existed — it was that the DOCUMENT
281
- * contradicted it, and the exit code was computed from the document.
282
- *
283
- * ⛔ Not repeated a THIRD time inside the text rendering, though. That shares a
284
- * channel with the finding, which {@link renderReportText} already prints.
285
- *
286
- * The precedent is `vat resources check`'s `emptyCorpusFinding`, and this
287
- * follows it through the shared {@link runIntegrityFinding} rather than
288
- * inventing a third convention — `RESOURCE_CHECK_BROKEN` at `error`, derived in
289
- * {@link buildReport} rather than assembled in the handler, so it bypasses
290
- * `applyAllowFilter` and `resolveIssueSeverity` by construction and no report
291
- * carrying an unmatched path can be built with a clean status. The reasoning
292
- * behind each of those lives with the mechanism, in `run-integrity.ts`.
293
- *
294
- * ⛔ ONE finding however many paths went unmatched. The claim is about the RUN,
295
- * and one per argument is the per-finding duplication this report is built to
296
- * make impossible. It is not routed through `nothingCheckedFinding` because the
297
- * denominator here is not a count but a list of names the message must carry.
298
- *
299
- * @param unmatched - The requested paths that matched no working location
300
- * @returns The finding, or nothing when everything asked about was checked
301
- */
302
- function nothingCheckedFindings(unmatched) {
303
- if (unmatched.length === 0)
304
- return [];
305
- const named = unmatched.map((path) => (path === '' ? CORPUS_ROOT_LABEL : path)).join(', ');
306
- return [runIntegrityFinding(`No working location matched ${named}, so nothing was checked there and this`
307
- + ' report is NOT a statement that those paths are within budget.'
308
- + ' A working location is any non-ignored directory holding an enumerated file,'
309
- + ' so a path matching none is usually a typo, a directory that is empty, or one'
310
- + ' `.gitignore` declines — and the whole corpus root matching none means the'
311
- + ' enumeration came back empty, which a broad ignore pattern or a shallow or'
312
- + ' sparse checkout produces.'
313
- + ' `vat resources scan` over the same path lists what an enumeration finds.')];
314
- }
315
- /**
316
- * Populate the Claude-context lane for one tree and sweep every location.
317
- *
318
- * ⚠️ Roots at the discovered project root and NOWHERE else, whatever paths were
319
- * named. A budget is a property of a position in the directory tree, and rooting
320
- * a population at a subdirectory would compute one against a corpus whose
321
- * ancestors are missing — a confidently wrong number.
322
- *
323
- * @param root - The absolute corpus root; the ONLY tree populated
324
- * @param threshold - The always-loaded token budget
325
- * @param logger - Where blob-stage refusals go. **stderr**, never stdout: this
326
- * command's stdout is the document a caller parses
327
- * @returns Every working location's budget
328
- */
329
- async function sweepBudgets(root, threshold, logger) {
330
- const projection = await withPopulationCache({ root }, async (cache) => {
331
- const gitTracker = await gitTrackerForProjectRoot(root);
332
- return buildClaudeContextPopulation({ root, ...populationWiring(logger, gitTracker, cache, root) });
333
- });
334
- return sweepAlwaysLoadedBudgets(projection, threshold);
335
- }
336
- /**
337
- * Write the report in the requested format.
338
- *
339
- * @param report - The report
340
- * @param format - The selected format
341
- */
342
- function emit(report, format) {
343
- if (format === 'json') {
344
- writeJsonOutput(report);
345
- return;
346
- }
347
- if (format === 'yaml') {
348
- writeYamlOutput(report);
349
- return;
350
- }
351
- writeStdoutSync(renderReportText(report));
352
- }
353
- /**
354
- * Render the report for a person.
355
- *
356
- * ⛔ Exported so the "stated once" property can be pinned in TEXT as well as in
357
- * json. The two renderings are separate code paths and this lane has already
358
- * shipped a defect where they disagreed while each looked right alone.
359
- *
360
- * @param report - The report
361
- * @returns The text rendering, newline-terminated
362
- */
363
- export function renderReportText(report) {
364
- const lines = [
365
- `Always-loaded context budget at ${report.root}`,
366
- ` budget ${count(report.threshold)} tokens`
367
- + ` · ${count(report.workingLocations)} working locations`
368
- + ` · ${count(report.distinctChains)} distinct chains`
369
- + ` · ${count(report.skippedUnknownLocations)} unrealized`,
370
- '',
371
- ...findingLines(report.findings),
372
- ...limitLines(report),
373
- ];
374
- return `${lines.join('\n')}\n`;
375
- }
376
- /**
377
- * The stated bounds, printed once at the foot of the report.
378
- *
379
- * ⛔ Never omitted, and never per finding. A clean report is subject to exactly
380
- * the same signed bounds as a flagged one — more so, since "within budget" is the
381
- * verdict a reader is most likely to act on without reading further.
382
- *
383
- * The sibling `vat claude context` prints a section of the same shape from its
384
- * own list. They are deliberately NOT sharing a renderer: two commands, two
385
- * report types, and the query additionally prints the modelled-behaviour
386
- * citations that no bound of this verdict rests on.
387
- *
388
- * @param report - The report carrying the bounds
389
- * @returns The section's lines
390
- */
391
- function limitLines(report) {
392
- const lines = ['What this verdict does not settle', ...wrapped(report.boundsStatement, ' '), ''];
393
- for (const limit of report.limits) {
394
- lines.push(` ${limit.direction}: ${limit.id}`);
395
- lines.push(...wrapped(limit.statement, ' '));
396
- }
397
- return lines;
398
- }
399
- /**
400
- * Soft-wrap a statement under a fixed indent.
401
- *
402
- * The statements run to several sentences and are the part of this output a
403
- * reader has to actually read; unwrapped they arrive as one 500-column line that
404
- * a terminal breaks mid-word. A word longer than the width overflows its own line
405
- * rather than being split — no character of a statement is ever dropped.
406
- *
407
- * @param text - The statement
408
- * @param indent - Leading whitespace for every produced line
409
- * @returns One or more indented lines
410
- */
411
- function wrapped(text, indent) {
412
- const width = Math.max(WRAP_COLUMNS - indent.length, 24);
413
- const lines = [];
414
- let pending = '';
415
- for (const word of text.split(' ')) {
416
- const candidate = pending === '' ? word : `${pending} ${word}`;
417
- if (pending !== '' && candidate.length > width) {
418
- lines.push(indent + pending);
419
- pending = word;
420
- }
421
- else {
422
- pending = candidate;
423
- }
424
- }
425
- if (pending !== '')
426
- lines.push(indent + pending);
427
- return lines;
428
- }
429
- /**
430
- * The findings, or the sentence that says there were none.
431
- *
432
- * ⛔ The empty case is a SENTENCE, not blank output. A command that prints
433
- * nothing is indistinguishable from one that failed to run.
434
- *
435
- * @param findings - The reported findings
436
- * @returns The lines, blank-terminated
437
- */
438
- function findingLines(findings) {
439
- if (findings.length === 0)
440
- return ['Every instruction chain checked is within budget.', ''];
441
- const lines = [];
442
- for (const finding of findings) {
443
- lines.push(`${finding.severity} ${finding.code} at ${finding.location ?? CORPUS_ROOT_LABEL}`);
444
- lines.push(` ${finding.message}`);
445
- if (finding.fix !== undefined)
446
- lines.push(` Fix: ${finding.fix}`);
447
- lines.push('');
448
- }
449
- return lines;
450
- }
451
- /**
452
- * A count as a reader reads it.
453
- *
454
- * Pinned to `en-US` rather than left to the host locale, so the same run renders
455
- * byte-identically on two developers' machines — the same rule the findings
456
- * themselves follow in `utils/context-budget-issues.ts`.
457
- *
458
- * @param value - The number
459
- * @returns Its thousands-separated form
460
- */
461
- function count(value) {
462
- return value.toLocaleString('en-US');
463
- }
464
- //# sourceMappingURL=budget.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"budget.js","sourceRoot":"","sources":["../../../src/commands/claude/budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,+BAA+B,EAC/B,oCAAoC,EACpC,wBAAwB,GAGzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,GAGhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE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AAC;YAC7B,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;IACH,CAAC;IACD,IAAI,OAAO,KAAK,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,YAAY,CAAC,QAAoC;IACxD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,mDAAmD,EAAE,EAAE,CAAC,CAAC;IAC5F,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,QAAQ,IAAI,iBAAiB,EAAE,CAAC,CAAC;QAC9F,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACnC,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,UAAU,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACnE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
@@ -1,108 +0,0 @@
1
- /**
2
- * The always-loaded context budget sweep, rendered as validation findings.
3
- *
4
- * Pure: no I/O, no config, no severity resolution, no exit code. It takes the
5
- * {@link BudgetSweep} `@vibe-agent-toolkit/resources` produced and answers
6
- * "which of these does a reader need to be told about, and in what words". The
7
- * command that calls it stays a thin orchestrator, and this file is where the
8
- * decision worth testing lives.
9
- *
10
- * ## ONE issue per REPRESENTATIVE, never one per working location
11
- *
12
- * A sweep reports every working location, and locations sharing an instruction
13
- * chain share one budget — that is the whole point of the collapse. Re-measured
14
- * on VAT's own tree 2026-08-23, after the context population began declining the
15
- * gitignored half: **366 of 589 directories** pay the single chain
16
- * `['CLAUDE.md']`, so emitting per location would print 366 byte-identical
17
- * findings, all blaming one file, the moment the root `CLAUDE.md` crossed the
18
- * budget. (It read *"553 of 819"* against the wider population; the ratio barely
19
- * moved, and the argument does not turn on it.) There are **9** distinct chains
20
- * on this tree either way, so per-representative emission caps the output at 9
21
- * findings at any threshold.
22
- *
23
- * That is not a formatting preference. A check that emits 366 findings for one
24
- * cause is a check an adopter silences with
25
- * `severity.ALWAYS_LOADED_CONTEXT_BUDGET: ignore` rather than fixes — and a
26
- * silenced check reports nothing forever, which is strictly worse than the
27
- * finding it was trying to deliver.
28
- *
29
- * ## What the message may and may not claim
30
- *
31
- * ⛔ Never "the total cost". A global `~/.claude/CLAUDE.md` and the enabled skill
32
- * index are real always-loaded cost that this TREE-ONLY projection cannot see, so
33
- * even a budget reporting zero exclusions is a floor — see the module doc of
34
- * `packages/resources/src/projection/claude-context-budget.ts`, which states the
35
- * bound precisely and which this wording must not contradict. The messages here
36
- * therefore say "estimated at", and the narrower, checkable claim carried by
37
- * {@link AlwaysLoadedBudget.lowerBound} — that rows VAT *did* see were left out
38
- * of the sum — is appended as its own sentence with the three counts behind it.
39
- *
40
- * 🔑 `excludedRuleRows` is deliberately NOT one of those counts. What it counts is
41
- * PATH-SCOPED rules — the ones carrying a `paths:` list — and those are excluded
42
- * by DESIGN: they are `selected`, not `always`, so their absence from the sum is a
43
- * decision rather than a gap in what we know, and only ignorance makes a sum a
44
- * lower bound.
45
- *
46
- * ⛔ Not "rules files" as a class. An UNSCOPED rule in the root `.claude/rules/`
47
- * is classed `always` and IS charged into the budget — nothing gates it on a path,
48
- * so it loads at launch exactly as a CLAUDE.md does. The blanket reading was true
49
- * while every rule was excluded and became a false statement about a check that
50
- * gates the moment the root-rule admission started qualifying. It matters here
51
- * because the largest contributor a message names may now be a rules file, which
52
- * is why the registry `fix` points at the named contributors rather than at a file
53
- * type.
54
- */
55
- import type { BudgetSweep } from '@vibe-agent-toolkit/resources';
56
- import { type ValidationIssue } from '@vibe-agent-toolkit/schema';
57
- /** A sweep narrowed to the paths a caller asked about, and what did not match. */
58
- export interface ScopedSweep {
59
- /**
60
- * The narrowed sweep.
61
- *
62
- * ⚠️ It retains EVERY location of every selected chain, not only the ones
63
- * inside the scope — see {@link scopeSweepToPaths} for why that is the whole
64
- * point rather than an oversight.
65
- */
66
- readonly sweep: BudgetSweep;
67
- /**
68
- * Requested paths that named no working location in this sweep.
69
- *
70
- * ⛔ Reported rather than dropped. A scope that matched nothing produces zero
71
- * findings, which is byte-identical to "everything you asked about is within
72
- * budget" — the one confusion this field exists to prevent.
73
- */
74
- readonly unmatchedScope: readonly string[];
75
- }
76
- /**
77
- * Narrow a sweep to the instruction chains the requested paths inherit.
78
- *
79
- * ## The retention rule, which is the whole design
80
- *
81
- * A scope selects CHAINS, never payers. Every location paying a selected chain
82
- * is retained even when it sits outside the scope, because the finding's message
83
- * says how many working locations pay it — and that number is a fact about the
84
- * TREE. Retaining only the in-scope payers would make `vat claude budget
85
- * docs/guides` report *"1 working location pays it"* for a chain 366 directories
86
- * pay: a confidently wrong number, which costs more than no number.
87
- *
88
- * ## Matching is on SEGMENT boundaries
89
- *
90
- * `'packages/cli-x'.startsWith('packages/cli')` is true, so a bare prefix test
91
- * hands a sibling directory its neighbour's scope. The same trap
92
- * `representativeFor` in `claude-context-budget-sweep.ts` exists to avoid, one
93
- * layer down.
94
- *
95
- * @param sweep - Every working location's budget, from `sweepAlwaysLoadedBudgets`
96
- * @param scope - Root-relative directories to report for. `''` is the corpus
97
- * root and selects the whole tree; an empty list selects nothing
98
- * @returns The narrowed sweep and the requested paths that matched no location
99
- */
100
- export declare function scopeSweepToPaths(sweep: BudgetSweep, scope: readonly string[]): ScopedSweep;
101
- /**
102
- * One finding per over-budget instruction chain, ordered for a clean diff.
103
- *
104
- * @param sweep - Every working location's budget, from `sweepAlwaysLoadedBudgets`
105
- * @returns The issues, ascending by representative directory (code point)
106
- */
107
- export declare function contextBudgetIssues(sweep: BudgetSweep): ValidationIssue[];
108
- //# sourceMappingURL=context-budget-issues.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context-budget-issues.d.ts","sourceRoot":"","sources":["../../src/utils/context-budget-issues.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAYvF,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CAoB3F;AA4BD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,eAAe,EAAE,CAKzE"}