@paths.design/caws-cli 10.2.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/README.md +125 -374
  2. package/dist/index.js +45 -787
  3. package/dist/init/harness-detect.d.ts +18 -0
  4. package/dist/init/harness-detect.d.ts.map +1 -0
  5. package/dist/init/harness-detect.js +90 -0
  6. package/dist/init/harness-detect.js.map +1 -0
  7. package/dist/init/hook-install.d.ts +53 -0
  8. package/dist/init/hook-install.d.ts.map +1 -0
  9. package/dist/init/hook-install.js +421 -0
  10. package/dist/init/hook-install.js.map +1 -0
  11. package/dist/init/hook-packs/manifest-claude-code.d.ts +4 -0
  12. package/dist/init/hook-packs/manifest-claude-code.d.ts.map +1 -0
  13. package/dist/init/hook-packs/manifest-claude-code.js +190 -0
  14. package/dist/init/hook-packs/manifest-claude-code.js.map +1 -0
  15. package/dist/init/hook-packs/register.d.ts +19 -0
  16. package/dist/init/hook-packs/register.d.ts.map +1 -0
  17. package/dist/init/hook-packs/register.js +37 -0
  18. package/dist/init/hook-packs/register.js.map +1 -0
  19. package/dist/init/hook-packs/types.d.ts +123 -0
  20. package/dist/init/hook-packs/types.d.ts.map +1 -0
  21. package/dist/init/hook-packs/types.js +29 -0
  22. package/dist/init/hook-packs/types.js.map +1 -0
  23. package/dist/shell/binding/resolve-binding.d.ts +4 -0
  24. package/dist/shell/binding/resolve-binding.d.ts.map +1 -0
  25. package/dist/shell/binding/resolve-binding.js +228 -0
  26. package/dist/shell/binding/resolve-binding.js.map +1 -0
  27. package/dist/shell/binding/types.d.ts +42 -0
  28. package/dist/shell/binding/types.d.ts.map +1 -0
  29. package/dist/shell/binding/types.js +21 -0
  30. package/dist/shell/binding/types.js.map +1 -0
  31. package/dist/shell/commands/claim.d.ts +14 -0
  32. package/dist/shell/commands/claim.d.ts.map +1 -0
  33. package/dist/shell/commands/claim.js +197 -0
  34. package/dist/shell/commands/claim.js.map +1 -0
  35. package/dist/shell/commands/doctor.d.ts +13 -0
  36. package/dist/shell/commands/doctor.d.ts.map +1 -0
  37. package/dist/shell/commands/doctor.js +97 -0
  38. package/dist/shell/commands/doctor.js.map +1 -0
  39. package/dist/shell/commands/evidence.d.ts +28 -0
  40. package/dist/shell/commands/evidence.d.ts.map +1 -0
  41. package/dist/shell/commands/evidence.js +166 -0
  42. package/dist/shell/commands/evidence.js.map +1 -0
  43. package/dist/shell/commands/gates.d.ts +19 -0
  44. package/dist/shell/commands/gates.d.ts.map +1 -0
  45. package/dist/shell/commands/gates.js +208 -0
  46. package/dist/shell/commands/gates.js.map +1 -0
  47. package/dist/shell/commands/init.d.ts +17 -0
  48. package/dist/shell/commands/init.d.ts.map +1 -0
  49. package/dist/shell/commands/init.js +168 -0
  50. package/dist/shell/commands/init.js.map +1 -0
  51. package/dist/shell/commands/scope.d.ts +11 -0
  52. package/dist/shell/commands/scope.d.ts.map +1 -0
  53. package/dist/shell/commands/scope.js +92 -0
  54. package/dist/shell/commands/scope.js.map +1 -0
  55. package/dist/shell/commands/specs.d.ts +41 -0
  56. package/dist/shell/commands/specs.d.ts.map +1 -0
  57. package/dist/shell/commands/specs.js +264 -0
  58. package/dist/shell/commands/specs.js.map +1 -0
  59. package/dist/shell/commands/status.d.ts +15 -0
  60. package/dist/shell/commands/status.d.ts.map +1 -0
  61. package/dist/shell/commands/status.js +106 -0
  62. package/dist/shell/commands/status.js.map +1 -0
  63. package/dist/shell/commands/waiver.d.ts +38 -0
  64. package/dist/shell/commands/waiver.d.ts.map +1 -0
  65. package/dist/shell/commands/waiver.js +240 -0
  66. package/dist/shell/commands/waiver.js.map +1 -0
  67. package/dist/shell/commands/worktree.d.ts +38 -0
  68. package/dist/shell/commands/worktree.d.ts.map +1 -0
  69. package/dist/shell/commands/worktree.js +286 -0
  70. package/dist/shell/commands/worktree.js.map +1 -0
  71. package/dist/shell/gates/disposition.d.ts +23 -0
  72. package/dist/shell/gates/disposition.d.ts.map +1 -0
  73. package/dist/shell/gates/disposition.js +117 -0
  74. package/dist/shell/gates/disposition.js.map +1 -0
  75. package/dist/shell/gates/gate-result-contract.d.ts +39 -0
  76. package/dist/shell/gates/gate-result-contract.d.ts.map +1 -0
  77. package/dist/shell/gates/gate-result-contract.js +150 -0
  78. package/dist/shell/gates/gate-result-contract.js.map +1 -0
  79. package/dist/shell/gates/local-evaluators/budget-limit.d.ts +24 -0
  80. package/dist/shell/gates/local-evaluators/budget-limit.d.ts.map +1 -0
  81. package/dist/shell/gates/local-evaluators/budget-limit.js +67 -0
  82. package/dist/shell/gates/local-evaluators/budget-limit.js.map +1 -0
  83. package/dist/shell/gates/local-evaluators/diff-helpers.d.ts +25 -0
  84. package/dist/shell/gates/local-evaluators/diff-helpers.d.ts.map +1 -0
  85. package/dist/shell/gates/local-evaluators/diff-helpers.js +74 -0
  86. package/dist/shell/gates/local-evaluators/diff-helpers.js.map +1 -0
  87. package/dist/shell/gates/local-evaluators/index.d.ts +28 -0
  88. package/dist/shell/gates/local-evaluators/index.d.ts.map +1 -0
  89. package/dist/shell/gates/local-evaluators/index.js +67 -0
  90. package/dist/shell/gates/local-evaluators/index.js.map +1 -0
  91. package/dist/shell/gates/local-evaluators/scope-boundary.d.ts +23 -0
  92. package/dist/shell/gates/local-evaluators/scope-boundary.d.ts.map +1 -0
  93. package/dist/shell/gates/local-evaluators/scope-boundary.js +67 -0
  94. package/dist/shell/gates/local-evaluators/scope-boundary.js.map +1 -0
  95. package/dist/shell/gates/local-evaluators/spec-completeness.d.ts +12 -0
  96. package/dist/shell/gates/local-evaluators/spec-completeness.d.ts.map +1 -0
  97. package/dist/shell/gates/local-evaluators/spec-completeness.js +73 -0
  98. package/dist/shell/gates/local-evaluators/spec-completeness.js.map +1 -0
  99. package/dist/shell/gates/quality-gates-adapter.d.ts +55 -0
  100. package/dist/shell/gates/quality-gates-adapter.d.ts.map +1 -0
  101. package/dist/shell/gates/quality-gates-adapter.js +161 -0
  102. package/dist/shell/gates/quality-gates-adapter.js.map +1 -0
  103. package/dist/shell/gates/waiver-filter.d.ts +58 -0
  104. package/dist/shell/gates/waiver-filter.d.ts.map +1 -0
  105. package/dist/shell/gates/waiver-filter.js +119 -0
  106. package/dist/shell/gates/waiver-filter.js.map +1 -0
  107. package/dist/shell/index.d.ts +54 -0
  108. package/dist/shell/index.d.ts.map +1 -0
  109. package/dist/shell/index.js +85 -0
  110. package/dist/shell/index.js.map +1 -0
  111. package/dist/shell/register.d.ts +11 -0
  112. package/dist/shell/register.d.ts.map +1 -0
  113. package/dist/shell/register.js +464 -0
  114. package/dist/shell/register.js.map +1 -0
  115. package/dist/shell/render/claim.d.ts +22 -0
  116. package/dist/shell/render/claim.d.ts.map +1 -0
  117. package/dist/shell/render/claim.js +75 -0
  118. package/dist/shell/render/claim.js.map +1 -0
  119. package/dist/shell/render/decision.d.ts +15 -0
  120. package/dist/shell/render/decision.d.ts.map +1 -0
  121. package/dist/shell/render/decision.js +66 -0
  122. package/dist/shell/render/decision.js.map +1 -0
  123. package/dist/shell/render/diagnostic.d.ts +19 -0
  124. package/dist/shell/render/diagnostic.d.ts.map +1 -0
  125. package/dist/shell/render/diagnostic.js +76 -0
  126. package/dist/shell/render/diagnostic.js.map +1 -0
  127. package/dist/shell/render/finding.d.ts +15 -0
  128. package/dist/shell/render/finding.d.ts.map +1 -0
  129. package/dist/shell/render/finding.js +57 -0
  130. package/dist/shell/render/finding.js.map +1 -0
  131. package/dist/shell/render/gates.d.ts +3 -0
  132. package/dist/shell/render/gates.d.ts.map +1 -0
  133. package/dist/shell/render/gates.js +56 -0
  134. package/dist/shell/render/gates.js.map +1 -0
  135. package/dist/shell/render/init-hook-pack.d.ts +16 -0
  136. package/dist/shell/render/init-hook-pack.d.ts.map +1 -0
  137. package/dist/shell/render/init-hook-pack.js +206 -0
  138. package/dist/shell/render/init-hook-pack.js.map +1 -0
  139. package/dist/shell/render/init.d.ts +11 -0
  140. package/dist/shell/render/init.d.ts.map +1 -0
  141. package/dist/shell/render/init.js +32 -0
  142. package/dist/shell/render/init.js.map +1 -0
  143. package/dist/shell/render/status.d.ts +26 -0
  144. package/dist/shell/render/status.d.ts.map +1 -0
  145. package/dist/shell/render/status.js +143 -0
  146. package/dist/shell/render/status.js.map +1 -0
  147. package/dist/shell/render/waiver.d.ts +21 -0
  148. package/dist/shell/render/waiver.d.ts.map +1 -0
  149. package/dist/shell/render/waiver.js +94 -0
  150. package/dist/shell/render/waiver.js.map +1 -0
  151. package/dist/shell/rules.d.ts +37 -0
  152. package/dist/shell/rules.d.ts.map +1 -0
  153. package/dist/shell/rules.js +51 -0
  154. package/dist/shell/rules.js.map +1 -0
  155. package/dist/shell/session/actor.d.ts +14 -0
  156. package/dist/shell/session/actor.d.ts.map +1 -0
  157. package/dist/shell/session/actor.js +34 -0
  158. package/dist/shell/session/actor.js.map +1 -0
  159. package/dist/shell/session/resolve-session.d.ts +5 -0
  160. package/dist/shell/session/resolve-session.d.ts.map +1 -0
  161. package/dist/shell/session/resolve-session.js +239 -0
  162. package/dist/shell/session/resolve-session.js.map +1 -0
  163. package/dist/shell/session/types.d.ts +56 -0
  164. package/dist/shell/session/types.d.ts.map +1 -0
  165. package/dist/shell/session/types.js +15 -0
  166. package/dist/shell/session/types.js.map +1 -0
  167. package/dist/store/agents-store.d.ts +3 -0
  168. package/dist/store/agents-store.d.ts.map +1 -0
  169. package/dist/store/agents-store.js +63 -0
  170. package/dist/store/agents-store.js.map +1 -0
  171. package/dist/store/apply-patch.d.ts +16 -0
  172. package/dist/store/apply-patch.d.ts.map +1 -0
  173. package/dist/store/apply-patch.js +191 -0
  174. package/dist/store/apply-patch.js.map +1 -0
  175. package/dist/store/atomic-write.d.ts +34 -0
  176. package/dist/store/atomic-write.d.ts.map +1 -0
  177. package/dist/store/atomic-write.js +174 -0
  178. package/dist/store/atomic-write.js.map +1 -0
  179. package/dist/store/doctor-snapshot.d.ts +20 -0
  180. package/dist/store/doctor-snapshot.d.ts.map +1 -0
  181. package/dist/store/doctor-snapshot.js +176 -0
  182. package/dist/store/doctor-snapshot.js.map +1 -0
  183. package/dist/store/events-store.d.ts +33 -0
  184. package/dist/store/events-store.d.ts.map +1 -0
  185. package/dist/store/events-store.js +297 -0
  186. package/dist/store/events-store.js.map +1 -0
  187. package/dist/store/index.d.ts +21 -0
  188. package/dist/store/index.d.ts.map +1 -0
  189. package/dist/store/index.js +47 -0
  190. package/dist/store/index.js.map +1 -0
  191. package/dist/store/init-store.d.ts +21 -0
  192. package/dist/store/init-store.d.ts.map +1 -0
  193. package/dist/store/init-store.js +295 -0
  194. package/dist/store/init-store.js.map +1 -0
  195. package/dist/store/json-store.d.ts +3 -0
  196. package/dist/store/json-store.d.ts.map +1 -0
  197. package/dist/store/json-store.js +65 -0
  198. package/dist/store/json-store.js.map +1 -0
  199. package/dist/store/lifecycle-lock.d.ts +34 -0
  200. package/dist/store/lifecycle-lock.d.ts.map +1 -0
  201. package/dist/store/lifecycle-lock.js +168 -0
  202. package/dist/store/lifecycle-lock.js.map +1 -0
  203. package/dist/store/lifecycle-transaction.d.ts +79 -0
  204. package/dist/store/lifecycle-transaction.d.ts.map +1 -0
  205. package/dist/store/lifecycle-transaction.js +319 -0
  206. package/dist/store/lifecycle-transaction.js.map +1 -0
  207. package/dist/store/policy-store.d.ts +3 -0
  208. package/dist/store/policy-store.d.ts.map +1 -0
  209. package/dist/store/policy-store.js +65 -0
  210. package/dist/store/policy-store.js.map +1 -0
  211. package/dist/store/repo-root.d.ts +46 -0
  212. package/dist/store/repo-root.d.ts.map +1 -0
  213. package/dist/store/repo-root.js +145 -0
  214. package/dist/store/repo-root.js.map +1 -0
  215. package/dist/store/rules.d.ts +69 -0
  216. package/dist/store/rules.d.ts.map +1 -0
  217. package/dist/store/rules.js +95 -0
  218. package/dist/store/rules.js.map +1 -0
  219. package/dist/store/specs-store.d.ts +3 -0
  220. package/dist/store/specs-store.d.ts.map +1 -0
  221. package/dist/store/specs-store.js +131 -0
  222. package/dist/store/specs-store.js.map +1 -0
  223. package/dist/store/specs-writer.d.ts +61 -0
  224. package/dist/store/specs-writer.d.ts.map +1 -0
  225. package/dist/store/specs-writer.js +506 -0
  226. package/dist/store/specs-writer.js.map +1 -0
  227. package/dist/store/types.d.ts +84 -0
  228. package/dist/store/types.d.ts.map +1 -0
  229. package/dist/store/types.js +14 -0
  230. package/dist/store/types.js.map +1 -0
  231. package/dist/store/waivers-store.d.ts +25 -0
  232. package/dist/store/waivers-store.d.ts.map +1 -0
  233. package/dist/store/waivers-store.js +232 -0
  234. package/dist/store/waivers-store.js.map +1 -0
  235. package/dist/store/worktrees-store.d.ts +3 -0
  236. package/dist/store/worktrees-store.d.ts.map +1 -0
  237. package/dist/store/worktrees-store.js +62 -0
  238. package/dist/store/worktrees-store.js.map +1 -0
  239. package/dist/store/worktrees-writer.d.ts +77 -0
  240. package/dist/store/worktrees-writer.d.ts.map +1 -0
  241. package/dist/store/worktrees-writer.js +674 -0
  242. package/dist/store/worktrees-writer.js.map +1 -0
  243. package/dist/store/yaml-patch.d.ts +7 -0
  244. package/dist/store/yaml-patch.d.ts.map +1 -0
  245. package/dist/store/yaml-patch.js +250 -0
  246. package/dist/store/yaml-patch.js.map +1 -0
  247. package/dist/store/yaml-store.d.ts +9 -0
  248. package/dist/store/yaml-store.d.ts.map +1 -0
  249. package/dist/store/yaml-store.js +121 -0
  250. package/dist/store/yaml-store.js.map +1 -0
  251. package/package.json +15 -13
  252. package/dist/budget-derivation.js +0 -751
  253. package/dist/cicd-optimizer.js +0 -504
  254. package/dist/commands/agents.js +0 -124
  255. package/dist/commands/archive.js +0 -500
  256. package/dist/commands/burnup.js +0 -198
  257. package/dist/commands/diagnose.js +0 -525
  258. package/dist/commands/evaluate.js +0 -314
  259. package/dist/commands/gates.js +0 -149
  260. package/dist/commands/init.js +0 -857
  261. package/dist/commands/iterate.js +0 -417
  262. package/dist/commands/mode.js +0 -269
  263. package/dist/commands/parallel.js +0 -242
  264. package/dist/commands/plan.js +0 -438
  265. package/dist/commands/provenance.js +0 -1143
  266. package/dist/commands/quality-monitor.js +0 -284
  267. package/dist/commands/scope.js +0 -264
  268. package/dist/commands/session.js +0 -312
  269. package/dist/commands/sidecar.js +0 -74
  270. package/dist/commands/specs.js +0 -1656
  271. package/dist/commands/status.js +0 -1172
  272. package/dist/commands/templates.js +0 -237
  273. package/dist/commands/tool.js +0 -136
  274. package/dist/commands/tutorial.js +0 -480
  275. package/dist/commands/validate.js +0 -357
  276. package/dist/commands/verify-acs.js +0 -443
  277. package/dist/commands/waivers.js +0 -599
  278. package/dist/commands/workflow.js +0 -243
  279. package/dist/commands/worktree.js +0 -502
  280. package/dist/config/lite-scope.js +0 -158
  281. package/dist/config/modes.js +0 -347
  282. package/dist/constants/spec-types.js +0 -65
  283. package/dist/gates/budget-limit.js +0 -121
  284. package/dist/gates/feedback.js +0 -260
  285. package/dist/gates/format.js +0 -179
  286. package/dist/gates/god-object.js +0 -117
  287. package/dist/gates/pipeline.js +0 -167
  288. package/dist/gates/scope-boundary.js +0 -112
  289. package/dist/gates/spec-completeness.js +0 -109
  290. package/dist/gates/todo-detection.js +0 -205
  291. package/dist/generators/jest-config-generator.js +0 -242
  292. package/dist/generators/working-spec.js +0 -237
  293. package/dist/minimal-cli.js +0 -88
  294. package/dist/parallel/parallel-manager.js +0 -433
  295. package/dist/policy/PolicyManager.js +0 -470
  296. package/dist/scaffold/claude-hooks.js +0 -443
  297. package/dist/scaffold/cursor-hooks.js +0 -177
  298. package/dist/scaffold/git-hooks.js +0 -928
  299. package/dist/scaffold/index.js +0 -794
  300. package/dist/session/session-manager.js +0 -653
  301. package/dist/sidecars/index.js +0 -33
  302. package/dist/sidecars/listeners.js +0 -40
  303. package/dist/sidecars/provenance-summary.js +0 -238
  304. package/dist/sidecars/quality-gaps.js +0 -258
  305. package/dist/sidecars/schema.js +0 -149
  306. package/dist/sidecars/spec-drift.js +0 -151
  307. package/dist/sidecars/waiver-draft.js +0 -176
  308. package/dist/spec/SpecFileManager.js +0 -419
  309. package/dist/templates/.caws/schemas/policy.schema.json +0 -117
  310. package/dist/templates/.caws/schemas/scope.schema.json +0 -52
  311. package/dist/templates/.caws/schemas/waivers.schema.json +0 -106
  312. package/dist/templates/.caws/schemas/working-spec.schema.json +0 -340
  313. package/dist/templates/.caws/schemas/worktrees.schema.json +0 -38
  314. package/dist/templates/.caws/templates/working-spec.template.yml +0 -80
  315. package/dist/templates/.caws/tools/README.md +0 -18
  316. package/dist/templates/.caws/tools/scope-guard.js +0 -203
  317. package/dist/templates/.caws/tools-allow.json +0 -331
  318. package/dist/templates/.caws/waivers.yml +0 -19
  319. package/dist/templates/.claude/README.md +0 -190
  320. package/dist/templates/.claude/hooks/audit.sh +0 -121
  321. package/dist/templates/.claude/hooks/block-dangerous.sh +0 -203
  322. package/dist/templates/.claude/hooks/classify_command.py +0 -592
  323. package/dist/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
  324. package/dist/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
  325. package/dist/templates/.claude/hooks/naming-check.sh +0 -100
  326. package/dist/templates/.claude/hooks/protected-paths.sh +0 -39
  327. package/dist/templates/.claude/hooks/quality-check.sh +0 -81
  328. package/dist/templates/.claude/hooks/scan-secrets.sh +0 -85
  329. package/dist/templates/.claude/hooks/scope-guard.sh +0 -381
  330. package/dist/templates/.claude/hooks/session-caws-status.sh +0 -117
  331. package/dist/templates/.claude/hooks/session-log.sh +0 -634
  332. package/dist/templates/.claude/hooks/simplification-guard.sh +0 -92
  333. package/dist/templates/.claude/hooks/stop-worktree-check.sh +0 -46
  334. package/dist/templates/.claude/hooks/test_classify_command.py +0 -370
  335. package/dist/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
  336. package/dist/templates/.claude/hooks/validate-spec.sh +0 -76
  337. package/dist/templates/.claude/hooks/worktree-guard.sh +0 -220
  338. package/dist/templates/.claude/hooks/worktree-write-guard.sh +0 -190
  339. package/dist/templates/.claude/rules/git-safety.md +0 -26
  340. package/dist/templates/.claude/rules/worktree-isolation.md +0 -101
  341. package/dist/templates/.claude/settings.json +0 -141
  342. package/dist/templates/.cursor/README.md +0 -299
  343. package/dist/templates/.cursor/hooks/audit.sh +0 -55
  344. package/dist/templates/.cursor/hooks/block-dangerous.sh +0 -84
  345. package/dist/templates/.cursor/hooks/caws-quality-check.sh +0 -52
  346. package/dist/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
  347. package/dist/templates/.cursor/hooks/format.sh +0 -38
  348. package/dist/templates/.cursor/hooks/naming-check.sh +0 -64
  349. package/dist/templates/.cursor/hooks/scan-secrets.sh +0 -51
  350. package/dist/templates/.cursor/hooks/scope-guard.sh +0 -52
  351. package/dist/templates/.cursor/hooks/session-log.sh +0 -924
  352. package/dist/templates/.cursor/hooks/validate-spec.sh +0 -83
  353. package/dist/templates/.cursor/hooks.json +0 -76
  354. package/dist/templates/.cursor/rules/00-claims-verification.mdc +0 -144
  355. package/dist/templates/.cursor/rules/01-working-style.mdc +0 -50
  356. package/dist/templates/.cursor/rules/02-quality-gates.mdc +0 -368
  357. package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
  358. package/dist/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
  359. package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
  360. package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
  361. package/dist/templates/.cursor/rules/07-process-ops.mdc +0 -20
  362. package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
  363. package/dist/templates/.cursor/rules/09-docstrings.mdc +0 -89
  364. package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
  365. package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
  366. package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
  367. package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
  368. package/dist/templates/.cursor/rules/README.md +0 -148
  369. package/dist/templates/.github/copilot-instructions.md +0 -82
  370. package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
  371. package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
  372. package/dist/templates/.junie/guidelines.md +0 -73
  373. package/dist/templates/.vscode/launch.json +0 -17
  374. package/dist/templates/.vscode/settings.json +0 -95
  375. package/dist/templates/.windsurf/rules/caws-quality-standards.md +0 -54
  376. package/dist/templates/.windsurf/workflows/caws-guided-development.md +0 -92
  377. package/dist/templates/CLAUDE.md +0 -196
  378. package/dist/templates/COMMIT_CONVENTIONS.md +0 -86
  379. package/dist/templates/OIDC_SETUP.md +0 -300
  380. package/dist/templates/agents.md +0 -171
  381. package/dist/templates/codemod/README.md +0 -1
  382. package/dist/templates/codemod/test.js +0 -93
  383. package/dist/templates/docs/README.md +0 -151
  384. package/dist/templates/scripts/new_feature.sh +0 -80
  385. package/dist/templates/scripts/quality-gates/check-god-objects.js +0 -146
  386. package/dist/templates/scripts/quality-gates/run-quality-gates.js +0 -50
  387. package/dist/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
  388. package/dist/test-analysis.js +0 -786
  389. package/dist/tool-interface.js +0 -314
  390. package/dist/tool-loader.js +0 -303
  391. package/dist/tool-validator.js +0 -393
  392. package/dist/utils/agent-display.js +0 -210
  393. package/dist/utils/agent-session.js +0 -344
  394. package/dist/utils/async-utils.js +0 -188
  395. package/dist/utils/command-wrapper.js +0 -200
  396. package/dist/utils/event-log.js +0 -584
  397. package/dist/utils/event-renderer.js +0 -521
  398. package/dist/utils/finalization.js +0 -230
  399. package/dist/utils/git-lock.js +0 -119
  400. package/dist/utils/gitignore-updater.js +0 -158
  401. package/dist/utils/ide-detection.js +0 -133
  402. package/dist/utils/lifecycle-events.js +0 -94
  403. package/dist/utils/project-analysis.js +0 -367
  404. package/dist/utils/promise-utils.js +0 -72
  405. package/dist/utils/quality-gates-errors.js +0 -520
  406. package/dist/utils/quality-gates-utils.js +0 -387
  407. package/dist/utils/schema-validator.js +0 -50
  408. package/dist/utils/spec-resolver.js +0 -711
  409. package/dist/utils/typescript-detector.js +0 -369
  410. package/dist/utils/working-state.js +0 -530
  411. package/dist/utils/yaml-validation.js +0 -156
  412. package/dist/validation/spec-validation.js +0 -924
  413. package/dist/waivers-manager.js +0 -732
  414. package/dist/worktree/worktree-manager.js +0 -1735
  415. package/templates/.caws/schemas/policy.schema.json +0 -117
  416. package/templates/.caws/schemas/scope.schema.json +0 -52
  417. package/templates/.caws/schemas/waivers.schema.json +0 -106
  418. package/templates/.caws/schemas/working-spec.schema.json +0 -340
  419. package/templates/.caws/schemas/worktrees.schema.json +0 -38
  420. package/templates/.caws/templates/working-spec.template.yml +0 -80
  421. package/templates/.caws/tools/README.md +0 -18
  422. package/templates/.caws/tools/scope-guard.js +0 -203
  423. package/templates/.caws/tools-allow.json +0 -331
  424. package/templates/.caws/waivers.yml +0 -19
  425. package/templates/.claude/README.md +0 -190
  426. package/templates/.claude/hooks/audit.sh +0 -121
  427. package/templates/.claude/hooks/block-dangerous.sh +0 -203
  428. package/templates/.claude/hooks/classify_command.py +0 -592
  429. package/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
  430. package/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
  431. package/templates/.claude/hooks/naming-check.sh +0 -100
  432. package/templates/.claude/hooks/protected-paths.sh +0 -39
  433. package/templates/.claude/hooks/quality-check.sh +0 -81
  434. package/templates/.claude/hooks/scan-secrets.sh +0 -85
  435. package/templates/.claude/hooks/scope-guard.sh +0 -381
  436. package/templates/.claude/hooks/session-caws-status.sh +0 -117
  437. package/templates/.claude/hooks/session-log.sh +0 -634
  438. package/templates/.claude/hooks/simplification-guard.sh +0 -92
  439. package/templates/.claude/hooks/stop-worktree-check.sh +0 -46
  440. package/templates/.claude/hooks/test_classify_command.py +0 -370
  441. package/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
  442. package/templates/.claude/hooks/validate-spec.sh +0 -76
  443. package/templates/.claude/hooks/worktree-guard.sh +0 -220
  444. package/templates/.claude/hooks/worktree-write-guard.sh +0 -190
  445. package/templates/.claude/rules/git-safety.md +0 -26
  446. package/templates/.claude/rules/worktree-isolation.md +0 -101
  447. package/templates/.claude/settings.json +0 -141
  448. package/templates/.cursor/README.md +0 -299
  449. package/templates/.cursor/hooks/audit.sh +0 -55
  450. package/templates/.cursor/hooks/block-dangerous.sh +0 -84
  451. package/templates/.cursor/hooks/caws-quality-check.sh +0 -52
  452. package/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
  453. package/templates/.cursor/hooks/format.sh +0 -38
  454. package/templates/.cursor/hooks/naming-check.sh +0 -64
  455. package/templates/.cursor/hooks/scan-secrets.sh +0 -51
  456. package/templates/.cursor/hooks/scope-guard.sh +0 -52
  457. package/templates/.cursor/hooks/session-log.sh +0 -924
  458. package/templates/.cursor/hooks/validate-spec.sh +0 -83
  459. package/templates/.cursor/hooks.json +0 -76
  460. package/templates/.cursor/rules/00-claims-verification.mdc +0 -144
  461. package/templates/.cursor/rules/01-working-style.mdc +0 -50
  462. package/templates/.cursor/rules/02-quality-gates.mdc +0 -368
  463. package/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
  464. package/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
  465. package/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
  466. package/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
  467. package/templates/.cursor/rules/07-process-ops.mdc +0 -20
  468. package/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
  469. package/templates/.cursor/rules/09-docstrings.mdc +0 -89
  470. package/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
  471. package/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
  472. package/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
  473. package/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
  474. package/templates/.cursor/rules/README.md +0 -148
  475. package/templates/.github/copilot-instructions.md +0 -82
  476. package/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
  477. package/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
  478. package/templates/.junie/guidelines.md +0 -73
  479. package/templates/.vscode/launch.json +0 -17
  480. package/templates/.vscode/settings.json +0 -95
  481. package/templates/.windsurf/rules/caws-quality-standards.md +0 -54
  482. package/templates/.windsurf/workflows/caws-guided-development.md +0 -92
  483. package/templates/CLAUDE.md +0 -196
  484. package/templates/COMMIT_CONVENTIONS.md +0 -86
  485. package/templates/OIDC_SETUP.md +0 -300
  486. package/templates/agents.md +0 -171
  487. package/templates/codemod/README.md +0 -1
  488. package/templates/codemod/test.js +0 -93
  489. package/templates/docs/README.md +0 -151
  490. package/templates/scripts/new_feature.sh +0 -80
  491. package/templates/scripts/quality-gates/check-god-objects.js +0 -146
  492. package/templates/scripts/quality-gates/run-quality-gates.js +0 -50
  493. package/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ // Policy-derived gate disposition.
3
+ //
4
+ // Given (parsed quality-gates report, parsed policy), produce one
5
+ // `GateDisposition` per policy-declared gate. This is the SOLE place
6
+ // where final block/warn/skip semantics are decided. The subprocess
7
+ // reports violations; this module decides what they mean.
8
+ //
9
+ // Rules:
10
+ //
11
+ // policy.gates[gate].mode === 'skip' → result: 'skipped', blocks=false
12
+ // policy.gates[gate].enabled === false → result: 'skipped', blocks=false
13
+ // any matched violation + mode==='block' → result: 'fail', blocks=true
14
+ // any matched violation + mode==='warn' → result: 'fail', blocks=false
15
+ // no matched violation → result: 'pass', blocks=false
16
+ //
17
+ // A violation is "matched" to a policy gate iff the violation's `gate`
18
+ // field equals the policy gate id. Violations targeting unknown gate
19
+ // names (subprocess-specific checks like 'naming') are surfaced
20
+ // separately as `unmatchedViolations` so the renderer can show them,
21
+ // but they do NOT drive policy disposition.
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.deriveDispositions = deriveDispositions;
24
+ const KNOWN_GATE_IDS = [
25
+ 'budget_limit',
26
+ 'spec_completeness',
27
+ 'scope_boundary',
28
+ 'god_object',
29
+ 'todo_detection',
30
+ ];
31
+ /**
32
+ * Mechanical aliases from subprocess gate names to canonical policy
33
+ * gate IDs. Each alias must be a clear naming-only translation, never a
34
+ * semantic repurposing. Adding a new alias here requires evidence that
35
+ * the subprocess gate and the policy gate measure the same thing under
36
+ * different names.
37
+ *
38
+ * Current aliases:
39
+ * - `god_objects` (subprocess plural) → `god_object` (policy singular).
40
+ * Same intent: detect files exceeding size threshold.
41
+ * - `hidden-todo` (subprocess internal name) → `todo_detection` (policy
42
+ * canonical). Same intent: detect hidden incomplete implementations.
43
+ * NOTE: the subprocess `runHiddenTodoQualityGate` currently throws on
44
+ * errors instead of emitting violations, so this alias is only useful
45
+ * once that producer path is fixed (LEGACY-TEST-RECONCILE-001 follow-up).
46
+ *
47
+ * Refused aliases (semantically distinct, not naming variants):
48
+ * - `code_freeze` → `budget_limit` (crisis-response vs risk-tier budget)
49
+ * - `naming` → `spec_completeness` (identifier conventions vs spec health)
50
+ * - `duplication`, `documentation`, `placeholders`, `simplification`:
51
+ * no policy correspondent; remain in `unmatchedViolations`.
52
+ */
53
+ const SUBPROCESS_GATE_TO_POLICY_GATE = {
54
+ god_objects: 'god_object',
55
+ 'hidden-todo': 'todo_detection',
56
+ };
57
+ function canonicalGateName(subprocessGate) {
58
+ return SUBPROCESS_GATE_TO_POLICY_GATE[subprocessGate] ?? subprocessGate;
59
+ }
60
+ function gateConfigFor(policy, gateId) {
61
+ const cfg = policy.gates[gateId];
62
+ if (cfg === undefined)
63
+ return undefined;
64
+ return { enabled: cfg.enabled, mode: cfg.mode };
65
+ }
66
+ function deriveDispositions(report, policy) {
67
+ // Group violations by canonical gate name (applying mechanical aliases).
68
+ const byGate = new Map();
69
+ for (const v of report.violations) {
70
+ const canonical = canonicalGateName(v.gate);
71
+ const list = byGate.get(canonical);
72
+ if (list === undefined)
73
+ byGate.set(canonical, [v]);
74
+ else
75
+ list.push(v);
76
+ }
77
+ const dispositions = [];
78
+ for (const gateId of KNOWN_GATE_IDS) {
79
+ const cfg = gateConfigFor(policy, gateId);
80
+ if (cfg === undefined)
81
+ continue; // gate not declared in policy
82
+ const violations = byGate.get(gateId) ?? [];
83
+ byGate.delete(gateId);
84
+ let outcome;
85
+ let blocks;
86
+ if (cfg.enabled === false || cfg.mode === 'skip') {
87
+ outcome = 'skipped';
88
+ blocks = false;
89
+ }
90
+ else if (violations.length === 0) {
91
+ outcome = 'pass';
92
+ blocks = false;
93
+ }
94
+ else {
95
+ outcome = 'fail';
96
+ blocks = cfg.mode === 'block';
97
+ }
98
+ dispositions.push({
99
+ gate_id: gateId,
100
+ mode: cfg.mode,
101
+ outcome,
102
+ blocks,
103
+ violations,
104
+ });
105
+ }
106
+ // Whatever remains in byGate are unmatched violations (gates the
107
+ // subprocess reported but policy doesn't declare).
108
+ const unmatchedViolations = [];
109
+ for (const list of byGate.values())
110
+ unmatchedViolations.push(...list);
111
+ return {
112
+ dispositions,
113
+ unmatchedViolations,
114
+ anyBlocks: dispositions.some((d) => d.blocks),
115
+ };
116
+ }
117
+ //# sourceMappingURL=disposition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disposition.js","sourceRoot":"","sources":["../../../src/shell/gates/disposition.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,EAAE;AACF,kEAAkE;AAClE,qEAAqE;AACrE,oEAAoE;AACpE,0DAA0D;AAC1D,EAAE;AACF,SAAS;AACT,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,gEAAgE;AAChE,qEAAqE;AACrE,4CAA4C;;AA4E5C,gDAoDC;AApGD,MAAM,cAAc,GAAG;IACrB,cAAc;IACd,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;CACR,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,8BAA8B,GAAqC;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AAM,CAAC,CAAC;QAEtB,IAAI,OAAoB,CAAC;QACzB,IAAI,MAAe,CAAC;QACpB,IAAI,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACjD,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC;aAAM,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,GAAG,MAAM,CAAC;YACjB,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,MAAM,CAAC;YACjB,MAAM,GAAG,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC;QAChC,CAAC;QAED,YAAY,CAAC,IAAI,CAAC;YAChB,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,OAAO;YACP,MAAM;YACN,UAAU;SACX,CAAC,CAAC;IACL,CAAC;IAED,iEAAiE;IACjE,mDAAmD;IACnD,MAAM,mBAAmB,GAAqB,EAAE,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE;QAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAEtE,OAAO;QACL,YAAY;QACZ,mBAAmB;QACnB,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;KAC9C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { type Result } from '@paths.design/caws-kernel';
2
+ export interface GatesViolation {
3
+ /** The gate that detected this violation. May be any string. */
4
+ readonly gate: string;
5
+ /** Optional violation type id (e.g. 'banned_modifier', 'timeout'). */
6
+ readonly type?: string;
7
+ readonly message?: string;
8
+ readonly file?: string;
9
+ readonly line?: number;
10
+ readonly rule?: string;
11
+ /** Subprocess-reported severity. NOT trusted for blocking — policy decides. */
12
+ readonly severity?: string;
13
+ }
14
+ export interface GatesWarning {
15
+ readonly gate?: string;
16
+ readonly type?: string;
17
+ readonly message?: string;
18
+ }
19
+ export interface GatesReport {
20
+ readonly timestamp: string;
21
+ readonly context: string;
22
+ readonly files_scoped: number;
23
+ readonly warnings: readonly GatesWarning[];
24
+ readonly violations: readonly GatesViolation[];
25
+ readonly waivers?: {
26
+ readonly active: number;
27
+ readonly applied: number;
28
+ };
29
+ readonly performance?: {
30
+ readonly total_execution_time_ms?: number;
31
+ };
32
+ }
33
+ /**
34
+ * Parse + validate the subprocess JSON. Returns Ok(GatesReport) only when
35
+ * EVERY required field is present and well-typed. Returns Err with a
36
+ * specific shell.gates.* rule otherwise. Never throws on bad input.
37
+ */
38
+ export declare function validateGatesReport(raw: string): Result<GatesReport>;
39
+ //# sourceMappingURL=gate-result-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-result-contract.d.ts","sourceRoot":"","sources":["../../../src/shell/gates/gate-result-contract.ts"],"names":[],"mappings":"AAwBA,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAIlF,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,QAAQ,CAAC,WAAW,CAAC,EAAE;QACrB,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;KAC3C,CAAC;CACH;AAiED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CA0GpE"}
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ // Runtime validator for `caws-quality-gates --json` output.
3
+ //
4
+ // The subprocess emits a SINGLE aggregated JSON payload describing the full
5
+ // gate run. We do NOT trust the shape — TypeScript types do not survive
6
+ // `JSON.parse`. The validator below enforces the minimal contract the
7
+ // vNext command needs to make a policy-derived decision.
8
+ //
9
+ // Accepted shape (narrowed; the real payload may carry more fields, which
10
+ // we ignore):
11
+ //
12
+ // {
13
+ // timestamp: string (ISO-8601)
14
+ // context: string (e.g. 'cli', 'commit', 'ci')
15
+ // files_scoped: number
16
+ // warnings: Array<{ gate?: string; ... }>
17
+ // violations: Array<{ gate: string; ... }>
18
+ // waivers?: { active: number; applied: number; details: ... }
19
+ // performance?: { total_execution_time_ms?: number; ... }
20
+ // }
21
+ //
22
+ // Anything else is rejected. The contract is intentionally tighter than the
23
+ // subprocess's actual payload — the command should only consume fields it
24
+ // has validated.
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.validateGatesReport = validateGatesReport;
27
+ const caws_kernel_1 = require("@paths.design/caws-kernel");
28
+ const rules_1 = require("../rules");
29
+ function diag(rule, message, data) {
30
+ const base = {
31
+ rule,
32
+ authority: 'kernel/diagnostics',
33
+ severity: 'error',
34
+ message,
35
+ };
36
+ return data !== undefined ? { ...base, data } : base;
37
+ }
38
+ function isObject(v) {
39
+ return typeof v === 'object' && v !== null && !Array.isArray(v);
40
+ }
41
+ function validateViolation(value, idx) {
42
+ if (!isObject(value)) {
43
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, `violations[${idx}] is not an object.`, { index: idx }));
44
+ }
45
+ if (typeof value['gate'] !== 'string' || value['gate'].length === 0) {
46
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, `violations[${idx}] is missing required string field 'gate'.`, { index: idx }));
47
+ }
48
+ const out = { gate: value['gate'] };
49
+ if (typeof value['type'] === 'string')
50
+ out.type = value['type'];
51
+ if (typeof value['message'] === 'string')
52
+ out.message = value['message'];
53
+ if (typeof value['file'] === 'string')
54
+ out.file = value['file'];
55
+ if (typeof value['line'] === 'number')
56
+ out.line = value['line'];
57
+ if (typeof value['rule'] === 'string')
58
+ out.rule = value['rule'];
59
+ if (typeof value['severity'] === 'string')
60
+ out.severity = value['severity'];
61
+ return (0, caws_kernel_1.ok)(out);
62
+ }
63
+ function validateWarning(value, idx) {
64
+ if (!isObject(value)) {
65
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, `warnings[${idx}] is not an object.`, { index: idx }));
66
+ }
67
+ const out = {};
68
+ if (typeof value['gate'] === 'string')
69
+ out.gate = value['gate'];
70
+ if (typeof value['type'] === 'string')
71
+ out.type = value['type'];
72
+ if (typeof value['message'] === 'string')
73
+ out.message = value['message'];
74
+ return (0, caws_kernel_1.ok)(out);
75
+ }
76
+ /**
77
+ * Parse + validate the subprocess JSON. Returns Ok(GatesReport) only when
78
+ * EVERY required field is present and well-typed. Returns Err with a
79
+ * specific shell.gates.* rule otherwise. Never throws on bad input.
80
+ */
81
+ function validateGatesReport(raw) {
82
+ let parsed;
83
+ try {
84
+ parsed = JSON.parse(raw);
85
+ }
86
+ catch (e) {
87
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_NOT_JSON, `quality-gates output is not valid JSON: ${e.message}`));
88
+ }
89
+ if (!isObject(parsed)) {
90
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, 'quality-gates output is not a JSON object.'));
91
+ }
92
+ if (typeof parsed['timestamp'] !== 'string') {
93
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, 'quality-gates output missing required string field `timestamp`.'));
94
+ }
95
+ if (typeof parsed['context'] !== 'string') {
96
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, 'quality-gates output missing required string field `context`.'));
97
+ }
98
+ if (typeof parsed['files_scoped'] !== 'number') {
99
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, 'quality-gates output missing required number field `files_scoped`.'));
100
+ }
101
+ const rawViolations = parsed['violations'];
102
+ if (!Array.isArray(rawViolations)) {
103
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, 'quality-gates output missing required array field `violations`.'));
104
+ }
105
+ const violations = [];
106
+ for (let i = 0; i < rawViolations.length; i++) {
107
+ const r = validateViolation(rawViolations[i], i);
108
+ if (!r.ok)
109
+ return r;
110
+ violations.push(r.value);
111
+ }
112
+ const rawWarnings = parsed['warnings'];
113
+ if (!Array.isArray(rawWarnings)) {
114
+ return (0, caws_kernel_1.err)(diag(rules_1.SHELL_RULES.GATES_REPORT_INVALID_SHAPE, 'quality-gates output missing required array field `warnings`.'));
115
+ }
116
+ const warnings = [];
117
+ for (let i = 0; i < rawWarnings.length; i++) {
118
+ const r = validateWarning(rawWarnings[i], i);
119
+ if (!r.ok)
120
+ return r;
121
+ warnings.push(r.value);
122
+ }
123
+ const out = {
124
+ timestamp: parsed['timestamp'],
125
+ context: parsed['context'],
126
+ files_scoped: parsed['files_scoped'],
127
+ warnings,
128
+ violations,
129
+ };
130
+ // Optional fields — defensive: accept if shaped right, ignore otherwise.
131
+ if (isObject(parsed['waivers'])) {
132
+ const w = parsed['waivers'];
133
+ if (typeof w['active'] === 'number' && typeof w['applied'] === 'number') {
134
+ out.waivers = {
135
+ active: w['active'],
136
+ applied: w['applied'],
137
+ };
138
+ }
139
+ }
140
+ if (isObject(parsed['performance'])) {
141
+ const p = parsed['performance'];
142
+ if (typeof p['total_execution_time_ms'] === 'number') {
143
+ out.performance = {
144
+ total_execution_time_ms: p['total_execution_time_ms'],
145
+ };
146
+ }
147
+ }
148
+ return (0, caws_kernel_1.ok)(out);
149
+ }
150
+ //# sourceMappingURL=gate-result-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-result-contract.js","sourceRoot":"","sources":["../../../src/shell/gates/gate-result-contract.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,sEAAsE;AACtE,yDAAyD;AACzD,EAAE;AACF,0EAA0E;AAC1E,cAAc;AACd,EAAE;AACF,MAAM;AACN,uCAAuC;AACvC,yDAAyD;AACzD,2BAA2B;AAC3B,kDAAkD;AAClD,iDAAiD;AACjD,sEAAsE;AACtE,8DAA8D;AAC9D,MAAM;AACN,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,iBAAiB;;AA4GjB,kDA0GC;AApND,2DAAkF;AAElF,oCAAuC;AAoCvC,SAAS,IAAI,CAAC,IAAY,EAAE,OAAe,EAAE,I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C,GAAG,MAAM,CAAC,SAAS,CAA4B,CAAC;QACvD,IAAI,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,QAAQ,EAAE,CAAC;YACvE,GAAyD,CAAC,OAAO,GAAG;gBACnE,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC;gBACnB,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;QACpC,MAAM,CAAC,GAAG,MAAM,CAAC,aAAa,CAA4B,CAAC;QAC3D,IAAI,OAAO,CAAC,CAAC,yBAAyB,CAAC,KAAK,QAAQ,EAAE,CAAC;YACpD,GAA8D,CAAC,WAAW,GAAG;gBAC5E,uBAAuB,EAAE,CAAC,CAAC,yBAAyB,CAAC;aACtD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,IAAA,gBAAE,EAAC,GAAG,CAAC,CAAC;AACjB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { Spec } from '@paths.design/caws-kernel';
2
+ import type { Policy } from '@paths.design/caws-kernel';
3
+ import type { GatesViolation } from '../gate-result-contract';
4
+ import { type StagedFileChange } from './diff-helpers';
5
+ export interface BudgetLimitInput {
6
+ readonly spec: Spec;
7
+ readonly policy: Policy;
8
+ readonly repoRoot: string;
9
+ /** Override the staged-diff source (tests). */
10
+ readonly stagedChanges?: readonly StagedFileChange[];
11
+ }
12
+ export interface BudgetLimitResult {
13
+ readonly violations: readonly GatesViolation[];
14
+ /** Observed budget consumption, regardless of whether a violation fired.
15
+ * Useful for telemetry/diagnostics; not used for blocking. */
16
+ readonly observed: {
17
+ readonly files_changed: number;
18
+ readonly loc_changed: number;
19
+ readonly max_files: number;
20
+ readonly max_loc: number;
21
+ };
22
+ }
23
+ export declare function evaluateBudgetLimit(input: BudgetLimitInput): BudgetLimitResult;
24
+ //# sourceMappingURL=budget-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"budget-limit.d.ts","sourceRoot":"","sources":["../../../../src/shell/gates/local-evaluators/budget-limit.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAsC,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE3F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACtD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C;mEAC+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AASD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CA2C9E"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ // budget_limit evaluator.
3
+ //
4
+ // Compares staged diff size to the policy's per-risk-tier budget.
5
+ //
6
+ // Rules:
7
+ // - Risk tier comes from the active spec (1, 2, or 3).
8
+ // - Budget comes from policy.risk_tiers[tier] (max_files, max_loc).
9
+ // - A violation fires when files_changed > max_files or
10
+ // loc_changed > max_loc. Each threshold breach is one violation.
11
+ //
12
+ // This evaluator is local (caws-cli concern). The quality-gates
13
+ // subprocess does not emit `budget_limit` violations; v11 deliberately
14
+ // keeps risk-tier budget enforcement in the CLI where the active spec
15
+ // and staged diff are authoritative.
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.evaluateBudgetLimit = evaluateBudgetLimit;
18
+ const diff_helpers_1 = require("./diff-helpers");
19
+ function tierKey(tier) {
20
+ if (tier === 1)
21
+ return '1';
22
+ if (tier === 2)
23
+ return '2';
24
+ if (tier === 3)
25
+ return '3';
26
+ return undefined;
27
+ }
28
+ function evaluateBudgetLimit(input) {
29
+ const changes = input.stagedChanges ?? (0, diff_helpers_1.listStagedChanges)(input.repoRoot);
30
+ const files_changed = changes.length;
31
+ const loc_changed = (0, diff_helpers_1.totalInsertions)(changes);
32
+ const tk = tierKey(input.spec.risk_tier);
33
+ if (tk === undefined) {
34
+ // Spec carries a risk_tier the schema accepts (1, 2, 3); anything
35
+ // else is a spec-completeness problem, not a budget violation.
36
+ return {
37
+ violations: [],
38
+ observed: { files_changed, loc_changed, max_files: 0, max_loc: 0 },
39
+ };
40
+ }
41
+ const budget = input.policy.risk_tiers[tk];
42
+ const { max_files, max_loc } = budget;
43
+ const violations = [];
44
+ if (files_changed > max_files) {
45
+ violations.push({
46
+ gate: 'budget_limit',
47
+ type: 'max_files_exceeded',
48
+ message: `Staged change touches ${files_changed} file(s); risk-tier ${input.spec.risk_tier} ` +
49
+ `budget allows up to ${max_files}.`,
50
+ severity: 'fail',
51
+ });
52
+ }
53
+ if (loc_changed > max_loc) {
54
+ violations.push({
55
+ gate: 'budget_limit',
56
+ type: 'max_loc_exceeded',
57
+ message: `Staged change adds ${loc_changed} line(s); risk-tier ${input.spec.risk_tier} ` +
58
+ `budget allows up to ${max_loc}.`,
59
+ severity: 'fail',
60
+ });
61
+ }
62
+ return {
63
+ violations,
64
+ observed: { files_changed, loc_changed, max_files, max_loc },
65
+ };
66
+ }
67
+ //# sourceMappingURL=budget-limit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"budget-limit.js","sourceRoot":"","sources":["../../../../src/shell/gates/local-evaluators/budget-limit.ts"],"names":[],"mappings":";AAAA,0BAA0B;AAC1B,EAAE;AACF,kEAAkE;AAClE,EAAE;AACF,SAAS;AACT,yDAAyD;AACzD,sEAAsE;AACtE,0DAA0D;AAC1D,qEAAqE;AACrE,EAAE;AACF,gEAAgE;AAChE,uEAAuE;AACvE,sEAAsE;AACtE,qCAAqC;;AAmCrC,kDA2CC;AAxED,iDAA2F;AAsB3F,SAAS,OAAO,CAAC,IAAY;IAC3B,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3B,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3B,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAAuB;IACzD,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,IAAI,IAAA,gCAAiB,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzE,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IACrC,MAAM,WAAW,GAAG,IAAA,8BAAe,EAAC,OAAO,CAAC,CAAC;IAE7C,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,kEAAkE;QAClE,+DAA+D;QAC/D,OAAO;YACL,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE;SACnE,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC3C,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAEtC,MAAM,UAAU,GAAqB,EAAE,CAAC;IACxC,IAAI,aAAa,GAAG,SAAS,EAAE,CAAC;QAC9B,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EACL,yBAAyB,aAAa,uBAAuB,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG;gBACpF,uBAAuB,SAAS,GAAG;YACrC,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAC;IACL,CAAC;IACD,IAAI,WAAW,GAAG,OAAO,EAAE,CAAC;QAC1B,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,kBAAkB;YACxB,OAAO,EACL,sBAAsB,WAAW,uBAAuB,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG;gBAC/E,uBAAuB,OAAO,GAAG;YACnC,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,UAAU;QACV,QAAQ,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE;KAC7D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ export interface StagedFileChange {
2
+ /** Repo-relative POSIX path of the changed file. */
3
+ readonly path: string;
4
+ /** Lines added in the staged diff. `null` for binary files. */
5
+ readonly insertions: number | null;
6
+ /** Lines deleted in the staged diff. `null` for binary files. */
7
+ readonly deletions: number | null;
8
+ }
9
+ /**
10
+ * List staged files with line-count deltas. Returns an empty array on
11
+ * any git error (no commits yet, not a repo, etc.) — the caller decides
12
+ * what an empty-diff means for their gate.
13
+ *
14
+ * `--cached` is used so the contract matches `--context=commit`. The
15
+ * caller may swap to `--diff-filter` or other working-tree shapes if a
16
+ * different context is needed; v11.1 only ships the commit context.
17
+ */
18
+ export declare function listStagedChanges(repoRoot: string): readonly StagedFileChange[];
19
+ /**
20
+ * Total inserted lines across staged changes. Binary files (`null`
21
+ * insertions) contribute 0 to the LOC count — they are governed by
22
+ * file count instead.
23
+ */
24
+ export declare function totalInsertions(changes: readonly StagedFileChange[]): number;
25
+ //# sourceMappingURL=diff-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-helpers.d.ts","sourceRoot":"","sources":["../../../../src/shell/gates/local-evaluators/diff-helpers.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,iEAAiE;IACjE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAUD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,gBAAgB,EAAE,CA2B/E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,CAM5E"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ // Staged-diff helpers for local gate evaluators.
3
+ //
4
+ // These helpers shell out to git to enumerate staged file changes and
5
+ // their insertion counts. They are the only place local evaluators
6
+ // touch git; the evaluators themselves remain pure (path lists + numbers
7
+ // in, violations out).
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.listStagedChanges = listStagedChanges;
10
+ exports.totalInsertions = totalInsertions;
11
+ const node_child_process_1 = require("node:child_process");
12
+ function runGit(args, cwd) {
13
+ return (0, node_child_process_1.execFileSync)('git', [...args], {
14
+ cwd,
15
+ encoding: 'utf8',
16
+ stdio: ['ignore', 'pipe', 'pipe'],
17
+ }).toString();
18
+ }
19
+ /**
20
+ * List staged files with line-count deltas. Returns an empty array on
21
+ * any git error (no commits yet, not a repo, etc.) — the caller decides
22
+ * what an empty-diff means for their gate.
23
+ *
24
+ * `--cached` is used so the contract matches `--context=commit`. The
25
+ * caller may swap to `--diff-filter` or other working-tree shapes if a
26
+ * different context is needed; v11.1 only ships the commit context.
27
+ */
28
+ function listStagedChanges(repoRoot) {
29
+ let raw;
30
+ try {
31
+ raw = runGit(['diff', '--cached', '--numstat', '-z'], repoRoot);
32
+ }
33
+ catch {
34
+ return [];
35
+ }
36
+ // --numstat -z output: `\d+\t\d+\t<path>\0` per record. Binary files
37
+ // show `-\t-\t<path>\0`.
38
+ const records = [];
39
+ for (const rec of raw.split('\0')) {
40
+ if (rec.length === 0)
41
+ continue;
42
+ const tab1 = rec.indexOf('\t');
43
+ if (tab1 === -1)
44
+ continue;
45
+ const tab2 = rec.indexOf('\t', tab1 + 1);
46
+ if (tab2 === -1)
47
+ continue;
48
+ const addsRaw = rec.slice(0, tab1);
49
+ const delsRaw = rec.slice(tab1 + 1, tab2);
50
+ const path = rec.slice(tab2 + 1);
51
+ if (path.length === 0)
52
+ continue;
53
+ records.push({
54
+ path,
55
+ insertions: addsRaw === '-' ? null : Number.parseInt(addsRaw, 10),
56
+ deletions: delsRaw === '-' ? null : Number.parseInt(delsRaw, 10),
57
+ });
58
+ }
59
+ return records;
60
+ }
61
+ /**
62
+ * Total inserted lines across staged changes. Binary files (`null`
63
+ * insertions) contribute 0 to the LOC count — they are governed by
64
+ * file count instead.
65
+ */
66
+ function totalInsertions(changes) {
67
+ let n = 0;
68
+ for (const c of changes) {
69
+ if (typeof c.insertions === 'number')
70
+ n += c.insertions;
71
+ }
72
+ return n;
73
+ }
74
+ //# sourceMappingURL=diff-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-helpers.js","sourceRoot":"","sources":["../../../../src/shell/gates/local-evaluators/diff-helpers.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,yEAAyE;AACzE,uBAAuB;;AA8BvB,8C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CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QACjC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAChC,OAAO,CAAC,IAAI,CAAC;YACX,IAAI;YACJ,UAAU,EAAE,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YACjE,SAAS,EAAE,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;SACjE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,OAAoC;IAClE,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ;YAAE,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC;IAC1D,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { Spec, Policy } from '@paths.design/caws-kernel';
2
+ import type { GatesViolation } from '../gate-result-contract';
3
+ import type { StagedFileChange } from './diff-helpers';
4
+ export type { StagedFileChange } from './diff-helpers';
5
+ export { evaluateBudgetLimit } from './budget-limit';
6
+ export { evaluateScopeBoundary } from './scope-boundary';
7
+ export { evaluateSpecCompleteness } from './spec-completeness';
8
+ export interface LocalEvaluatorsInput {
9
+ readonly spec: Spec;
10
+ readonly policy: Policy;
11
+ readonly repoRoot: string;
12
+ readonly nowIso: string;
13
+ /** Worktree name for scope diagnostics (optional). */
14
+ readonly worktreeName?: string;
15
+ /** Override staged-diff source (tests). When provided, all evaluators
16
+ * use this list instead of shelling out to git. */
17
+ readonly stagedChanges?: readonly StagedFileChange[];
18
+ }
19
+ export interface LocalEvaluatorsResult {
20
+ readonly violations: readonly GatesViolation[];
21
+ }
22
+ /**
23
+ * Run all CAWS-local policy evaluators against the given spec+policy.
24
+ * Returns a flat list of violations tagged with canonical policy gate
25
+ * names (`budget_limit`, `scope_boundary`, `spec_completeness`).
26
+ */
27
+ export declare function runLocalEvaluators(input: LocalEvaluatorsInput): LocalEvaluatorsResult;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shell/gates/local-evaluators/index.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;wDACoD;IACpD,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACtD;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;CAChD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,qBAAqB,CA2BrF"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ // Local gate evaluators — caws-cli's contribution to the gates pipeline.
3
+ //
4
+ // Why local evaluators exist
5
+ // ──────────────────────────
6
+ // The quality-gates subprocess implements *code-quality* checks (naming,
7
+ // duplication, god objects, hidden TODOs, etc.). Those checks live in
8
+ // `@paths.design/quality-gates` because they're general-purpose and
9
+ // language-agnostic.
10
+ //
11
+ // CAWS *policy* gates (`budget_limit`, `scope_boundary`,
12
+ // `spec_completeness`) are different in kind: they need the active spec
13
+ // id, the spec YAML, the policy YAML, and the staged diff. Pushing them
14
+ // into the generic subprocess would couple quality-gates to caws-cli's
15
+ // state shape. Keeping them local preserves layering:
16
+ //
17
+ // quality-gates package : code-quality checks → JSON violations[]
18
+ // caws-cli local : policy/spec/diff authority checks
19
+ // → additional JSON violations[]
20
+ // gates command : merge violations, apply waivers,
21
+ // derive disposition, emit events
22
+ //
23
+ // Each evaluator returns the same `GatesViolation[]` shape the
24
+ // subprocess emits, so the downstream disposition/waiver pipeline is
25
+ // uniform.
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.evaluateSpecCompleteness = exports.evaluateScopeBoundary = exports.evaluateBudgetLimit = void 0;
28
+ exports.runLocalEvaluators = runLocalEvaluators;
29
+ const budget_limit_1 = require("./budget-limit");
30
+ const scope_boundary_1 = require("./scope-boundary");
31
+ const spec_completeness_1 = require("./spec-completeness");
32
+ var budget_limit_2 = require("./budget-limit");
33
+ Object.defineProperty(exports, "evaluateBudgetLimit", { enumerable: true, get: function () { return budget_limit_2.evaluateBudgetLimit; } });
34
+ var scope_boundary_2 = require("./scope-boundary");
35
+ Object.defineProperty(exports, "evaluateScopeBoundary", { enumerable: true, get: function () { return scope_boundary_2.evaluateScopeBoundary; } });
36
+ var spec_completeness_2 = require("./spec-completeness");
37
+ Object.defineProperty(exports, "evaluateSpecCompleteness", { enumerable: true, get: function () { return spec_completeness_2.evaluateSpecCompleteness; } });
38
+ /**
39
+ * Run all CAWS-local policy evaluators against the given spec+policy.
40
+ * Returns a flat list of violations tagged with canonical policy gate
41
+ * names (`budget_limit`, `scope_boundary`, `spec_completeness`).
42
+ */
43
+ function runLocalEvaluators(input) {
44
+ const violations = [];
45
+ const budget = (0, budget_limit_1.evaluateBudgetLimit)({
46
+ spec: input.spec,
47
+ policy: input.policy,
48
+ repoRoot: input.repoRoot,
49
+ ...(input.stagedChanges !== undefined ? { stagedChanges: input.stagedChanges } : {}),
50
+ });
51
+ violations.push(...budget.violations);
52
+ const scope = (0, scope_boundary_1.evaluateScopeBoundary)({
53
+ spec: input.spec,
54
+ policy: input.policy,
55
+ repoRoot: input.repoRoot,
56
+ ...(input.worktreeName !== undefined ? { worktreeName: input.worktreeName } : {}),
57
+ ...(input.stagedChanges !== undefined ? { stagedChanges: input.stagedChanges } : {}),
58
+ });
59
+ violations.push(...scope.violations);
60
+ const completeness = (0, spec_completeness_1.evaluateSpecCompleteness)({
61
+ spec: input.spec,
62
+ nowIso: input.nowIso,
63
+ });
64
+ violations.push(...completeness.violations);
65
+ return { violations };
66
+ }
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shell/gates/local-evaluators/index.ts"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,EAAE;AACF,6BAA6B;AAC7B,6BAA6B;AAC7B,yEAAyE;AACzE,sEAAsE;AACtE,oEAAoE;AACpE,qBAAqB;AACrB,EAAE;AACF,yDAAyD;AACzD,wEAAwE;AACxE,wEAAwE;AACxE,uEAAuE;AACvE,sDAAsD;AACtD,EAAE;AACF,qEAAqE;AACrE,+DAA+D;AAC/D,6DAA6D;AAC7D,8DAA8D;AAC9D,8DAA8D;AAC9D,EAAE;AACF,+DAA+D;AAC/D,qEAAqE;AACrE,WAAW;;;AAoCX,gDA2BC;AA1DD,iDAAqD;AACrD,qDAAyD;AACzD,2DAA+D;A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