@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,361 @@
1
+ # Fact Validator Example Configuration
2
+ #
3
+ # This example demonstrates a complete fact validation system using the on_finish hook
4
+ # with forEach checks. It implements a feedback loop where:
5
+ # 1. An AI assistant generates a response
6
+ # 2. Facts are extracted from the response
7
+ # 3. Each fact is validated individually (forEach)
8
+ # 4. Results are aggregated
9
+ # 5. If validation fails, the assistant is retried with correction context
10
+ #
11
+ # This is a reference implementation for Phase 3 of the fact validator feature.
12
+ #
13
+ # Features demonstrated:
14
+ # - Memory initialization and namespace isolation
15
+ # - forEach with on_finish hook
16
+ # - Dynamic routing with goto_js
17
+ # - Event preservation with goto_event
18
+ # - Memory-based retry logic
19
+ # - Aggregation of forEach results
20
+ # - Conditional posting based on validation state
21
+ #
22
+ # Usage:
23
+ # visor --config examples/fact-validator.yaml --event issue_opened --debug
24
+
25
+ version: "1.0"
26
+
27
+ # Environment variables
28
+ env:
29
+ ENABLE_FACT_VALIDATION: "true"
30
+
31
+ # Routing configuration
32
+ routing:
33
+ max_loops: 3 # Prevent infinite retry loops
34
+
35
+ # Memory configuration
36
+ memory:
37
+ storage: memory
38
+ namespace: default
39
+
40
+ checks:
41
+ # ============================================================================
42
+ # TASK 3.1: Memory Initialization
43
+ # ============================================================================
44
+ # Initialize the fact validation attempt counter
45
+ # This tracks how many times we've retried the assistant with correction context
46
+ init-fact-validation:
47
+ type: memory
48
+ operation: set
49
+ key: fact_validation_attempt
50
+ value: 0
51
+ namespace: fact-validation
52
+ on: [issue_opened, issue_comment]
53
+ # Note: In production, you would use: if: "env.ENABLE_FACT_VALIDATION === 'true'"
54
+ # For this example, we run unconditionally
55
+
56
+ # ============================================================================
57
+ # TASK 3.2-3.3: Issue and Comment Assistants with Retry Context
58
+ # ============================================================================
59
+ # Generate response to GitHub issue
60
+ # For this demo, we use a command provider that simulates an AI response
61
+ # In production, this would be type: ai with a real prompt
62
+ issue-assistant:
63
+ type: command
64
+ group: dynamic
65
+ depends_on: [init-fact-validation]
66
+ on: [issue_opened]
67
+ exec: |
68
+ # Simulate AI assistant response
69
+ # Check if we have validation issues from a previous attempt
70
+ HAS_ISSUES=$(echo '{{ memory.has("fact_validation_issues", "fact-validation") }}' | tr '[:upper:]' '[:lower:]')
71
+
72
+ if [ "$HAS_ISSUES" = "true" ]; then
73
+ # Corrected response (second attempt)
74
+ echo "Welcome to Visor! The default configuration file is .visor.yaml (not visor.config.yaml). You can find examples in the examples/ directory. Visor supports multiple AI providers including Claude, Gemini, and OpenAI."
75
+ else
76
+ # Initial response with intentional factual error
77
+ echo "Welcome to Visor! The default configuration file is visor.config.yaml. You can find examples in the config/ directory. Visor only supports Claude AI."
78
+ fi
79
+
80
+ # Generate response to GitHub comment
81
+ # Similar to issue-assistant but for comment events
82
+ comment-assistant:
83
+ type: command
84
+ group: dynamic
85
+ depends_on: [init-fact-validation]
86
+ on: [issue_comment]
87
+ exec: |
88
+ # Simulate AI assistant response to comment
89
+ HAS_ISSUES=$(echo '{{ memory.has("fact_validation_issues", "fact-validation") }}' | tr '[:upper:]' '[:lower:]')
90
+
91
+ if [ "$HAS_ISSUES" = "true" ]; then
92
+ # Corrected response
93
+ echo "Visor can run as both a GitHub Action and a CLI tool. The binary name is 'visor' as defined in package.json. Tests use Jest with TypeScript support."
94
+ else
95
+ # Initial response with errors
96
+ echo "Visor only runs as a GitHub Action. The binary name is 'visor-cli'. Tests use Mocha."
97
+ fi
98
+
99
+ # ============================================================================
100
+ # TASK 3.4: Extract Facts (forEach with on_finish) - THE KEY CHECK
101
+ # ============================================================================
102
+ # Extract verifiable facts from the assistant response
103
+ # This is a forEach check, meaning it outputs an array and dependent checks
104
+ # will run once for each item in the array.
105
+ #
106
+ # The on_finish hook runs ONCE after ALL dependent checks (validate-fact) complete.
107
+ extract-facts:
108
+ type: command
109
+ group: fact-validation
110
+ depends_on: [issue-assistant, comment-assistant]
111
+ on: [issue_opened, issue_comment]
112
+
113
+ # Simulate fact extraction (normally this would be an AI prompt)
114
+ # Output: JSON array of fact objects
115
+ # For this demo, we detect which response we have and output the appropriate facts
116
+ exec: >
117
+ {% if outputs['issue-assistant'] %}
118
+ {% assign response = outputs['issue-assistant'] %}
119
+ {% else %}
120
+ {% assign response = outputs['comment-assistant'] %}
121
+ {% endif %}
122
+ {% if response contains "visor.config.yaml" %}
123
+ echo '[{"id":"fact-1","category":"Configuration","claim":"The default config file is visor.config.yaml","verifiable":true},{"id":"fact-2","category":"Documentation","claim":"Examples are in the config/ directory","verifiable":true},{"id":"fact-3","category":"Feature","claim":"Visor only supports Claude AI","verifiable":true}]'
124
+ {% elsif response contains ".visor.yaml" %}
125
+ echo '[{"id":"fact-1","category":"Configuration","claim":"The default config file is .visor.yaml","verifiable":true},{"id":"fact-2","category":"Documentation","claim":"Examples are in the examples/ directory","verifiable":true},{"id":"fact-3","category":"Feature","claim":"Visor supports multiple AI providers","verifiable":true}]'
126
+ {% elsif response contains "visor-cli" %}
127
+ echo '[{"id":"fact-1","category":"Configuration","claim":"Visor can run as both a GitHub Action and a CLI tool","verifiable":true},{"id":"fact-2","category":"Configuration","claim":"The binary name is visor-cli","verifiable":true},{"id":"fact-3","category":"Testing","claim":"Tests use Mocha","verifiable":true}]'
128
+ {% else %}
129
+ echo '[{"id":"fact-1","category":"Configuration","claim":"Visor can run as both a GitHub Action and a CLI tool","verifiable":true},{"id":"fact-2","category":"Configuration","claim":"The binary name is visor","verifiable":true},{"id":"fact-3","category":"Testing","claim":"Tests use Jest with TypeScript support","verifiable":true}]'
130
+ {% endif %}
131
+
132
+ # Parse the JSON output automatically
133
+ output_format: json
134
+
135
+ # Enable forEach - this check outputs an array and dependents will iterate
136
+ forEach: true
137
+
138
+ # ✅ on_finish: Runs ONCE after ALL validate-fact iterations complete
139
+ on_finish:
140
+ # First, run the aggregation check to collect results
141
+ run: [aggregate-validations]
142
+
143
+ # Then, make routing decision based on aggregated validation results
144
+ goto_js: |
145
+ // Get aggregation results from memory
146
+ const allValid = memory.get('all_facts_valid', 'fact-validation');
147
+ const attempt = memory.get('fact_validation_attempt', 'fact-validation') || 0;
148
+
149
+ log('🔍 Fact validation complete - allValid:', allValid, 'attempt:', attempt);
150
+
151
+ // If all facts are valid, continue to posting
152
+ if (allValid) {
153
+ log('✅ All facts valid, proceeding to post verified response');
154
+ return null; // Continue normal flow to post-verified-response
155
+ }
156
+
157
+ // If we've already retried once, give up and post warning
158
+ if (attempt >= 1) {
159
+ log('⚠️ Max attempts reached, giving up and posting warning');
160
+ return null; // Continue to post-unverified-warning
161
+ }
162
+
163
+ // Retry the assistant with validation context
164
+ log('🔄 Facts invalid, retrying assistant with correction context');
165
+ memory.increment('fact_validation_attempt', 1, 'fact-validation');
166
+
167
+ // Route back to extract-facts to re-run the full validation cycle
168
+ // This creates a feedback loop: extract → validate → retry → extract
169
+ // The assistant will run again because extract-facts depends on it
170
+ return 'extract-facts';
171
+
172
+ # Preserve the original event type when routing back
173
+ # This ensures the retried assistant runs with the correct event context
174
+ goto_event: issue_opened
175
+
176
+ # ============================================================================
177
+ # TASK 3.5: Validate Each Fact (Dependent Check)
178
+ # ============================================================================
179
+ # Validate a single fact (runs N times via forEach propagation)
180
+ # This check depends on extract-facts, so it inherits the forEach behavior
181
+ # and runs once for each fact in the array
182
+ validate-fact:
183
+ type: command
184
+ group: fact-validation
185
+ depends_on: [extract-facts]
186
+ on: [issue_opened, issue_comment]
187
+
188
+ # Simulate fact validation (normally this would be an AI with MCP tools)
189
+ # In production, the AI would use code search, file reading, etc.
190
+ exec: >
191
+ {% assign claim = outputs['extract-facts'].claim %}
192
+ {% assign fact_id = outputs['extract-facts'].id %}
193
+ {% if claim contains "visor.config.yaml" %}
194
+ echo '{"fact_id":"{{ fact_id }}","claim":"{{ claim }}","is_valid":false,"confidence":"high","evidence":"Checked defaults/.visor.yaml - the correct filename is .visor.yaml","correction":"The default configuration file is .visor.yaml"}'
195
+ {% elsif claim contains "config/ directory" %}
196
+ echo '{"fact_id":"{{ fact_id }}","claim":"{{ claim }}","is_valid":false,"confidence":"high","evidence":"Directory listing shows examples/ not config/","correction":"Examples are in the examples/ directory"}'
197
+ {% elsif claim contains "only supports Claude" %}
198
+ echo '{"fact_id":"{{ fact_id }}","claim":"{{ claim }}","is_valid":false,"confidence":"high","evidence":"Found support for multiple providers in src/ai-review-service.ts","correction":"Visor supports multiple AI providers"}'
199
+ {% elsif claim contains "visor-cli" %}
200
+ echo '{"fact_id":"{{ fact_id }}","claim":"{{ claim }}","is_valid":false,"confidence":"high","evidence":"package.json bin field specifies visor not visor-cli","correction":"The binary name is visor"}'
201
+ {% elsif claim contains "Mocha" %}
202
+ echo '{"fact_id":"{{ fact_id }}","claim":"{{ claim }}","is_valid":false,"confidence":"high","evidence":"Found Jest configuration in package.json","correction":"Tests use Jest with TypeScript support"}'
203
+ {% elsif claim contains "only runs as a GitHub Action" %}
204
+ echo '{"fact_id":"{{ fact_id }}","claim":"{{ claim }}","is_valid":false,"confidence":"high","evidence":"Found both src/index.ts (Action) and src/cli-main.ts (CLI)","correction":"Visor can run as both a GitHub Action and a CLI tool"}'
205
+ {% else %}
206
+ echo '{"fact_id":"{{ fact_id }}","claim":"{{ claim }}","is_valid":true,"confidence":"high","evidence":"Verified against codebase","correction":null}'
207
+ {% endif %}
208
+
209
+ # Parse validation result as JSON
210
+ output_format: json
211
+
212
+ # ============================================================================
213
+ # TASK 3.6: Aggregate Validation Results
214
+ # ============================================================================
215
+ # Aggregate all validation results from forEach iterations
216
+ # This check is triggered by the on_finish hook after all validate-fact runs complete
217
+ aggregate-validations:
218
+ type: script
219
+ namespace: fact-validation
220
+ on: [issue_opened, issue_comment]
221
+
222
+ # Complex aggregation logic
223
+ content: |
224
+ // Get ALL validation results from forEach iterations
225
+ // outputs.history['validate-fact'] contains all N validation results
226
+ const validations = outputs.history['validate-fact'] || [];
227
+
228
+ log('📊 Aggregating', validations.length, 'validation results');
229
+
230
+ // Analyze results
231
+ const invalid = validations.filter(v => !v.is_valid);
232
+ const lowConfidence = validations.filter(v => v.confidence === 'low');
233
+ const allValid = invalid.length === 0 && lowConfidence.length === 0;
234
+
235
+ log('Results: valid=' + (validations.length - invalid.length - lowConfidence.length),
236
+ 'invalid=' + invalid.length, 'low-confidence=' + lowConfidence.length);
237
+
238
+ // Store results in memory for use by posting checks and goto_js
239
+ memory.set('all_facts_valid', allValid, 'fact-validation');
240
+ memory.set('validation_results', validations, 'fact-validation');
241
+ memory.set('invalid_facts', invalid, 'fact-validation');
242
+ memory.set('low_confidence_facts', lowConfidence, 'fact-validation');
243
+
244
+ // Store issues for retry context
245
+ // These will be shown to the AI on the next attempt
246
+ if (!allValid) {
247
+ const issues = [...invalid, ...lowConfidence].map(v => ({
248
+ claim: v.claim,
249
+ issue: v.is_valid ? 'low confidence' : 'incorrect',
250
+ evidence: v.evidence,
251
+ correction: v.correction
252
+ }));
253
+ memory.set('fact_validation_issues', issues, 'fact-validation');
254
+ log('⚠️ Stored', issues.length, 'validation issues for retry');
255
+ }
256
+
257
+ // Return summary (this becomes the check output)
258
+ return {
259
+ total: validations.length,
260
+ valid: validations.filter(v => v.is_valid && v.confidence !== 'low').length,
261
+ invalid: invalid.length,
262
+ low_confidence: lowConfidence.length,
263
+ all_valid: allValid,
264
+ summary: allValid
265
+ ? 'All facts validated successfully ✅'
266
+ : 'Found ' + invalid.length + ' invalid and ' + lowConfidence.length + ' low-confidence facts ⚠️'
267
+ };
268
+
269
+ # ============================================================================
270
+ # TASK 3.7: Post Verified Response
271
+ # ============================================================================
272
+ # Post the assistant response if all facts are valid
273
+ # This check only runs if validation passed
274
+ post-verified-response:
275
+ type: log
276
+ # In production, this would be: type: github, op: comment.create
277
+ group: github-output
278
+ depends_on: [extract-facts]
279
+ on: [issue_opened, issue_comment]
280
+ if: "memory.get('all_facts_valid', 'fact-validation') === true"
281
+ message: |
282
+ ✅ **Posting Verified Response**
283
+
284
+ All facts have been validated. The response is safe to post.
285
+
286
+ **Original Response:**
287
+ {{ outputs['issue-assistant'] || outputs['comment-assistant'] }}
288
+
289
+ **Validation Summary:**
290
+ {% assign summary = "validation_results" | memory_get: "fact-validation" %}
291
+ - Total facts checked: {{ summary.size }}
292
+ - All facts valid: ✅
293
+
294
+ # ============================================================================
295
+ # TASK 3.8: Post Unverified Warning
296
+ # ============================================================================
297
+ # Post a warning if validation failed after max retries
298
+ # This check only runs if validation failed AND we've exhausted retry attempts
299
+ post-unverified-warning:
300
+ type: log
301
+ # In production, this would be: type: github, op: comment.create
302
+ group: github-output
303
+ depends_on: [extract-facts]
304
+ on: [issue_opened, issue_comment]
305
+ if: |
306
+ memory.get('all_facts_valid', 'fact-validation') === false &&
307
+ memory.get('fact_validation_attempt', 'fact-validation') >= 1
308
+ message: |
309
+ ⚠️ **Fact Validation Warning**
310
+
311
+ I attempted to respond to your {{ event.name == 'issue_opened' ? 'issue' : 'comment' }},
312
+ but could not verify all factual claims after {{ "fact_validation_attempt" | memory_get: "fact-validation" }} validation attempts.
313
+
314
+ **Issues Found:**
315
+ {% assign invalid = "invalid_facts" | memory_get: "fact-validation" %}
316
+ {% for fact in invalid %}
317
+ - **{{ fact.claim }}**: {{ fact.evidence }}
318
+ {% if fact.correction %}
319
+ - ✏️ Correction: {{ fact.correction }}
320
+ {% endif %}
321
+ {% endfor %}
322
+
323
+ {% assign lowConf = "low_confidence_facts" | memory_get: "fact-validation" %}
324
+ {% if lowConf.size > 0 %}
325
+
326
+ **Low Confidence Facts:**
327
+ {% for fact in lowConf %}
328
+ - **{{ fact.claim }}**: {{ fact.evidence }}
329
+ {% endfor %}
330
+ {% endif %}
331
+
332
+ **Recommendation:** A human team member should review this to provide accurate information.
333
+
334
+ **Attempted Response:**
335
+ {{ outputs['issue-assistant'] || outputs['comment-assistant'] }}
336
+
337
+ # ============================================================================
338
+ # TASK 3.9: Post Direct Response (Validation Disabled)
339
+ # ============================================================================
340
+ # Post the assistant response directly without validation
341
+ # This check only runs if fact validation is disabled
342
+ # Note: This check is disabled in the example because we always run validation
343
+ # In production, you would use: if: "env.ENABLE_FACT_VALIDATION !== 'true'"
344
+ # post-direct-response:
345
+ # type: log
346
+ # # In production, this would be: type: github, op: comment.create
347
+ # group: github-output
348
+ # depends_on: [issue-assistant, comment-assistant]
349
+ # on: [issue_opened, issue_comment]
350
+ # if: "false" # Disabled for example
351
+ # message: |
352
+ # **Posting Direct Response (Validation Disabled)**
353
+ #
354
+ # {{ outputs['issue-assistant'] || outputs['comment-assistant'] }}
355
+
356
+ # Output configuration
357
+ output:
358
+ pr_comment:
359
+ format: markdown
360
+ group_by: check
361
+ collapse: false
@@ -0,0 +1,90 @@
1
+ version: "1.0"
2
+
3
+ # Simple fail_if conditions - one line, easy to read!
4
+ # The check fails if the expression evaluates to true
5
+
6
+ # Global fail condition - applies to all checks
7
+ fail_if: "output.issues.some(i => i.severity === 'critical')"
8
+
9
+ steps:
10
+ # Security check - zero tolerance
11
+ security-check:
12
+ type: ai
13
+ schema: code-review
14
+ prompt: "Analyze for security vulnerabilities"
15
+ on: [pr_opened, pr_updated]
16
+ # Fail if ANY security issues found
17
+ fail_if: "output.issues.length > 0"
18
+
19
+ # Performance check - some tolerance
20
+ performance-check:
21
+ type: ai
22
+ schema: code-review
23
+ prompt: "Review for performance issues"
24
+ on: [pr_opened, pr_updated]
25
+ # Fail only if critical performance issues
26
+ fail_if: "output.issues.some(i => i.severity === 'critical') || output.issues.filter(i => i.severity === 'error').length > 2"
27
+
28
+ # Code style - lenient
29
+ style-check:
30
+ type: ai
31
+ schema: code-review
32
+ prompt: "Check code style and formatting"
33
+ on: [pr_opened, pr_updated]
34
+ # Only fail if too many style issues
35
+ fail_if: "output.issues.length > 20"
36
+
37
+ # Using GitHub Actions-style functions
38
+ quality-gate:
39
+ type: ai
40
+ schema: code-review
41
+ prompt: "Overall code quality check"
42
+ on: [pr_opened, pr_updated]
43
+ # Using expressions with output
44
+ fail_if: "output.issues.some(i => i.severity === 'critical' || i.severity === 'error')" # Fails if critical or error issues found
45
+
46
+ # With contains() function
47
+ sensitive-files:
48
+ type: ai
49
+ schema: security
50
+ prompt: "Check for exposed secrets"
51
+ on: [pr_opened, pr_updated]
52
+ # Fail if checking sensitive files with issues
53
+ fail_if: "hasFileMatching(issues, '.env') || hasFileMatching(issues, 'secret')"
54
+
55
+ # With startsWith() function
56
+ api-check:
57
+ type: ai
58
+ schema: code-review
59
+ prompt: "Review API endpoints"
60
+ on: [pr_opened, pr_updated]
61
+ # Stricter for API files (using checkName from context)
62
+ fail_if: "startsWith(checkName, 'api') && output.issues.length > 0"
63
+
64
+ # Always pass example
65
+ info-only:
66
+ type: ai
67
+ schema: plain
68
+ prompt: "Informational analysis"
69
+ on: [pr_opened]
70
+ # Never fails - using always() returns true, ! makes it false
71
+ fail_if: "!always()"
72
+
73
+ # Complex single-line condition
74
+ combined-check:
75
+ type: ai
76
+ schema: code-review
77
+ prompt: "Combined quality check"
78
+ on: [pr_opened, pr_updated]
79
+ depends_on: [security-check, performance-check]
80
+ # Fail if previous checks found issues OR current check has critical issues
81
+ fail_if: |
82
+ (outputs['security-check'] && outputs['security-check'].issues.length > 0) ||
83
+ (outputs['performance-check'] && outputs['performance-check'].issues.some(i => i.severity === 'critical')) ||
84
+ output.issues.some(i => i.severity === 'critical')
85
+
86
+ output:
87
+ pr_comment:
88
+ format: markdown
89
+ group_by: check
90
+ collapse: true
@@ -0,0 +1,136 @@
1
+ version: "1.0"
2
+
3
+ # Advanced failure conditions example
4
+ # This shows complex JavaScript expressions with metadata access and business logic
5
+
6
+ # Global failure conditions with schema-based logic
7
+ failure_conditions:
8
+ # Only apply critical issue limits to code-review schema checks
9
+ critical_code_review:
10
+ condition: "checkName.includes('code-review') && output.issues.some(i => i.severity === 'critical')"
11
+ message: "Critical issues found in code review - blocking merge"
12
+ severity: error
13
+
14
+ # Different thresholds for different check types
15
+ schema_based_limits:
16
+ condition: |
17
+ (checkName.includes('security') && output.issues.length > 2) ||
18
+ (checkName.includes('performance') && output.issues.some(i => i.severity === 'critical')) ||
19
+ (checkName.includes('plain') && output.issues.filter(i => i.severity === 'error').length > 5)
20
+ message: "Schema-specific quality gate failed"
21
+ severity: error
22
+
23
+ # Check execution health using GitHub Actions-like functions
24
+ execution_health:
25
+ condition: "failure() || debug.processingTime > 300000"
26
+ message: "Check execution failed or timed out"
27
+ severity: error
28
+ halt_execution: true
29
+
30
+ steps:
31
+ # Security check with complex conditions
32
+ security-comprehensive:
33
+ type: ai
34
+ group: security-analysis
35
+ schema: security
36
+ prompt: "Comprehensive security analysis for authentication, authorization, data validation, and cryptography."
37
+ on: [pr_opened, pr_updated]
38
+
39
+ failure_conditions:
40
+ # Zero tolerance for SQL injection patterns (GitHub Actions-like syntax)
41
+ sql_injection_check:
42
+ condition: 'hasIssue(output.issues, "ruleId", "security/sql-injection")'
43
+ message: "SQL injection vulnerability detected - immediate fix required"
44
+ severity: error
45
+ halt_execution: true
46
+
47
+ # Count specific security issue types
48
+ critical_security_count:
49
+ condition: 'countIssues(output.issues, "severity", "critical") == 0'
50
+ message: "Critical security issues must be resolved"
51
+ severity: error
52
+
53
+ # File-based analysis using contains-like function
54
+ auth_file_issues:
55
+ condition: 'hasFileMatching(output.issues, "auth") && output.issues.some(i => i.severity === "critical")'
56
+ message: "Critical issues found in authentication-related files"
57
+ severity: error
58
+
59
+ # Performance check with business logic
60
+ performance-analysis:
61
+ type: ai
62
+ group: performance
63
+ schema: code-review
64
+ prompt: "Analyze for performance bottlenecks, database query optimization, and resource usage."
65
+ on: [pr_opened, pr_updated]
66
+
67
+ failure_conditions:
68
+ # Complex performance criteria
69
+ performance_quality_gate:
70
+ condition: |
71
+ !output.issues.some(i => i.severity === "critical") &&
72
+ output.issues.filter(i => i.severity === "error").length <= 2 &&
73
+ !hasFileWith(output.issues, "database") || countIssues(output.issues, "category", "performance") <= 3
74
+ message: "Performance quality gate failed"
75
+ severity: warning
76
+
77
+ # Database-specific rules
78
+ database_performance:
79
+ condition: 'hasFileWith(output.issues, "db") && countIssues(output.issues, "severity", "critical") > 0'
80
+ message: "Critical database performance issues found"
81
+ severity: error
82
+
83
+ # Architecture check with metadata conditions
84
+ architecture-review:
85
+ type: ai
86
+ group: architecture
87
+ schema: plain
88
+ prompt: "Review architectural patterns, dependencies, and design principles."
89
+ on: [pr_opened]
90
+
91
+ failure_conditions:
92
+ # Only fail for large changes
93
+ architecture_impact:
94
+ condition: "output.issues.length > 5 && output.issues.filter(i => i.severity === 'critical').length > 1"
95
+ message: "Significant architectural concerns identified"
96
+ severity: warning
97
+
98
+ # Provider-specific conditions
99
+ ai_provider_health:
100
+ condition: 'debug.provider == "anthropic" && debug.processingTime < 60000'
101
+ message: "AI analysis completed within acceptable time"
102
+ severity: info
103
+
104
+ # Style check with suggestion analysis
105
+ code-style:
106
+ type: ai
107
+ group: style
108
+ schema: code-review
109
+ prompt: "Check code style, formatting, naming conventions, and documentation."
110
+ on: [pr_opened, pr_updated]
111
+
112
+ failure_conditions:
113
+ # Complex style rules
114
+ style_quality:
115
+ condition: |
116
+ output.issues.filter(i => i.severity === "warning").length <= 10 &&
117
+ !hasIssueWith(output.issues, "category", "documentation") ||
118
+ output.issues.length <= 15
119
+ message: "Code style within acceptable limits"
120
+ severity: info
121
+
122
+ # Multiple output configurations
123
+ output:
124
+ pr_comment:
125
+ format: markdown
126
+ group_by: check
127
+ collapse: true
128
+ debug:
129
+ enabled: true
130
+ includeTiming: true
131
+ includeProviderInfo: true
132
+
133
+ # Global environment for all checks
134
+ env:
135
+ VISOR_TIMEOUT: 300000
136
+ VISOR_MAX_ISSUES: 20
@@ -0,0 +1,48 @@
1
+ version: "1.0"
2
+
3
+ # Basic failure conditions example
4
+ # This shows simple single-line JavaScript expressions for common quality gates
5
+
6
+ # Global failure conditions that apply to all checks
7
+ failure_conditions:
8
+ # Fail if any critical issues are found
9
+ no_critical_issues: "!output.issues.some(i => i.severity === 'critical')"
10
+
11
+ # Fail if there are more than 3 error-level issues
12
+ error_threshold: "output.issues.filter(i => i.severity === 'error').length <= 3"
13
+
14
+ # Warn if there are more than 10 total issues
15
+ total_issue_limit:
16
+ condition: "output.issues.length <= 10"
17
+ message: "Too many issues found - consider refactoring"
18
+ severity: warning
19
+
20
+ steps:
21
+ # Basic security check with simple failure condition
22
+ security-check:
23
+ type: ai
24
+ schema: code-review
25
+ prompt: "Analyze for security vulnerabilities including SQL injection, XSS, authentication issues, and data exposure."
26
+ on: [pr_opened, pr_updated]
27
+
28
+ # Check-specific failure conditions (override global ones)
29
+ failure_conditions:
30
+ # Security issues are always critical - no tolerance
31
+ zero_security_issues: "output.issues.length == 0"
32
+
33
+ # Performance check with multiple failure conditions
34
+ performance-check:
35
+ type: ai
36
+ schema: code-review
37
+ prompt: "Review for performance issues including N+1 queries, inefficient algorithms, memory leaks, and blocking operations."
38
+ on: [pr_opened, pr_updated]
39
+
40
+ failure_conditions:
41
+ # Allow some performance warnings but no critical issues
42
+ performance_gate: "!output.issues.some(i => i.severity === 'critical') && output.issues.filter(i => i.severity === 'error').length <= 1"
43
+
44
+ output:
45
+ pr_comment:
46
+ format: markdown
47
+ group_by: check
48
+ collapse: true