@probelabs/visor 0.1.106 → 0.1.111

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 (530) hide show
  1. package/README.md +71 -2
  2. package/action.yml +1 -1
  3. package/defaults/code-refiner.yaml +114 -0
  4. package/defaults/{.visor.yaml → code-review.yaml} +35 -226
  5. package/defaults/override.yaml +52 -0
  6. package/defaults/task-refinement.yaml +624 -0
  7. package/defaults/visor.tests.yaml +685 -0
  8. package/defaults/visor.yaml +483 -0
  9. package/dist/action-cli-bridge.d.ts +11 -82
  10. package/dist/action-cli-bridge.d.ts.map +1 -1
  11. package/dist/ai-review-service.d.ts +28 -9
  12. package/dist/ai-review-service.d.ts.map +1 -1
  13. package/dist/check-execution-engine.d.ts +19 -331
  14. package/dist/check-execution-engine.d.ts.map +1 -1
  15. package/dist/cli-main.d.ts.map +1 -1
  16. package/dist/cli.d.ts +0 -1
  17. package/dist/cli.d.ts.map +1 -1
  18. package/dist/config.d.ts +16 -0
  19. package/dist/config.d.ts.map +1 -1
  20. package/dist/cron-scheduler.d.ts +3 -3
  21. package/dist/cron-scheduler.d.ts.map +1 -1
  22. package/dist/debug-visualizer/ws-server.d.ts +7 -1
  23. package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
  24. package/dist/defaults/code-refiner.yaml +114 -0
  25. package/dist/defaults/{.visor.yaml → code-review.yaml} +35 -226
  26. package/dist/defaults/override.yaml +52 -0
  27. package/dist/defaults/task-refinement.yaml +624 -0
  28. package/dist/defaults/visor.tests.yaml +685 -0
  29. package/dist/defaults/visor.yaml +483 -0
  30. package/dist/docs/DEPLOYMENT.md +118 -0
  31. package/dist/docs/GITHUB_CHECKS.md +280 -0
  32. package/dist/docs/NPM_USAGE.md +208 -0
  33. package/dist/docs/action-reference.md +19 -0
  34. package/dist/docs/advanced-ai.md +237 -0
  35. package/dist/docs/ai-configuration.md +535 -0
  36. package/dist/docs/ai-custom-tools-usage.md +261 -0
  37. package/dist/docs/ai-custom-tools.md +392 -0
  38. package/dist/docs/author-permissions.md +610 -0
  39. package/dist/docs/bot-transports-rfc.md +23 -0
  40. package/dist/docs/ci-cli-mode.md +34 -0
  41. package/dist/docs/claude-code.md +74 -0
  42. package/dist/docs/command-provider.md +559 -0
  43. package/dist/docs/commands.md +8 -0
  44. package/dist/docs/configuration.md +324 -0
  45. package/dist/docs/custom-tools.md +424 -0
  46. package/dist/docs/dashboards/README.md +23 -0
  47. package/dist/docs/dashboards/grafana-visor-diagrams.json +20 -0
  48. package/dist/docs/dashboards/grafana-visor-overview.json +33 -0
  49. package/dist/docs/debug-visualizer-progress.md +572 -0
  50. package/dist/docs/debug-visualizer-rfc.md +691 -0
  51. package/dist/docs/debug-visualizer.md +114 -0
  52. package/dist/docs/debugging.md +636 -0
  53. package/dist/docs/default-output-schema.md +28 -0
  54. package/dist/docs/dependencies.md +369 -0
  55. package/dist/docs/dev-playbook.md +9 -0
  56. package/dist/docs/engine-pause-resume-rfc.md +192 -0
  57. package/dist/docs/engine-state-machine-plan.md +333 -0
  58. package/dist/docs/event-driven-github-integration-rfc.md +743 -0
  59. package/dist/docs/event-triggers.md +292 -0
  60. package/dist/docs/execution-statistics-rfc.md +290 -0
  61. package/dist/docs/fact-validator-gap-analysis.md +178 -0
  62. package/dist/docs/fact-validator-implementation-plan.md +1235 -0
  63. package/dist/docs/fail-if.md +95 -0
  64. package/dist/docs/failure-conditions-implementation.md +271 -0
  65. package/dist/docs/failure-conditions-schema.md +173 -0
  66. package/dist/docs/failure-routing-rfc.md +193 -0
  67. package/dist/docs/failure-routing.md +507 -0
  68. package/dist/docs/foreach-dependency-propagation.md +473 -0
  69. package/dist/docs/github-ops.md +89 -0
  70. package/dist/docs/goto-forward-run-plan.md +113 -0
  71. package/dist/docs/guides/criticality-modes.md +332 -0
  72. package/dist/docs/guides/fault-management-and-contracts.md +738 -0
  73. package/dist/docs/guides/workflow-style-guide.md +224 -0
  74. package/dist/docs/http.md +299 -0
  75. package/dist/docs/human-input-provider.md +372 -0
  76. package/dist/docs/lifecycle-hooks.md +253 -0
  77. package/dist/docs/limits.md +64 -0
  78. package/dist/docs/liquid-templates.md +490 -0
  79. package/dist/docs/loop-routing-refactor.md +89 -0
  80. package/dist/docs/mcp-provider.md +557 -0
  81. package/dist/docs/mcp.md +124 -0
  82. package/dist/docs/memory.md +903 -0
  83. package/dist/docs/observability.md +12 -0
  84. package/dist/docs/output-formats.md +20 -0
  85. package/dist/docs/output-formatting.md +29 -0
  86. package/dist/docs/output-history.md +383 -0
  87. package/dist/docs/performance.md +6 -0
  88. package/dist/docs/pluggable.md +124 -0
  89. package/dist/docs/proposals/snapshot-scope-execution.md +236 -0
  90. package/dist/docs/providers/git-checkout.md +589 -0
  91. package/dist/docs/recipes.md +474 -0
  92. package/dist/docs/rfc/git-checkout-step.md +601 -0
  93. package/dist/docs/rfc/on_init-hook.md +1294 -0
  94. package/dist/docs/rfc/workspace-isolation.md +216 -0
  95. package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
  96. package/dist/docs/router-patterns.md +339 -0
  97. package/dist/docs/schema-next-pr.md +10 -0
  98. package/dist/docs/schema-templates.md +68 -0
  99. package/dist/docs/script.md +34 -0
  100. package/dist/docs/sdk.md +222 -0
  101. package/dist/docs/security.md +7 -0
  102. package/dist/docs/suppressions.md +89 -0
  103. package/dist/docs/tag-filtering.md +258 -0
  104. package/dist/docs/telemetry-setup.md +119 -0
  105. package/dist/docs/telemetry-tracing-rfc.md +275 -0
  106. package/dist/docs/test-framework-rfc.md +680 -0
  107. package/dist/docs/testing/assertions.md +85 -0
  108. package/dist/docs/testing/ci.md +44 -0
  109. package/dist/docs/testing/cli.md +41 -0
  110. package/dist/docs/testing/cookbook.md +172 -0
  111. package/dist/docs/testing/dsl-reference.md +199 -0
  112. package/dist/docs/testing/fixtures-and-mocks.md +91 -0
  113. package/dist/docs/testing/flows.md +92 -0
  114. package/dist/docs/testing/getting-started.md +93 -0
  115. package/dist/docs/testing/troubleshooting.md +55 -0
  116. package/dist/docs/timeouts.md +50 -0
  117. package/dist/docs/troubleshooting.md +7 -0
  118. package/dist/docs/visor-sdk-rfc.md +186 -0
  119. package/dist/docs/workflows.md +569 -0
  120. package/dist/engine/on-finish/orchestrator.d.ts +19 -0
  121. package/dist/engine/on-finish/orchestrator.d.ts.map +1 -0
  122. package/dist/engine/on-finish/utils.d.ts +44 -0
  123. package/dist/engine/on-finish/utils.d.ts.map +1 -0
  124. package/dist/event-bus/event-bus.d.ts +13 -0
  125. package/dist/event-bus/event-bus.d.ts.map +1 -0
  126. package/dist/event-bus/types.d.ts +71 -0
  127. package/dist/event-bus/types.d.ts.map +1 -0
  128. package/dist/examples/.claude/agents/code-reviewer.md +69 -0
  129. package/dist/examples/.mcp.json +34 -0
  130. package/dist/examples/CALCULATOR-SDK.md +364 -0
  131. package/dist/examples/README.md +384 -0
  132. package/dist/examples/ai-custom-tools-example.yaml +206 -0
  133. package/dist/examples/ai-custom-tools-simple.yaml +76 -0
  134. package/dist/examples/ai-retry-fallback-config.yaml +180 -0
  135. package/dist/examples/ai-with-bash.yaml +126 -0
  136. package/dist/examples/ai-with-mcp.yaml +82 -0
  137. package/dist/examples/basic-human-input.yaml +15 -0
  138. package/dist/examples/bedrock-config.yaml +77 -0
  139. package/dist/examples/calculator-config.yaml +133 -0
  140. package/dist/examples/calculator-json-output-guide.md +311 -0
  141. package/dist/examples/calculator-sdk-automated.ts +340 -0
  142. package/dist/examples/calculator-sdk-example.ts +275 -0
  143. package/dist/examples/calculator-sdk-json.ts +331 -0
  144. package/dist/examples/calculator-sdk-real.ts +374 -0
  145. package/dist/examples/calculator-sdk-test.ts +148 -0
  146. package/dist/examples/claude-code-config.yaml +191 -0
  147. package/dist/examples/cron-webhook-config.yaml +215 -0
  148. package/dist/examples/custom-template.liquid +57 -0
  149. package/dist/examples/custom-tools-example.yaml +281 -0
  150. package/dist/examples/enhanced-config.yaml +165 -0
  151. package/dist/examples/environments/visor.base.yaml +92 -0
  152. package/dist/examples/environments/visor.dev.yaml +33 -0
  153. package/dist/examples/environments/visor.prod.yaml +95 -0
  154. package/dist/examples/environments/visor.staging.yaml +46 -0
  155. package/dist/examples/fact-validator.yaml +361 -0
  156. package/dist/examples/fail-if-simple.yaml +90 -0
  157. package/dist/examples/failure-conditions-advanced.yaml +136 -0
  158. package/dist/examples/failure-conditions-basic.yaml +48 -0
  159. package/dist/examples/failure-conditions-github-style.yaml +119 -0
  160. package/dist/examples/failure-conditions-migration.yaml +74 -0
  161. package/dist/examples/for-loop-example.yaml +176 -0
  162. package/dist/examples/forEach-example.yaml +120 -0
  163. package/dist/examples/git-checkout-basic.yaml +32 -0
  164. package/dist/examples/git-checkout-compare.yaml +59 -0
  165. package/dist/examples/git-checkout-cross-repo.yaml +76 -0
  166. package/dist/examples/github-workflow-with-tags.yml +163 -0
  167. package/dist/examples/http-integration-config.yaml +240 -0
  168. package/dist/examples/https-server-config.yaml +209 -0
  169. package/dist/examples/human-input-example.yaml +63 -0
  170. package/dist/examples/if-conditions.yaml +173 -0
  171. package/dist/examples/jira-simple-example.yaml +56 -0
  172. package/dist/examples/jira-single-issue-workflow.yaml +166 -0
  173. package/dist/examples/jira-workflow-mcp.yaml +182 -0
  174. package/dist/examples/mcp/analyzer.py +119 -0
  175. package/dist/examples/mcp-provider-example.yaml +301 -0
  176. package/dist/examples/memory-counter.yaml +99 -0
  177. package/dist/examples/memory-error-collection.yaml +104 -0
  178. package/dist/examples/memory-exec-js.yaml +247 -0
  179. package/dist/examples/memory-namespace-isolation.yaml +184 -0
  180. package/dist/examples/memory-retry-counter.yaml +65 -0
  181. package/dist/examples/memory-state-machine.yaml +170 -0
  182. package/dist/examples/on-init-import-demo.yaml +179 -0
  183. package/dist/examples/outputs-raw-basic.yaml +26 -0
  184. package/dist/examples/project-with-tools.yaml +174 -0
  185. package/dist/examples/prompts/architecture-analysis.liquid +116 -0
  186. package/dist/examples/prompts/security-comprehensive.liquid +107 -0
  187. package/dist/examples/quick-start-tags.yaml +53 -0
  188. package/dist/examples/reusable-tools.yaml +92 -0
  189. package/dist/examples/reusable-workflows.yaml +88 -0
  190. package/dist/examples/routing-basic.yaml +35 -0
  191. package/dist/examples/routing-dynamic-js.yaml +46 -0
  192. package/dist/examples/routing-foreach.yaml +34 -0
  193. package/dist/examples/routing-goto-event.yaml +34 -0
  194. package/dist/examples/routing-on-success.yaml +25 -0
  195. package/dist/examples/run-calculator-demo.sh +71 -0
  196. package/dist/examples/sdk-basic.mjs +10 -0
  197. package/dist/examples/sdk-cjs.cjs +10 -0
  198. package/dist/examples/sdk-comprehensive.mjs +175 -0
  199. package/dist/examples/sdk-manual-config.mjs +65 -0
  200. package/dist/examples/sdk-typescript.js +81 -0
  201. package/dist/examples/sdk-typescript.ts +92 -0
  202. package/dist/examples/session-reuse-config.yaml +151 -0
  203. package/dist/examples/session-reuse-self.yaml +81 -0
  204. package/dist/examples/slack-simple-chat.yaml +775 -0
  205. package/dist/examples/templates/security-report.liquid +137 -0
  206. package/dist/examples/tools-library.yaml +281 -0
  207. package/dist/examples/transform-example.yaml +199 -0
  208. package/dist/examples/visor-with-tags.yaml +198 -0
  209. package/dist/examples/webhook-pipeline-config.yaml +218 -0
  210. package/dist/examples/workflows/calculator-workflow.yaml +163 -0
  211. package/dist/examples/workflows/code-quality.yaml +222 -0
  212. package/dist/examples/workflows/quick-pr-check.yaml +90 -0
  213. package/dist/examples/workflows/workflow-composition-example.yaml +130 -0
  214. package/dist/failure-condition-evaluator.d.ts +3 -0
  215. package/dist/failure-condition-evaluator.d.ts.map +1 -1
  216. package/dist/frontends/github-frontend.d.ts +58 -0
  217. package/dist/frontends/github-frontend.d.ts.map +1 -0
  218. package/dist/frontends/host.d.ts +47 -0
  219. package/dist/frontends/host.d.ts.map +1 -0
  220. package/dist/frontends/ndjson-sink.d.ts +12 -0
  221. package/dist/frontends/ndjson-sink.d.ts.map +1 -0
  222. package/dist/frontends/slack-frontend.d.ts +58 -0
  223. package/dist/frontends/slack-frontend.d.ts.map +1 -0
  224. package/dist/generated/config-schema.d.ts +967 -57
  225. package/dist/generated/config-schema.d.ts.map +1 -1
  226. package/dist/generated/config-schema.json +1033 -56
  227. package/dist/github-check-service.d.ts +4 -6
  228. package/dist/github-check-service.d.ts.map +1 -1
  229. package/dist/github-comments.d.ts +2 -4
  230. package/dist/github-comments.d.ts.map +1 -1
  231. package/dist/index.d.ts.map +1 -1
  232. package/dist/index.js +134327 -99004
  233. package/dist/liquid-extensions.d.ts.map +1 -1
  234. package/dist/logger.d.ts +2 -0
  235. package/dist/logger.d.ts.map +1 -1
  236. package/dist/memory-store.d.ts +6 -0
  237. package/dist/memory-store.d.ts.map +1 -1
  238. package/dist/output/assistant-json/template.liquid +0 -0
  239. package/dist/output/traces/run-2026-01-20T19-22-58-043Z.ndjson +138 -0
  240. package/dist/output/traces/run-2026-01-20T19-23-52-175Z.ndjson +1067 -0
  241. package/dist/output-formatters.d.ts +1 -1
  242. package/dist/output-formatters.d.ts.map +1 -1
  243. package/dist/providers/ai-check-provider.d.ts +12 -0
  244. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  245. package/dist/providers/check-provider-registry.d.ts +6 -0
  246. package/dist/providers/check-provider-registry.d.ts.map +1 -1
  247. package/dist/providers/check-provider.interface.d.ts +43 -1
  248. package/dist/providers/check-provider.interface.d.ts.map +1 -1
  249. package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
  250. package/dist/providers/command-check-provider.d.ts +1 -1
  251. package/dist/providers/command-check-provider.d.ts.map +1 -1
  252. package/dist/providers/custom-tool-executor.d.ts +61 -0
  253. package/dist/providers/custom-tool-executor.d.ts.map +1 -0
  254. package/dist/providers/git-checkout-provider.d.ts +25 -0
  255. package/dist/providers/git-checkout-provider.d.ts.map +1 -0
  256. package/dist/providers/github-ops-provider.d.ts.map +1 -1
  257. package/dist/providers/http-client-provider.d.ts +4 -4
  258. package/dist/providers/http-client-provider.d.ts.map +1 -1
  259. package/dist/providers/human-input-check-provider.d.ts +5 -0
  260. package/dist/providers/human-input-check-provider.d.ts.map +1 -1
  261. package/dist/providers/index.d.ts +1 -0
  262. package/dist/providers/index.d.ts.map +1 -1
  263. package/dist/providers/log-check-provider.d.ts +2 -5
  264. package/dist/providers/log-check-provider.d.ts.map +1 -1
  265. package/dist/providers/mcp-check-provider.d.ts +10 -4
  266. package/dist/providers/mcp-check-provider.d.ts.map +1 -1
  267. package/dist/providers/mcp-custom-sse-server.d.ts +66 -0
  268. package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -0
  269. package/dist/providers/memory-check-provider.d.ts +2 -8
  270. package/dist/providers/memory-check-provider.d.ts.map +1 -1
  271. package/dist/providers/script-check-provider.d.ts +25 -0
  272. package/dist/providers/script-check-provider.d.ts.map +1 -0
  273. package/dist/providers/workflow-check-provider.d.ts +56 -0
  274. package/dist/providers/workflow-check-provider.d.ts.map +1 -0
  275. package/dist/reviewer.d.ts +2 -1
  276. package/dist/reviewer.d.ts.map +1 -1
  277. package/dist/sdk/check-provider-registry-534KL5HT.mjs +27 -0
  278. package/dist/sdk/chunk-23L3QRYX.mjs +16872 -0
  279. package/dist/sdk/chunk-23L3QRYX.mjs.map +1 -0
  280. package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-3OMWVM6J.mjs} +11 -1
  281. package/dist/sdk/chunk-3OMWVM6J.mjs.map +1 -0
  282. package/dist/sdk/chunk-7UK3NIIT.mjs +482 -0
  283. package/dist/sdk/chunk-7UK3NIIT.mjs.map +1 -0
  284. package/dist/sdk/chunk-AGIZJ4UZ.mjs +173 -0
  285. package/dist/sdk/chunk-AGIZJ4UZ.mjs.map +1 -0
  286. package/dist/sdk/chunk-AIVFBIS4.mjs +1371 -0
  287. package/dist/sdk/chunk-AIVFBIS4.mjs.map +1 -0
  288. package/dist/sdk/chunk-AK6BVWIT.mjs +426 -0
  289. package/dist/sdk/chunk-AK6BVWIT.mjs.map +1 -0
  290. package/dist/sdk/chunk-AUT26LHW.mjs +139 -0
  291. package/dist/sdk/chunk-AUT26LHW.mjs.map +1 -0
  292. package/dist/sdk/chunk-BOVFH3LI.mjs +232 -0
  293. package/dist/sdk/chunk-BOVFH3LI.mjs.map +1 -0
  294. package/dist/sdk/chunk-CNX7V5JK.mjs +89 -0
  295. package/dist/sdk/chunk-CNX7V5JK.mjs.map +1 -0
  296. package/dist/sdk/chunk-HTOKWMPO.mjs +157 -0
  297. package/dist/sdk/chunk-HTOKWMPO.mjs.map +1 -0
  298. package/dist/sdk/chunk-NAW3DB3I.mjs +197 -0
  299. package/dist/sdk/chunk-NAW3DB3I.mjs.map +1 -0
  300. package/dist/sdk/chunk-O5EZDNYL.mjs +274 -0
  301. package/dist/sdk/chunk-O5EZDNYL.mjs.map +1 -0
  302. package/dist/sdk/chunk-QR7MOMJH.mjs +558 -0
  303. package/dist/sdk/chunk-QR7MOMJH.mjs.map +1 -0
  304. package/dist/sdk/chunk-QY2XYPEV.mjs +3556 -0
  305. package/dist/sdk/chunk-QY2XYPEV.mjs.map +1 -0
  306. package/dist/sdk/chunk-S2RUE2RG.mjs +145 -0
  307. package/dist/sdk/chunk-S2RUE2RG.mjs.map +1 -0
  308. package/dist/sdk/chunk-SIWNBRTK.mjs +800 -0
  309. package/dist/sdk/chunk-SIWNBRTK.mjs.map +1 -0
  310. package/dist/sdk/chunk-YSN4G6CI.mjs +146 -0
  311. package/dist/sdk/chunk-YSN4G6CI.mjs.map +1 -0
  312. package/dist/sdk/chunk-ZYAUYXSW.mjs +206 -0
  313. package/dist/sdk/chunk-ZYAUYXSW.mjs.map +1 -0
  314. package/dist/sdk/command-executor-TYUV6HUS.mjs +14 -0
  315. package/dist/sdk/config-YNC2EOOT.mjs +16 -0
  316. package/dist/sdk/config-merger-PX3WIT57.mjs +10 -0
  317. package/dist/sdk/event-bus-5BEVPQ6T.mjs +35 -0
  318. package/dist/sdk/event-bus-5BEVPQ6T.mjs.map +1 -0
  319. package/dist/sdk/failure-condition-evaluator-YGTF2GHG.mjs +17 -0
  320. package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs +458 -0
  321. package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs.map +1 -0
  322. package/dist/sdk/github-frontend-SIAEOCON.mjs +1420 -0
  323. package/dist/sdk/github-frontend-SIAEOCON.mjs.map +1 -0
  324. package/dist/sdk/host-DXUYTNMU.mjs +52 -0
  325. package/dist/sdk/host-DXUYTNMU.mjs.map +1 -0
  326. package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-PKWCKK7E.mjs} +8 -2
  327. package/dist/sdk/memory-store-XGBB7LX7.mjs +12 -0
  328. package/dist/sdk/memory-store-XGBB7LX7.mjs.map +1 -0
  329. package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
  330. package/dist/sdk/metrics-7PP3EJUH.mjs.map +1 -0
  331. package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
  332. package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
  333. package/dist/sdk/prompt-state-YRJY6QAL.mjs +16 -0
  334. package/dist/sdk/prompt-state-YRJY6QAL.mjs.map +1 -0
  335. package/dist/sdk/renderer-schema-LPKN5UJS.mjs +51 -0
  336. package/dist/sdk/renderer-schema-LPKN5UJS.mjs.map +1 -0
  337. package/dist/sdk/routing-6N45MJ4F.mjs +24 -0
  338. package/dist/sdk/routing-6N45MJ4F.mjs.map +1 -0
  339. package/dist/sdk/sdk.d.mts +541 -22
  340. package/dist/sdk/sdk.d.ts +541 -22
  341. package/dist/sdk/sdk.js +27963 -16505
  342. package/dist/sdk/sdk.js.map +1 -1
  343. package/dist/sdk/sdk.mjs +1116 -2169
  344. package/dist/sdk/sdk.mjs.map +1 -1
  345. package/dist/sdk/session-registry-4E6YRQ77.mjs +10 -0
  346. package/dist/sdk/session-registry-4E6YRQ77.mjs.map +1 -0
  347. package/dist/sdk/slack-frontend-BVKW3GD5.mjs +735 -0
  348. package/dist/sdk/slack-frontend-BVKW3GD5.mjs.map +1 -0
  349. package/dist/sdk/trace-helpers-VP6QYVBX.mjs +23 -0
  350. package/dist/sdk/trace-helpers-VP6QYVBX.mjs.map +1 -0
  351. package/dist/sdk/{tracer-init-WC75N5NW.mjs → tracer-init-GSLPPLCD.mjs} +2 -2
  352. package/dist/sdk/tracer-init-GSLPPLCD.mjs.map +1 -0
  353. package/dist/sdk/workflow-registry-R6KSACFR.mjs +12 -0
  354. package/dist/sdk/workflow-registry-R6KSACFR.mjs.map +1 -0
  355. package/dist/sdk.d.ts.map +1 -1
  356. package/dist/slack/adapter.d.ts +36 -0
  357. package/dist/slack/adapter.d.ts.map +1 -0
  358. package/dist/slack/cache-prewarmer.d.ts +31 -0
  359. package/dist/slack/cache-prewarmer.d.ts.map +1 -0
  360. package/dist/slack/client.d.ts +77 -0
  361. package/dist/slack/client.d.ts.map +1 -0
  362. package/dist/slack/markdown.d.ts +45 -0
  363. package/dist/slack/markdown.d.ts.map +1 -0
  364. package/dist/slack/prompt-state.d.ts +33 -0
  365. package/dist/slack/prompt-state.d.ts.map +1 -0
  366. package/dist/slack/rate-limiter.d.ts +56 -0
  367. package/dist/slack/rate-limiter.d.ts.map +1 -0
  368. package/dist/slack/signature.d.ts +2 -0
  369. package/dist/slack/signature.d.ts.map +1 -0
  370. package/dist/slack/socket-runner.d.ts +42 -0
  371. package/dist/slack/socket-runner.d.ts.map +1 -0
  372. package/dist/slack/thread-cache.d.ts +51 -0
  373. package/dist/slack/thread-cache.d.ts.map +1 -0
  374. package/dist/snapshot-store.d.ts +59 -0
  375. package/dist/snapshot-store.d.ts.map +1 -0
  376. package/dist/state-machine/context/build-engine-context.d.ts +17 -0
  377. package/dist/state-machine/context/build-engine-context.d.ts.map +1 -0
  378. package/dist/state-machine/dispatch/dependency-gating.d.ts +12 -0
  379. package/dist/state-machine/dispatch/dependency-gating.d.ts.map +1 -0
  380. package/dist/state-machine/dispatch/execution-invoker.d.ts +14 -0
  381. package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -0
  382. package/dist/state-machine/dispatch/foreach-processor.d.ts +8 -0
  383. package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -0
  384. package/dist/state-machine/dispatch/history-snapshot.d.ts +8 -0
  385. package/dist/state-machine/dispatch/history-snapshot.d.ts.map +1 -0
  386. package/dist/state-machine/dispatch/on-init-handlers.d.ts +43 -0
  387. package/dist/state-machine/dispatch/on-init-handlers.d.ts.map +1 -0
  388. package/dist/state-machine/dispatch/renderer-schema.d.ts +8 -0
  389. package/dist/state-machine/dispatch/renderer-schema.d.ts.map +1 -0
  390. package/dist/state-machine/dispatch/stats-manager.d.ts +15 -0
  391. package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -0
  392. package/dist/state-machine/dispatch/template-renderer.d.ts +7 -0
  393. package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -0
  394. package/dist/state-machine/execution/summary.d.ts +8 -0
  395. package/dist/state-machine/execution/summary.d.ts.map +1 -0
  396. package/dist/state-machine/runner.d.ts +79 -0
  397. package/dist/state-machine/runner.d.ts.map +1 -0
  398. package/dist/state-machine/states/check-running.d.ts +14 -0
  399. package/dist/state-machine/states/check-running.d.ts.map +1 -0
  400. package/dist/state-machine/states/completed.d.ts +12 -0
  401. package/dist/state-machine/states/completed.d.ts.map +1 -0
  402. package/dist/state-machine/states/error.d.ts +11 -0
  403. package/dist/state-machine/states/error.d.ts.map +1 -0
  404. package/dist/state-machine/states/init.d.ts +11 -0
  405. package/dist/state-machine/states/init.d.ts.map +1 -0
  406. package/dist/state-machine/states/level-dispatch.d.ts +17 -0
  407. package/dist/state-machine/states/level-dispatch.d.ts.map +1 -0
  408. package/dist/state-machine/states/plan-ready.d.ts +12 -0
  409. package/dist/state-machine/states/plan-ready.d.ts.map +1 -0
  410. package/dist/state-machine/states/routing.d.ts +52 -0
  411. package/dist/state-machine/states/routing.d.ts.map +1 -0
  412. package/dist/state-machine/states/wave-planning.d.ts +14 -0
  413. package/dist/state-machine/states/wave-planning.d.ts.map +1 -0
  414. package/dist/state-machine/workflow-projection.d.ts +47 -0
  415. package/dist/state-machine/workflow-projection.d.ts.map +1 -0
  416. package/dist/state-machine-execution-engine.d.ts +159 -0
  417. package/dist/state-machine-execution-engine.d.ts.map +1 -0
  418. package/dist/telemetry/opentelemetry.d.ts.map +1 -1
  419. package/dist/telemetry/state-capture.d.ts +5 -0
  420. package/dist/telemetry/state-capture.d.ts.map +1 -1
  421. package/dist/test-runner/assertions.d.ts +59 -0
  422. package/dist/test-runner/assertions.d.ts.map +1 -0
  423. package/dist/test-runner/core/environment.d.ts +8 -0
  424. package/dist/test-runner/core/environment.d.ts.map +1 -0
  425. package/dist/test-runner/core/fixture.d.ts +3 -0
  426. package/dist/test-runner/core/fixture.d.ts.map +1 -0
  427. package/dist/test-runner/core/flow-stage.d.ts +32 -0
  428. package/dist/test-runner/core/flow-stage.d.ts.map +1 -0
  429. package/dist/test-runner/core/mocks.d.ts +8 -0
  430. package/dist/test-runner/core/mocks.d.ts.map +1 -0
  431. package/dist/test-runner/core/test-execution-wrapper.d.ts +18 -0
  432. package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -0
  433. package/dist/test-runner/evaluators.d.ts +45 -0
  434. package/dist/test-runner/evaluators.d.ts.map +1 -0
  435. package/dist/test-runner/fixture-loader.d.ts +30 -0
  436. package/dist/test-runner/fixture-loader.d.ts.map +1 -0
  437. package/dist/test-runner/index.d.ts +127 -0
  438. package/dist/test-runner/index.d.ts.map +1 -0
  439. package/dist/test-runner/recorders/github-recorder.d.ts +23 -0
  440. package/dist/test-runner/recorders/github-recorder.d.ts.map +1 -0
  441. package/dist/test-runner/recorders/global-recorder.d.ts +4 -0
  442. package/dist/test-runner/recorders/global-recorder.d.ts.map +1 -0
  443. package/dist/test-runner/recorders/slack-recorder.d.ts +17 -0
  444. package/dist/test-runner/recorders/slack-recorder.d.ts.map +1 -0
  445. package/dist/test-runner/utils/selectors.d.ts +2 -0
  446. package/dist/test-runner/utils/selectors.d.ts.map +1 -0
  447. package/dist/test-runner/validator.d.ts +8 -0
  448. package/dist/test-runner/validator.d.ts.map +1 -0
  449. package/dist/traces/run-2026-01-20T19-22-58-043Z.ndjson +138 -0
  450. package/dist/traces/run-2026-01-20T19-23-52-175Z.ndjson +1067 -0
  451. package/dist/types/bot.d.ts +109 -0
  452. package/dist/types/bot.d.ts.map +1 -0
  453. package/dist/types/cli.d.ts +8 -1
  454. package/dist/types/cli.d.ts.map +1 -1
  455. package/dist/types/config.d.ts +459 -9
  456. package/dist/types/config.d.ts.map +1 -1
  457. package/dist/types/engine.d.ts +177 -0
  458. package/dist/types/engine.d.ts.map +1 -0
  459. package/dist/types/execution.d.ts +73 -0
  460. package/dist/types/execution.d.ts.map +1 -0
  461. package/dist/types/git-checkout.d.ts +76 -0
  462. package/dist/types/git-checkout.d.ts.map +1 -0
  463. package/dist/types/github.d.ts +51 -0
  464. package/dist/types/github.d.ts.map +1 -0
  465. package/dist/types/workflow.d.ts +237 -0
  466. package/dist/types/workflow.d.ts.map +1 -0
  467. package/dist/utils/command-executor.d.ts +43 -0
  468. package/dist/utils/command-executor.d.ts.map +1 -0
  469. package/dist/utils/comment-metadata.d.ts +21 -0
  470. package/dist/utils/comment-metadata.d.ts.map +1 -0
  471. package/dist/utils/config-loader.d.ts.map +1 -1
  472. package/dist/utils/config-merger.d.ts.map +1 -1
  473. package/dist/utils/env-exposure.d.ts +3 -0
  474. package/dist/utils/env-exposure.d.ts.map +1 -0
  475. package/dist/utils/file-exclusion.d.ts.map +1 -1
  476. package/dist/utils/interactive-prompt.d.ts +1 -1
  477. package/dist/utils/interactive-prompt.d.ts.map +1 -1
  478. package/dist/utils/json-text-extractor.d.ts +17 -0
  479. package/dist/utils/json-text-extractor.d.ts.map +1 -0
  480. package/dist/utils/sandbox.d.ts +10 -0
  481. package/dist/utils/sandbox.d.ts.map +1 -1
  482. package/dist/utils/script-memory-ops.d.ts +21 -0
  483. package/dist/utils/script-memory-ops.d.ts.map +1 -0
  484. package/dist/utils/template-context.d.ts +8 -0
  485. package/dist/utils/template-context.d.ts.map +1 -0
  486. package/dist/utils/tracer-init.d.ts.map +1 -1
  487. package/dist/utils/workspace-manager.d.ts +118 -0
  488. package/dist/utils/workspace-manager.d.ts.map +1 -0
  489. package/dist/utils/worktree-cleanup.d.ts +33 -0
  490. package/dist/utils/worktree-cleanup.d.ts.map +1 -0
  491. package/dist/utils/worktree-manager.d.ts +153 -0
  492. package/dist/utils/worktree-manager.d.ts.map +1 -0
  493. package/dist/webhook-server.d.ts +3 -3
  494. package/dist/webhook-server.d.ts.map +1 -1
  495. package/dist/workflow-executor.d.ts +81 -0
  496. package/dist/workflow-executor.d.ts.map +1 -0
  497. package/dist/workflow-registry.d.ts +79 -0
  498. package/dist/workflow-registry.d.ts.map +1 -0
  499. package/package.json +12 -5
  500. package/dist/output/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
  501. package/dist/sdk/check-execution-engine-2YYKUUSH.mjs +0 -11
  502. package/dist/sdk/check-execution-engine-6QJXYYON.mjs +0 -11
  503. package/dist/sdk/check-execution-engine-PJZ4ZOKG.mjs +0 -11
  504. package/dist/sdk/chunk-33QVZ2D4.mjs +0 -316
  505. package/dist/sdk/chunk-33QVZ2D4.mjs.map +0 -1
  506. package/dist/sdk/chunk-B5QBV2QJ.mjs +0 -752
  507. package/dist/sdk/chunk-B5QBV2QJ.mjs.map +0 -1
  508. package/dist/sdk/chunk-BVFNRCHT.mjs +0 -14129
  509. package/dist/sdk/chunk-BVFNRCHT.mjs.map +0 -1
  510. package/dist/sdk/chunk-KWZW23FG.mjs +0 -14129
  511. package/dist/sdk/chunk-KWZW23FG.mjs.map +0 -1
  512. package/dist/sdk/chunk-O4RP4BRH.mjs +0 -14092
  513. package/dist/sdk/chunk-O4RP4BRH.mjs.map +0 -1
  514. package/dist/sdk/chunk-TUTOLSFV.mjs.map +0 -1
  515. package/dist/sdk/chunk-U5D2LY66.mjs +0 -245
  516. package/dist/sdk/chunk-U5D2LY66.mjs.map +0 -1
  517. package/dist/sdk/chunk-U7X54EMV.mjs +0 -331
  518. package/dist/sdk/chunk-U7X54EMV.mjs.map +0 -1
  519. package/dist/sdk/config-merger-TWUBWFC2.mjs +0 -8
  520. package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs +0 -61
  521. package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs.map +0 -1
  522. package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs +0 -61
  523. package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs.map +0 -1
  524. package/dist/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
  525. /package/dist/sdk/{check-execution-engine-2YYKUUSH.mjs.map → check-provider-registry-534KL5HT.mjs.map} +0 -0
  526. /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → command-executor-TYUV6HUS.mjs.map} +0 -0
  527. /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → config-YNC2EOOT.mjs.map} +0 -0
  528. /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
  529. /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → failure-condition-evaluator-YGTF2GHG.mjs.map} +0 -0
  530. /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → liquid-extensions-PKWCKK7E.mjs.map} +0 -0
@@ -0,0 +1,85 @@
1
+ # Writing Assertions
2
+
3
+ Assertions live under `expect:` and cover three surfaces:
4
+
5
+ - `calls`: step counts and provider effects (GitHub ops)
6
+ - `prompts`: final AI prompts (post templating/context)
7
+ - `outputs`: step outputs with history and selectors
8
+
9
+ ## Calls
10
+
11
+ ```yaml
12
+ expect:
13
+ calls:
14
+ - step: overview
15
+ exactly: 1
16
+ - provider: github
17
+ op: labels.add
18
+ at_least: 1
19
+ args:
20
+ contains: [feature, "review/effort:2"]
21
+ ```
22
+
23
+ Counts are consistent everywhere: `exactly`, `at_least`, `at_most`.
24
+
25
+ ## Prompts
26
+
27
+ ```yaml
28
+ expect:
29
+ prompts:
30
+ - step: overview
31
+ contains: ["feat: add user search", "diff --git a/src/search.ts"]
32
+ - step: comment-assistant
33
+ matches: "(?i)\\/visor\\s+help"
34
+ - step: overview
35
+ # Select the prompt that mentions a specific file
36
+ where:
37
+ contains: ["src/search.ts"]
38
+ contains: ["diff --git a/src/search.ts"]
39
+ ```
40
+
41
+ - `contains`: required substrings
42
+ - `not_contains`: forbidden substrings
43
+ - `matches`: regex (prefix `(?i)` for case-insensitive)
44
+ - `index`: `first` | `last` | N (default: last)
45
+ - `where`: selector to choose a prompt from history using `contains`/`not_contains`/`matches` before applying the assertion
46
+
47
+ Tip: enable `--prompt-max-chars` or `tests.defaults.prompt_max_chars` to cap stored prompt size for large diffs.
48
+
49
+ ## Outputs
50
+
51
+ Use `path` with dot/bracket syntax. You can select by index or by a `where` probe over the same output history.
52
+
53
+ ```yaml
54
+ expect:
55
+ outputs:
56
+ - step: validate-fact
57
+ index: 0
58
+ path: fact_id
59
+ equals: f1
60
+ - step: validate-fact
61
+ where: { path: fact_id, equals: f2 }
62
+ path: confidence
63
+ equals: high
64
+ - step: aggregate-validations
65
+ path: all_valid
66
+ equals: true
67
+ ```
68
+
69
+ Supported comparators:
70
+ - `equals` (primitive)
71
+ - `equalsDeep` (structural)
72
+ - `matches` (regex)
73
+ - `contains_unordered` (array membership ignoring order)
74
+
75
+ ## Strict mode and “no calls”
76
+
77
+ Strict mode (default) fails any executed step without a corresponding `expect.calls` entry. You can also assert absence explicitly:
78
+
79
+ ```yaml
80
+ expect:
81
+ no_calls:
82
+ - provider: github
83
+ op: issues.createComment
84
+ - step: extract-facts
85
+ ```
@@ -0,0 +1,44 @@
1
+ # CI Integration for Tests
2
+
3
+ Run your in‑YAML integration tests in CI using the Visor CLI. Below is a GitHub Actions example. Adapt for other CIs similarly.
4
+
5
+ ```yaml
6
+ name: Visor Tests
7
+ on: [pull_request]
8
+
9
+ jobs:
10
+ tests:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: actions/setup-node@v4
15
+ with: { node-version: '20' }
16
+ - run: npm ci
17
+ - run: npm run build --ignore-scripts
18
+
19
+ - name: Run integration tests (defaults)
20
+ run: |
21
+ mkdir -p output
22
+ node ./dist/index.js test \
23
+ --config defaults/.visor.tests.yaml \
24
+ --json output/visor-tests.json \
25
+ --report junit:output/visor-tests.xml \
26
+ --summary md:output/visor-tests.md
27
+
28
+ - name: Upload test artifacts
29
+ if: always()
30
+ uses: actions/upload-artifact@v4
31
+ with:
32
+ name: visor-test-results
33
+ path: |
34
+ output/visor-tests.json
35
+ output/visor-tests.xml
36
+ output/visor-tests.md
37
+ ```
38
+
39
+ Tips
40
+ - Keep `ai_provider: mock` in `tests.defaults` for fast, deterministic runs.
41
+ - Set `--max-parallel` to speed up large suites (flows still run sequentially per case).
42
+ - Use `--bail` for faster feedback on PRs; run full suite on main.
43
+ - Collect artifacts so you can inspect failures without re-running.
44
+
@@ -0,0 +1,41 @@
1
+ # Visor Test CLI
2
+
3
+ Run integration tests for your Visor config using the built-in `test` subcommand.
4
+
5
+ ## Commands
6
+
7
+ - Discover tests file and list cases
8
+ - `visor test --list [--config defaults/.visor.tests.yaml]`
9
+ - Run cases
10
+ - `visor test [--config defaults/.visor.tests.yaml] [--only <substring>] [--bail]`
11
+ - Validate tests YAML without running
12
+ - `visor test --validate [--config defaults/.visor.tests.yaml]`
13
+
14
+ ## Flags
15
+
16
+ - `--config <path>`: Path to `.visor.tests.yaml` (auto-discovers `.visor.tests.yaml` or `defaults/.visor.tests.yaml`).
17
+ - `--only <filter>`: Run cases whose `name` contains the substring (case-insensitive).
18
+ - `--only <filter>`: Run cases whose `name` contains the substring (case-insensitive).
19
+ - Stage filter: append `#<stage>` to run only a flow stage.
20
+ - Examples: `--only pr-review-e2e-flow#facts-invalid`, `--only pr-review-e2e-flow#3` (1‑based index)
21
+ - `--bail`: Stop on first failure.
22
+ - `--json <path|->`: Write a minimal JSON summary.
23
+ - `--report junit:<path>`: Write a minimal JUnit XML.
24
+ - `--summary md:<path>`: Write a minimal Markdown summary.
25
+ - `--progress compact|detailed`: Progress verbosity (parsing supported; detailed view evolves over time).
26
+ - `--max-parallel <N>`: Run up to N cases concurrently.
27
+ - `--prompt-max-chars <N>`: Truncate captured prompt text to N characters.
28
+
29
+ ## Output
30
+
31
+ - Per-case PASS/FAIL lines
32
+ - Coverage table (expected vs actual step runs)
33
+ - Summary totals
34
+
35
+ ## Tips
36
+
37
+ - Use `--validate` when iterating on tests to catch typos early.
38
+ - Keep `strict: true` in `tests.defaults` to surface missing `expect` quickly.
39
+ - For large suites, increase `--max-parallel` to improve throughput.
40
+ - Enable debug logs by setting `VISOR_DEBUG=true`.
41
+ - Example: `VISOR_DEBUG=true visor test --config defaults/.visor.tests.yaml --only pr-review-e2e-flow#facts-invalid`
@@ -0,0 +1,172 @@
1
+ # Test Cookbook
2
+
3
+ Copy‑pasteable recipes for common scenarios.
4
+
5
+ ## 1) Label PR on open
6
+
7
+ ```yaml
8
+ - name: label-flow
9
+ event: pr_opened
10
+ fixture: gh.pr_open.minimal
11
+ mocks:
12
+ overview:
13
+ text: "Overview body"
14
+ tags: { label: feature, review-effort: 2 }
15
+ expect:
16
+ calls:
17
+ - step: overview
18
+ exactly: 1
19
+ - step: apply-overview-labels
20
+ exactly: 1
21
+ - provider: github
22
+ op: labels.add
23
+ at_least: 1
24
+ args: { contains: [feature, "review/effort:2"] }
25
+ ```
26
+
27
+ ## 2) Ignore normal comment
28
+
29
+ ```yaml
30
+ - name: standard-comment
31
+ event: issue_comment
32
+ fixture: gh.issue_comment.standard
33
+ mocks:
34
+ comment-assistant: { text: "", intent: comment_reply } # empty text → no reply
35
+ expect:
36
+ no_calls:
37
+ - provider: github
38
+ op: issues.createComment
39
+ calls:
40
+ - step: comment-assistant
41
+ exactly: 1
42
+ ```
43
+
44
+ ## 3) `/visor help` reply and prompt check
45
+
46
+ ```yaml
47
+ - name: visor-plain
48
+ event: issue_comment
49
+ fixture: gh.issue_comment.visor_help
50
+ mocks:
51
+ comment-assistant: { text: "Sure, here’s how I can help.", intent: comment_reply }
52
+ expect:
53
+ calls:
54
+ - step: comment-assistant
55
+ exactly: 1
56
+ - provider: github
57
+ op: issues.createComment
58
+ exactly: 1
59
+ prompts:
60
+ - step: comment-assistant
61
+ matches: "(?i)\\/visor\\s+help"
62
+ ```
63
+
64
+ ## 4) Regenerate reviews on command
65
+
66
+ ```yaml
67
+ - name: visor-retrigger
68
+ event: issue_comment
69
+ fixture: gh.issue_comment.visor_regenerate
70
+ mocks:
71
+ comment-assistant: { text: "Regenerating.", intent: comment_retrigger }
72
+ overview: { text: "Overview (regenerated)", tags: { label: feature, review-effort: 2 } }
73
+ expect:
74
+ calls:
75
+ - step: comment-assistant
76
+ exactly: 1
77
+ - step: overview
78
+ exactly: 1
79
+ ```
80
+
81
+ ## 5) Facts enabled (one fact)
82
+
83
+ ```yaml
84
+ - name: facts-enabled
85
+ event: issue_comment
86
+ fixture: gh.issue_comment.visor_help
87
+ env: { ENABLE_FACT_VALIDATION: "true" }
88
+ mocks:
89
+ comment-assistant: { text: "We rely on defaults/.visor.yaml line 11 for max_parallelism=4.", intent: comment_reply }
90
+ extract-facts:
91
+ - { id: f1, category: Configuration, claim: "max_parallelism defaults to 4", verifiable: true }
92
+ validate-fact[]:
93
+ - { fact_id: f1, is_valid: true, confidence: high, evidence: "defaults/.visor.yaml:11" }
94
+ expect:
95
+ calls:
96
+ - step: extract-facts
97
+ exactly: 1
98
+ - step: validate-fact
99
+ at_least: 1
100
+ - step: aggregate-validations
101
+ exactly: 1
102
+ ```
103
+
104
+ ## 6) Facts invalid (correction reply)
105
+
106
+ ```yaml
107
+ - name: facts-invalid
108
+ event: issue_comment
109
+ fixture: gh.issue_comment.visor_help
110
+ env: { ENABLE_FACT_VALIDATION: "true" }
111
+ mocks:
112
+ comment-assistant: { text: "We rely on defaults/.visor.yaml line 11 for max_parallelism=4.", intent: comment_reply }
113
+ extract-facts:
114
+ - { id: f1, category: Configuration, claim: "max_parallelism defaults to 4", verifiable: true }
115
+ validate-fact[]:
116
+ - { fact_id: f1, is_valid: false, confidence: high, evidence: "defaults/.visor.yaml:11", correction: "max_parallelism defaults to 3" }
117
+ expect:
118
+ calls:
119
+ - step: comment-assistant
120
+ exactly: 2
121
+ - step: aggregate-validations
122
+ exactly: 1
123
+ prompts:
124
+ - step: comment-assistant
125
+ index: last
126
+ contains: ["<previous_response>", "Correction: max_parallelism defaults to 3"]
127
+ ```
128
+
129
+ ## 7) Two facts (one invalid)
130
+
131
+ ```yaml
132
+ - name: facts-two-items
133
+ event: issue_comment
134
+ fixture: gh.issue_comment.visor_help
135
+ env: { ENABLE_FACT_VALIDATION: "true" }
136
+ mocks:
137
+ comment-assistant: { text: "We rely on defaults/.visor.yaml for concurrency defaults.", intent: comment_reply }
138
+ extract-facts:
139
+ - { id: f1, category: Configuration, claim: "max_parallelism defaults to 4", verifiable: true }
140
+ - { id: f2, category: Feature, claim: "Fast mode is enabled by default", verifiable: true }
141
+ validate-fact[]:
142
+ - { fact_id: f1, is_valid: false, confidence: high, evidence: "defaults/.visor.yaml:11", correction: "max_parallelism defaults to 3" }
143
+ - { fact_id: f2, is_valid: true, confidence: high, evidence: "src/config.ts:FAST_MODE=true" }
144
+ expect:
145
+ calls:
146
+ - step: validate-fact
147
+ exactly: 2
148
+ prompts:
149
+ - step: comment-assistant
150
+ index: last
151
+ contains: ["max_parallelism defaults to 4", "Correction: max_parallelism defaults to 3"]
152
+ not_contains: ["Fast mode is enabled by default"]
153
+ ```
154
+
155
+ ## 8) GitHub negative mode
156
+
157
+ ```yaml
158
+ - name: github-negative-mode
159
+ event: pr_opened
160
+ fixture: gh.pr_open.minimal
161
+ github_recorder: { error_code: 429 }
162
+ mocks: { overview: { text: "Overview body", tags: { label: feature, review-effort: 2 } } }
163
+ expect:
164
+ calls:
165
+ - step: overview
166
+ exactly: 1
167
+ - step: apply-overview-labels
168
+ exactly: 1
169
+ fail:
170
+ message_contains: "github/op_failed"
171
+ ```
172
+
@@ -0,0 +1,199 @@
1
+ # Test DSL Reference
2
+
3
+ This page documents the `.visor.tests.yaml` schema used by the Visor test runner.
4
+
5
+ ```yaml
6
+ version: "1.0"
7
+ extends: ".visor.yaml" # required; base config to run under tests
8
+
9
+ tests:
10
+ defaults:
11
+ strict: true # default strict mode
12
+ ai_provider: mock # force AI provider to mock
13
+ prompt_max_chars: 16000 # truncate captured prompts (optional)
14
+ github_recorder: # optional negative modes
15
+ error_code: 0 # e.g., 429
16
+ timeout_ms: 0 # e.g., 1000
17
+ # Optional: include/exclude checks by tags (same semantics as main CLI)
18
+ tags: "local,fast" # or [local, fast]
19
+ exclude_tags: "experimental,slow" # or [experimental, slow]
20
+
21
+ fixtures: [] # (optional) suite-level custom fixtures
22
+
23
+ cases:
24
+ - name: <string>
25
+ description: <markdown>
26
+ skip: false|true
27
+
28
+ # Single-event case
29
+ event: pr_opened | pr_updated | pr_closed | issue_opened | issue_comment | manual
30
+ fixture: <builtin|{ builtin, overrides }>
31
+ env: { <KEY>: <VALUE>, ... }
32
+ mocks: { <step>: <value>, <step>[]: [<value>...] }
33
+ expect: <expect-block>
34
+ strict: true|false # overrides defaults.strict
35
+ tags: "security,fast" # optional per-case include filter
36
+ exclude_tags: "slow" # optional per-case exclude filter
37
+
38
+ # OR flow case
39
+ flow:
40
+ - name: <string>
41
+ event: ... # per-stage event and fixture
42
+ fixture: ...
43
+ env: ...
44
+ mocks: ... # merged with flow-level mocks
45
+ expect: <expect-block>
46
+ strict: true|false # per-stage fallback to case/defaults
47
+ tags: "security" # optional per-stage include filter
48
+ exclude_tags: "slow" # optional per-stage exclude filter
49
+ ```
50
+
51
+ ## Fixtures
52
+
53
+ - Built-in GitHub fixtures: `gh.pr_open.minimal`, `gh.pr_sync.minimal`, `gh.issue_open.minimal`, `gh.issue_comment.standard`, `gh.issue_comment.visor_help`, `gh.issue_comment.visor_regenerate`.
54
+ - Use `overrides` to tweak titles, numbers, payload slices.
55
+
56
+ ## Mocks
57
+
58
+ - Keys are step names; for forEach children use `step[]` (e.g., `validate-fact[]`).
59
+ - AI mocks may be structured JSON if a schema is configured for the step; otherwise use `text` and optional fields used by templates.
60
+ - Command/HTTP mocks emulate provider shape (`stdout`, `exit_code`, or HTTP body/status headers) and bypass real execution.
61
+
62
+ Inline example (AI with schema + list mocks):
63
+
64
+ ```yaml
65
+ mocks:
66
+ overview:
67
+ text: "Overview body"
68
+ tags: { label: feature, review-effort: 2 }
69
+ extract-facts:
70
+ - { id: f1, claim: "max_parallelism defaults to 4" }
71
+ - { id: f2, claim: "Fast mode is enabled by default" }
72
+ validate-fact[]:
73
+ - { fact_id: f1, is_valid: false, correction: "max_parallelism defaults to 3" }
74
+ - { fact_id: f2, is_valid: true }
75
+ ```
76
+
77
+ ## Expect block
78
+
79
+ ```yaml
80
+ expect:
81
+ calls:
82
+ - step: <name> | provider: github + op: <rest.op>
83
+ exactly|at_least|at_most: <number>
84
+ args: { contains: [..], not_contains: [..] } # provider args matching
85
+
86
+ no_calls:
87
+ - step: <name> | provider: github + op: <rest.op>
88
+
89
+ prompts:
90
+ - step: <name>
91
+ index: first|last|<N> # default: last
92
+ where: # select a prompt from history, then assert
93
+ contains: [..] | not_contains: [..] | matches: <regex>
94
+ contains: [..]
95
+ not_contains: [..]
96
+ matches: <regex>
97
+
98
+ outputs:
99
+ - step: <name>
100
+ index: first|last|<N> # or
101
+ where: { path: <expr>, equals|matches: <v> }
102
+ path: <expr> # dot/bracket, e.g. tags['review-effort']
103
+ equals: <primitive>
104
+ equalsDeep: <object>
105
+ matches: <regex>
106
+ contains_unordered: [..]
107
+
108
+ fail:
109
+ message_contains: <string> # assert overall case failure message
110
+
111
+ strict_violation: # assert strict failure for a missing expect on a step
112
+ for_step: <name>
113
+ message_contains: <string>
114
+
115
+ Inline example (calls + prompts + outputs):
116
+
117
+ ```yaml
118
+ expect:
119
+ calls:
120
+ - step: overview
121
+ exactly: 1
122
+ - provider: github
123
+ op: labels.add
124
+ at_least: 1
125
+ args: { contains: [feature] }
126
+ prompts:
127
+ - step: overview
128
+ contains: ["feat:", "diff --git a/"]
129
+ outputs:
130
+ - step: overview
131
+ path: "tags['review-effort']"
132
+ equals: 2
133
+ ```
134
+ ```
135
+
136
+ Note on dependencies: test execution honors your base config routing, including `depends_on`. You can express ANY‑OF groups using pipe syntax in the base config (e.g., `depends_on: ["issue-assistant|comment-assistant"]`). The runner mixes these with normal ALL‑OF deps.
137
+
138
+ ## Strict mode semantics
139
+
140
+ - When `strict: true` (default), any executed step must appear in `expect.calls` with a matching count; otherwise the case/stage fails.
141
+ - Use `no_calls` for explicit absence checks.
142
+
143
+ ## Selectors and paths
144
+
145
+ - `index`: `first`, `last`, or 0‑based integer.
146
+ - `where`: evaluates against the same prompt/output history and selects a single item by content.
147
+ - `path`: dot/bracket (supports quoted keys: `tags['review-effort']`).
148
+
149
+ ## CLI shortcuts
150
+
151
+ - Validate only: `visor test --validate --config <path>`
152
+ - Run one case: `visor test --only label-flow`
153
+ - Run one stage: `visor test --only pr-review-e2e-flow#facts-invalid`
154
+ - JSON/JUnit/Markdown reporters: `--json`, `--report junit:<path>`, `--summary md:<path>`
155
+ ## JavaScript in Tests and Routing (run_js, goto_js, value_js, transform_js)
156
+
157
+ ### Tags default semantics in tests
158
+
159
+ - The test runner passes tags to the engine using the same rules as the main CLI.
160
+ - If no tags/exclude_tags are specified anywhere (suite defaults, case, or stage), only untagged checks run by default; tagged checks are skipped. This keeps tests deterministic and fast unless you explicitly opt into groups (for example, `github`).
161
+ - To run GitHub‑tagged checks in tests, add:
162
+
163
+ ```yaml
164
+ tests:
165
+ defaults:
166
+ tags: "github"
167
+ ```
168
+
169
+ Visor evaluates your `run_js`, `goto_js`, `value_js` and `transform_js` snippets inside a hardened JavaScript sandbox. The goal is to provide a great developer experience with modern JS, while keeping the engine safe and deterministic.
170
+
171
+ What you can use by default (Node 24, ES2023)
172
+ - Language features: `const/let`, arrow functions, template strings, destructuring, spread, async/await, `Array.prototype.at`, `findLast`/`findLastIndex`.
173
+ - Arrays: iteration helpers (`map`, `filter`, `some`, `every`, `reduce`, `keys/values/entries`, `forEach`), non‑mutating helpers (`toReversed`, `toSorted`, `toSpliced`, `with`), and `flat/flatMap`.
174
+ - Strings: `replaceAll`, `matchAll`, `trimStart/End`, `at`, `repeat`, `normalize`.
175
+ - Maps/Sets: `get/set/has/delete/keys/values/entries/forEach`.
176
+ - Date/RegExp: `toISOString`, `getTime`, `test`, `exec`.
177
+
178
+ What remains intentionally restricted
179
+ - Prototype mutation and reflective escape hatches (e.g., `Object.defineProperty`, `__proto__`, `setPrototypeOf`) are not exposed to sandboxed code.
180
+ - `if:` and `fail_if:` conditions are parsed by a small expression DSL (not full JS). Keep them simple (no optional chaining or nullish coalescing in those), or move complex logic to `run_js`/`goto_js`.
181
+
182
+ Tips
183
+ - Prefer non‑mutating array helpers (`toReversed`, `toSorted`, `with`) when deriving new arrays for clarity and correctness.
184
+ - Use `Array.prototype.at(-1)` to read the last item. Example: `const last = (outputs_history['validate-fact'] || []).at(-1) || [];`.
185
+ - For reshaping small maps, `Object.entries` + `Object.fromEntries` is concise and readable.
186
+
187
+ Example: wave‑scoped correction gate
188
+ ```
189
+ run_js: |
190
+ const facts = (outputs_history['extract-facts'] || []).at(-1) || [];
191
+ const ids = facts.map(f => String(f.id || '')).filter(Boolean);
192
+ const vf = outputs_history['validate-fact'] || [];
193
+ const lastItems = vf.filter(v => ids.includes(String((v && v.fact_id) || '')));
194
+ const hasProblems = lastItems.some(v => v.is_valid !== true || v.confidence !== 'high');
195
+ if (!hasProblems) return [];
196
+ return (event && event.name) === 'issue_opened' ? ['issue-assistant'] : ['comment-assistant'];
197
+ ```
198
+
199
+ This evaluates the last `extract-facts` wave, finds the corresponding `validate-fact` results, and schedules a single correction pass when any item is invalid or low‑confidence.
@@ -0,0 +1,91 @@
1
+ # Fixtures and Mocks
2
+
3
+ Integration tests simulate outside world inputs and provider outputs.
4
+
5
+ ## Built-in GitHub fixtures (gh.*)
6
+
7
+ Use via `fixture: gh.<name>` or `fixture: { builtin: gh.<name>, overrides: {...} }`.
8
+
9
+ - `gh.pr_open.minimal` — pull_request opened with a tiny diff and `src/search.ts` file.
10
+ - `gh.pr_sync.minimal` — pull_request synchronize with a small follow-up diff.
11
+ - `gh.pr_closed.minimal` — pull_request closed event.
12
+ - `gh.issue_open.minimal` — issues opened (short title/body).
13
+ - `gh.issue_comment.standard` — normal human comment on a PR/issue.
14
+ - `gh.issue_comment.visor_help` — comment containing `/visor help`.
15
+ - `gh.issue_comment.visor_regenerate` — `/visor Regenerate reviews`.
16
+
17
+ Overrides allow tailored inputs:
18
+
19
+ ```yaml
20
+ fixture:
21
+ builtin: gh.pr_open.minimal
22
+ overrides:
23
+ pr.title: "feat: custom title"
24
+ webhook.payload.pull_request.number: 42
25
+ ```
26
+
27
+ ## GitHub recorder
28
+
29
+ The test runner injects a recording Octokit by default:
30
+
31
+ - Captures every GitHub op+args for assertions (`expect.calls` with `provider: github`).
32
+ - Returns stable stub shapes so flows can continue without network.
33
+ - Negative modes are available globally via `tests.defaults.github_recorder`:
34
+
35
+ ```yaml
36
+ tests:
37
+ defaults:
38
+ github_recorder:
39
+ error_code: 429 # simulate API error
40
+ timeout_ms: 1000 # simulate request timeout
41
+ ```
42
+
43
+ ## Mocks
44
+
45
+ Mocks are keyed by step name under `mocks`.
46
+
47
+ Note: step names in examples (e.g., `extract-facts`, `validate-fact`) are not built‑ins — they are ordinary user‑defined checks in your `.visor.yaml`.
48
+
49
+ Examples:
50
+
51
+ ```yaml
52
+ mocks:
53
+ # AI with structured schema
54
+ overview:
55
+ text: "High-level PR summary."
56
+ tags: { label: feature, review-effort: 2 }
57
+
58
+ # AI plain text schema
59
+ comment-assistant:
60
+ text: "Sure, here’s how I can help."
61
+ intent: comment_reply
62
+
63
+ # Array outputs (e.g., extract-facts)
64
+ extract-facts:
65
+ - { id: f1, category: Configuration, claim: "max_parallelism defaults to 4", verifiable: true }
66
+
67
+ # Command provider
68
+ unit-tests:
69
+ stdout: '{"passed": 128, "failed": 0}'
70
+ exit_code: 0
71
+
72
+ ### Per‑call list mocks (for forEach children)
73
+
74
+ When a step runs once per item (e.g., `validate-fact` depends on `extract-facts`), provide a list under the `[]` suffix:
75
+
76
+ ```yaml
77
+ mocks:
78
+ extract-facts:
79
+ - { id: f1, category: Configuration, claim: "max_parallelism defaults to 4", verifiable: true }
80
+ - { id: f2, category: Feature, claim: "Fast mode is enabled by default", verifiable: true }
81
+ validate-fact[]:
82
+ - { fact_id: f1, is_valid: false, confidence: high, evidence: "defaults/.visor.yaml:11", correction: "max_parallelism defaults to 3" }
83
+ - { fact_id: f2, is_valid: true, confidence: high, evidence: "src/config.ts:FAST_MODE=true" }
84
+ ```
85
+
86
+ The runner distributes items in order; if the list is shorter than invocations, the last entry is reused. This fits any forEach‑style step you define (naming is up to you).
87
+ ```
88
+
89
+ Notes:
90
+ - No `returns:` key; provide values directly.
91
+ - For HTTP/Command providers, mocks bypass real execution and are recorded for assertions.