@probelabs/visor 0.1.124 → 0.1.126

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 (195) hide show
  1. package/dist/config.d.ts.map +1 -1
  2. package/dist/docs/DEPLOYMENT.md +117 -11
  3. package/dist/docs/GITHUB_CHECKS.md +18 -4
  4. package/dist/docs/NPM_USAGE.md +112 -39
  5. package/dist/docs/action-reference.md +63 -9
  6. package/dist/docs/advanced-ai.md +58 -51
  7. package/dist/docs/ai-configuration.md +99 -11
  8. package/dist/docs/ai-custom-tools-usage.md +70 -33
  9. package/dist/docs/ai-custom-tools.md +50 -27
  10. package/dist/docs/architecture.md +1232 -0
  11. package/dist/docs/bot-transports-rfc.md +13 -3
  12. package/dist/docs/ci-cli-mode.md +116 -8
  13. package/dist/docs/claude-code.md +111 -41
  14. package/dist/docs/command-provider.md +37 -15
  15. package/dist/docs/commands.md +252 -6
  16. package/dist/docs/configuration.md +138 -4
  17. package/dist/docs/contributing.md +737 -0
  18. package/dist/docs/custom-tools.md +39 -8
  19. package/dist/docs/dashboards/README.md +33 -19
  20. package/dist/docs/debug-visualizer-progress.md +14 -13
  21. package/dist/docs/debug-visualizer-rfc.md +14 -13
  22. package/dist/docs/debug-visualizer.md +30 -5
  23. package/dist/docs/debugging.md +73 -8
  24. package/dist/docs/default-output-schema.md +24 -20
  25. package/dist/docs/dependencies.md +75 -21
  26. package/dist/docs/dev-playbook.md +85 -9
  27. package/dist/docs/engine-pause-resume-rfc.md +11 -11
  28. package/dist/docs/engine-state-machine-plan.md +10 -3
  29. package/dist/docs/event-driven-github-integration-rfc.md +20 -11
  30. package/dist/docs/event-triggers.md +95 -6
  31. package/dist/docs/execution-statistics-rfc.md +16 -4
  32. package/dist/docs/fact-validator-gap-analysis.md +12 -1
  33. package/dist/docs/fact-validator-implementation-plan.md +19 -11
  34. package/dist/docs/fail-if.md +116 -11
  35. package/dist/docs/failure-conditions-implementation.md +40 -6
  36. package/dist/docs/failure-conditions-schema.md +243 -87
  37. package/dist/docs/failure-routing-rfc.md +43 -18
  38. package/dist/docs/failure-routing.md +80 -23
  39. package/dist/docs/faq.md +836 -0
  40. package/dist/docs/foreach-dependency-propagation.md +32 -15
  41. package/dist/docs/github-ops.md +6 -5
  42. package/dist/docs/glossary.md +322 -0
  43. package/dist/docs/goto-forward-run-plan.md +23 -10
  44. package/dist/docs/guides/criticality-modes.md +15 -13
  45. package/dist/docs/guides/fault-management-and-contracts.md +8 -5
  46. package/dist/docs/guides/workflow-style-guide.md +17 -8
  47. package/dist/docs/http.md +102 -3
  48. package/dist/docs/human-input-provider.md +20 -36
  49. package/dist/docs/index.md +206 -0
  50. package/dist/docs/lifecycle-hooks.md +322 -2
  51. package/dist/docs/limits.md +20 -5
  52. package/dist/docs/liquid-templates.md +86 -14
  53. package/dist/docs/loop-routing-refactor.md +4 -2
  54. package/dist/docs/mcp-provider.md +53 -19
  55. package/dist/docs/mcp.md +27 -1
  56. package/dist/docs/memory.md +7 -2
  57. package/dist/docs/migration.md +596 -0
  58. package/dist/docs/observability.md +227 -6
  59. package/dist/docs/output-formats.md +388 -9
  60. package/dist/docs/output-history.md +36 -6
  61. package/dist/docs/performance.md +510 -4
  62. package/dist/docs/pluggable.md +95 -4
  63. package/dist/docs/proposals/snapshot-scope-execution.md +6 -5
  64. package/dist/docs/providers/git-checkout.md +16 -14
  65. package/dist/docs/providers/noop.md +696 -0
  66. package/dist/docs/recipes.md +8 -9
  67. package/dist/docs/rfc/git-checkout-step.md +3 -1
  68. package/dist/docs/rfc/on_init-hook.md +18 -5
  69. package/dist/docs/rfc/workspace-isolation.md +16 -0
  70. package/dist/docs/roadmap/criticality-implementation-tasks.md +27 -27
  71. package/dist/docs/router-patterns.md +155 -43
  72. package/dist/docs/schema-templates.md +51 -15
  73. package/dist/docs/script.md +162 -13
  74. package/dist/docs/sdk.md +46 -12
  75. package/dist/docs/security.md +464 -5
  76. package/dist/docs/slack-integration.md +481 -0
  77. package/dist/docs/tag-filtering.md +60 -20
  78. package/dist/docs/telemetry-setup.md +157 -46
  79. package/dist/docs/test-framework-rfc.md +37 -36
  80. package/dist/docs/testing/assertions.md +92 -4
  81. package/dist/docs/testing/ci.md +56 -7
  82. package/dist/docs/testing/cli.md +57 -15
  83. package/dist/docs/testing/cookbook.md +53 -20
  84. package/dist/docs/testing/dsl-reference.md +110 -9
  85. package/dist/docs/testing/fixtures-and-mocks.md +28 -3
  86. package/dist/docs/testing/flows.md +59 -4
  87. package/dist/docs/testing/getting-started.md +14 -13
  88. package/dist/docs/testing/troubleshooting.md +39 -2
  89. package/dist/docs/timeouts.md +174 -18
  90. package/dist/docs/troubleshooting.md +176 -6
  91. package/dist/docs/workflow-creation-guide.md +101 -3
  92. package/dist/docs/workflows.md +138 -41
  93. package/dist/examples/README.md +169 -4
  94. package/dist/examples/ai-custom-tools-simple.yaml +2 -3
  95. package/dist/examples/cron-webhook-config.yaml +15 -0
  96. package/dist/examples/forEach-example.yaml +6 -0
  97. package/dist/examples/git-checkout-basic.yaml +4 -0
  98. package/dist/examples/git-checkout-compare.yaml +6 -0
  99. package/dist/examples/git-checkout-cross-repo.yaml +7 -0
  100. package/dist/examples/http-integration-config.yaml +30 -0
  101. package/dist/examples/https-server-config.yaml +15 -0
  102. package/dist/examples/mcp-provider-example.yaml +10 -10
  103. package/dist/examples/transform-example.yaml +3 -0
  104. package/dist/examples/webhook-pipeline-config.yaml +18 -0
  105. package/dist/examples/workflows/workflow-composition-example.yaml +4 -0
  106. package/dist/frontends/slack-frontend.d.ts +2 -0
  107. package/dist/frontends/slack-frontend.d.ts.map +1 -1
  108. package/dist/generated/config-schema.d.ts +11 -7
  109. package/dist/generated/config-schema.d.ts.map +1 -1
  110. package/dist/generated/config-schema.json +11 -7
  111. package/dist/index.js +3127 -974
  112. package/dist/output/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
  113. package/dist/output/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
  114. package/dist/providers/ai-check-provider.d.ts +9 -2
  115. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  116. package/dist/providers/command-check-provider.d.ts.map +1 -1
  117. package/dist/providers/mcp-custom-sse-server.d.ts +17 -1
  118. package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
  119. package/dist/providers/workflow-check-provider.d.ts.map +1 -1
  120. package/dist/providers/workflow-tool-executor.d.ts +68 -0
  121. package/dist/providers/workflow-tool-executor.d.ts.map +1 -0
  122. package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs → check-provider-registry-3KI5RKXT.mjs} +6 -5
  123. package/dist/sdk/check-provider-registry-IYILYY35.mjs +28 -0
  124. package/dist/sdk/chunk-2CPMMNIX.mjs +1459 -0
  125. package/dist/sdk/chunk-2CPMMNIX.mjs.map +1 -0
  126. package/dist/sdk/chunk-5LI6T4O3.mjs +3600 -0
  127. package/dist/sdk/chunk-5LI6T4O3.mjs.map +1 -0
  128. package/dist/sdk/{chunk-YLQ4UN62.mjs → chunk-A4PGHURG.mjs} +6838 -6257
  129. package/dist/sdk/chunk-A4PGHURG.mjs.map +1 -0
  130. package/dist/sdk/chunk-EXFGO4FX.mjs +147 -0
  131. package/dist/sdk/chunk-EXFGO4FX.mjs.map +1 -0
  132. package/dist/sdk/chunk-PJ7K5UFC.mjs +17732 -0
  133. package/dist/sdk/chunk-PJ7K5UFC.mjs.map +1 -0
  134. package/dist/sdk/{chunk-BHZ4CKUS.mjs → chunk-PXFIALUH.mjs} +77 -8
  135. package/dist/sdk/chunk-PXFIALUH.mjs.map +1 -0
  136. package/dist/sdk/{chunk-PVITVJ6J.mjs → chunk-RTKJXNZS.mjs} +32 -9
  137. package/dist/sdk/chunk-RTKJXNZS.mjs.map +1 -0
  138. package/dist/sdk/chunk-VW2GBXQT.mjs +606 -0
  139. package/dist/sdk/chunk-VW2GBXQT.mjs.map +1 -0
  140. package/dist/sdk/{config-RQQPMLRD.mjs → config-5AUYQFHE.mjs} +2 -2
  141. package/dist/sdk/config-6CUVEH7H.mjs +16 -0
  142. package/dist/sdk/config-6CUVEH7H.mjs.map +1 -0
  143. package/dist/sdk/{github-frontend-6Q4BISZX.mjs → github-frontend-BZ4N3BFZ.mjs} +7 -3
  144. package/dist/sdk/github-frontend-BZ4N3BFZ.mjs.map +1 -0
  145. package/dist/sdk/host-4MT3EW2I.mjs +52 -0
  146. package/dist/sdk/{host-P5NQICP7.mjs → host-NYWXLIFC.mjs} +2 -2
  147. package/dist/sdk/host-NYWXLIFC.mjs.map +1 -0
  148. package/dist/sdk/{routing-DEY2AIXM.mjs → routing-6R42GXUO.mjs} +2 -2
  149. package/dist/sdk/routing-6R42GXUO.mjs.map +1 -0
  150. package/dist/sdk/routing-7FXPULTO.mjs +24 -0
  151. package/dist/sdk/routing-7FXPULTO.mjs.map +1 -0
  152. package/dist/sdk/sdk.d.mts +3 -1
  153. package/dist/sdk/sdk.d.ts +3 -1
  154. package/dist/sdk/sdk.js +12163 -11204
  155. package/dist/sdk/sdk.js.map +1 -1
  156. package/dist/sdk/sdk.mjs +14 -10
  157. package/dist/sdk/sdk.mjs.map +1 -1
  158. package/dist/sdk/slack-frontend-JUT3TYVC.mjs +821 -0
  159. package/dist/sdk/slack-frontend-JUT3TYVC.mjs.map +1 -0
  160. package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs +28 -0
  161. package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs.map +1 -0
  162. package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs +28 -0
  163. package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs.map +1 -0
  164. package/dist/sdk/workflow-registry-KFWSDSLM.mjs +12 -0
  165. package/dist/sdk/workflow-registry-KFWSDSLM.mjs.map +1 -0
  166. package/dist/slack/socket-runner.d.ts +2 -0
  167. package/dist/slack/socket-runner.d.ts.map +1 -1
  168. package/dist/state-machine/context/workflow-inputs.d.ts +20 -0
  169. package/dist/state-machine/context/workflow-inputs.d.ts.map +1 -0
  170. package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
  171. package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -1
  172. package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -1
  173. package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
  174. package/dist/state-machine/states/routing.d.ts +2 -1
  175. package/dist/state-machine/states/routing.d.ts.map +1 -1
  176. package/dist/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
  177. package/dist/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
  178. package/dist/types/config.d.ts +3 -1
  179. package/dist/types/config.d.ts.map +1 -1
  180. package/dist/utils/human-id.d.ts +12 -0
  181. package/dist/utils/human-id.d.ts.map +1 -0
  182. package/dist/utils/worktree-manager.d.ts +3 -0
  183. package/dist/utils/worktree-manager.d.ts.map +1 -1
  184. package/dist/workflow-executor.d.ts.map +1 -1
  185. package/dist/workflow-registry.d.ts +1 -0
  186. package/dist/workflow-registry.d.ts.map +1 -1
  187. package/package.json +2 -2
  188. package/dist/sdk/chunk-BHZ4CKUS.mjs.map +0 -1
  189. package/dist/sdk/chunk-PVITVJ6J.mjs.map +0 -1
  190. package/dist/sdk/chunk-YLQ4UN62.mjs.map +0 -1
  191. package/dist/sdk/github-frontend-6Q4BISZX.mjs.map +0 -1
  192. /package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs.map → check-provider-registry-3KI5RKXT.mjs.map} +0 -0
  193. /package/dist/sdk/{config-RQQPMLRD.mjs.map → check-provider-registry-IYILYY35.mjs.map} +0 -0
  194. /package/dist/sdk/{routing-DEY2AIXM.mjs.map → config-5AUYQFHE.mjs.map} +0 -0
  195. /package/dist/sdk/{host-P5NQICP7.mjs.map → host-4MT3EW2I.mjs.map} +0 -0
@@ -14,11 +14,13 @@ When checks execute multiple times (through `goto` loops, `retry` attempts, or `
14
14
 
15
15
  ## Structure
16
16
 
17
- The `outputs` variable has two main parts:
17
+ The `outputs` variable has several parts:
18
18
 
19
19
  ```javascript
20
- outputs['check-name'] // Current/latest value from this check
21
- outputs.history['check-name'] // Array of ALL previous values from this check
20
+ outputs['check-name'] // Current/latest value from this check
21
+ outputs.history['check-name'] // Array of ALL previous values from this check
22
+ outputs_raw['check-name'] // Aggregate value (e.g., full array from forEach parent)
23
+ outputs_history_stage['check-name'] // Stage-scoped history slice (for test framework)
22
24
  ```
23
25
 
24
26
  ### Current vs History
@@ -33,6 +35,15 @@ outputs.history['check-name'] // Array of ALL previous values from this check
33
35
  - First element is from first execution, last is most recent
34
36
  - Useful for tracking progress, calculating totals, comparing changes
35
37
 
38
+ - **`outputs_raw['check-name']`** - Aggregate/parent value
39
+ - Returns the full aggregate value (e.g., the entire array from a forEach parent)
40
+ - Useful when you need the complete collection inside a per-item iteration
41
+ - See [forEach Dependency Propagation](./foreach-dependency-propagation.md) for details
42
+
43
+ - **`outputs_history_stage['check-name']`** - Stage-scoped history
44
+ - Used by the test framework to track outputs within a test stage
45
+ - Contains only outputs since the stage began
46
+
36
47
  ## Usage Examples
37
48
 
38
49
  ### Basic Loop Tracking
@@ -309,9 +320,15 @@ If a check hasn't executed yet, or has no output:
309
320
  - `outputs.history['check-name']` = `[]` (empty array, not undefined)
310
321
  - Always safe to check `.length` or iterate
311
322
 
312
- ### Failed Executions
323
+ ### Skipped Executions
324
+
325
+ Skipped executions are NOT added to history. Executions can be skipped due to:
326
+ - `if` condition evaluating to false
327
+ - Dependency failures (when a required dependency failed)
328
+ - Empty forEach parent (when the array to iterate is empty)
329
+ - Explicit `assume` declarations
313
330
 
314
- Failed executions that throw errors are NOT added to history. Only successful outputs are tracked.
331
+ Only successful outputs from actually executed checks are tracked in history.
315
332
 
316
333
  ### forEach Iterations
317
334
 
@@ -367,6 +384,20 @@ log('Average iteration time:', durations.reduce((a,b) => a+b, 0) / durations.len
367
384
  - For very long-running loops (100+ iterations), consider periodically clearing or summarizing
368
385
  - Use `max_loops` configuration to prevent infinite loops
369
386
 
387
+ ### History Limit Environment Variables
388
+
389
+ You can limit the size of output history using environment variables:
390
+
391
+ ```bash
392
+ # Limit history to last N entries per check
393
+ export VISOR_OUTPUT_HISTORY_LIMIT=100
394
+
395
+ # For tests (takes precedence over VISOR_OUTPUT_HISTORY_LIMIT)
396
+ export VISOR_TEST_HISTORY_LIMIT=200
397
+ ```
398
+
399
+ When set, history arrays are automatically trimmed to keep only the most recent entries, preventing memory issues in long-running workflows.
400
+
370
401
  ## Related Documentation
371
402
 
372
403
  - [Liquid Templates](./liquid-templates.md) - Using history in templates
@@ -380,4 +411,3 @@ log('Average iteration time:', durations.reduce((a,b) => a+b, 0) / durations.len
380
411
  See the test files for complete working examples:
381
412
  - `tests/unit/output-history.test.ts` - Basic history functionality
382
413
  - `tests/integration/output-history-integration.test.ts` - Complex loop scenarios
383
- - `tests/unit/goto-current-output.test.ts` - Verifying current vs history values
@@ -1,6 +1,512 @@
1
- ## Performance & Cost Controls
1
+ # Performance and Cost Controls
2
2
 
3
- - Cache Node in CI: `actions/setup-node@v4` with `cache: npm`.
4
- - Use tags: run `local,fast` on PRs; `remote,comprehensive` nightly.
5
- - Increase `max-parallelism` cautiously if not reusing AI sessions.
3
+ This guide covers configuration options and best practices for optimizing Visor execution speed, resource usage, and AI API costs.
6
4
 
5
+ ## Parallelism Configuration
6
+
7
+ ### max_parallelism Option
8
+
9
+ Controls how many checks run simultaneously. Higher values speed up execution but increase resource usage and may hit API rate limits.
10
+
11
+ **YAML Configuration:**
12
+
13
+ ```yaml
14
+ version: "1.0"
15
+
16
+ # Global parallelism setting
17
+ max_parallelism: 5
18
+
19
+ steps:
20
+ security:
21
+ type: ai
22
+ prompt: "Security analysis..."
23
+
24
+ performance:
25
+ type: ai
26
+ prompt: "Performance analysis..."
27
+
28
+ style:
29
+ type: ai
30
+ prompt: "Style analysis..."
31
+ ```
32
+
33
+ **CLI Flag:**
34
+
35
+ ```bash
36
+ # Run up to 5 checks in parallel
37
+ visor --max-parallelism 5
38
+
39
+ # Conservative single-threaded execution
40
+ visor --max-parallelism 1
41
+
42
+ # Default: 3 in CLI mode
43
+ visor --config .visor.yaml
44
+ ```
45
+
46
+ **Defaults:**
47
+ - CLI mode: 3
48
+ - GitHub Action: 1 (conservative for stability)
49
+
50
+ **Recommendations:**
51
+ - Start with the default (3) and increase if you have many independent checks
52
+ - Reduce to 1 when debugging to get clearer logs
53
+ - Consider AI provider rate limits when increasing parallelism
54
+ - For checks using `reuse_ai_session`, parallelism is constrained by session dependencies
55
+
56
+ ### GitHub Action Configuration
57
+
58
+ ```yaml
59
+ - uses: probelabs/visor@v1
60
+ with:
61
+ max-parallelism: 3
62
+ env:
63
+ GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
64
+ ```
65
+
66
+ ## Fail Fast Mode
67
+
68
+ Stop execution immediately when any check fails, saving time and API costs when early failures indicate deeper problems.
69
+
70
+ **YAML Configuration:**
71
+
72
+ ```yaml
73
+ version: "1.0"
74
+
75
+ fail_fast: true
76
+
77
+ steps:
78
+ lint:
79
+ type: command
80
+ exec: npm run lint
81
+
82
+ security:
83
+ type: ai
84
+ prompt: "Security analysis..."
85
+ depends_on: [lint]
86
+ ```
87
+
88
+ **CLI Flag:**
89
+
90
+ ```bash
91
+ # Stop on first failure
92
+ visor --fail-fast
93
+
94
+ # Continue despite failures (default)
95
+ visor
96
+ ```
97
+
98
+ **Use Cases:**
99
+ - CI pipelines where any failure blocks the PR
100
+ - Fast feedback during local development
101
+ - Cost control when running expensive AI checks
102
+
103
+ **Example: Progressive Pipeline with Fail Fast**
104
+
105
+ ```yaml
106
+ version: "1.0"
107
+
108
+ fail_fast: true
109
+
110
+ steps:
111
+ # Stage 1: Fast, cheap checks first
112
+ format-check:
113
+ type: command
114
+ exec: npm run format:check
115
+ tags: [fast, local]
116
+
117
+ lint:
118
+ type: command
119
+ exec: npm run lint
120
+ tags: [fast, local]
121
+
122
+ # Stage 2: Expensive AI checks only if basics pass
123
+ security-analysis:
124
+ type: ai
125
+ depends_on: [lint, format-check]
126
+ prompt: "Deep security analysis..."
127
+ tags: [expensive, security]
128
+ ```
129
+
130
+ ## Tag Filtering for Selective Execution
131
+
132
+ Use tags to run only the checks you need, reducing execution time and costs.
133
+
134
+ **Configuration:**
135
+
136
+ ```yaml
137
+ version: "1.0"
138
+
139
+ steps:
140
+ quick-security:
141
+ type: ai
142
+ prompt: "Quick security scan..."
143
+ tags: [fast, local, security]
144
+
145
+ deep-security:
146
+ type: ai
147
+ prompt: "Comprehensive security analysis..."
148
+ tags: [slow, comprehensive, security]
149
+
150
+ performance:
151
+ type: ai
152
+ prompt: "Performance analysis..."
153
+ tags: [fast, performance]
154
+ ```
155
+
156
+ **CLI Usage:**
157
+
158
+ ```bash
159
+ # Run only fast checks (great for pre-commit)
160
+ visor --tags fast
161
+
162
+ # Run security checks but skip slow ones
163
+ visor --tags security --exclude-tags slow
164
+
165
+ # Run comprehensive checks (for CI)
166
+ visor --tags comprehensive
167
+ ```
168
+
169
+ **GitHub Action:**
170
+
171
+ ```yaml
172
+ jobs:
173
+ fast-checks:
174
+ steps:
175
+ - uses: probelabs/visor@v1
176
+ with:
177
+ tags: "fast,local"
178
+ exclude-tags: "experimental"
179
+ ```
180
+
181
+ **Best Practices:**
182
+ - Tag fast checks with `local` or `fast` for pre-commit hooks
183
+ - Tag expensive checks with `comprehensive` or `slow` for nightly builds
184
+ - Use `--exclude-tags experimental` to skip untested checks
185
+
186
+ For detailed tag filtering patterns, see [Tag Filtering](./tag-filtering.md).
187
+
188
+ ## AI Session Reuse
189
+
190
+ Reuse AI conversation sessions across dependent checks to reduce API calls and improve context continuity.
191
+
192
+ **Configuration:**
193
+
194
+ ```yaml
195
+ version: "1.0"
196
+
197
+ steps:
198
+ security:
199
+ type: ai
200
+ prompt: "Analyze code for security vulnerabilities..."
201
+
202
+ security-remediation:
203
+ type: ai
204
+ prompt: "Based on our security analysis, provide remediation guidance."
205
+ depends_on: [security]
206
+ reuse_ai_session: true # Reuses session from 'security'
207
+ session_mode: clone # Independent copy (default)
208
+
209
+ security-verify:
210
+ type: ai
211
+ prompt: "Verify the remediation suggestions."
212
+ depends_on: [security-remediation]
213
+ reuse_ai_session: true
214
+ session_mode: append # Shared conversation thread
215
+ ```
216
+
217
+ **Session Modes:**
218
+ - `clone` (default): Independent copy of conversation history
219
+ - `append`: Shared conversation thread for multi-turn dialogs
220
+
221
+ **Benefits:**
222
+ - Reduces total API calls by continuing conversations
223
+ - Maintains context for follow-up analysis
224
+ - Improves response quality through conversation continuity
225
+
226
+ **Self-Session Reuse for Chat Loops:**
227
+
228
+ ```yaml
229
+ steps:
230
+ chat-assistant:
231
+ type: ai
232
+ reuse_ai_session: self # Reuse own session on retry
233
+ session_mode: append
234
+ prompt: "Process user request..."
235
+ on_success:
236
+ goto_js: |
237
+ return needsMoreInput ? 'chat-assistant' : null;
238
+ ```
239
+
240
+ For detailed AI session configuration, see [Advanced AI Features](./advanced-ai.md).
241
+
242
+ ## Timeout Configuration
243
+
244
+ Set per-check timeouts to prevent runaway execution and control costs.
245
+
246
+ **Per-Check Timeout:**
247
+
248
+ ```yaml
249
+ steps:
250
+ fetch-data:
251
+ type: command
252
+ timeout: 120 # seconds for command provider
253
+ exec: curl -s https://api.example.com/data
254
+
255
+ ai-analysis:
256
+ type: ai
257
+ ai:
258
+ timeout: 60000 # milliseconds for AI provider
259
+ prompt: "Analyze the data..."
260
+ ```
261
+
262
+ **CLI Global Timeout:**
263
+
264
+ ```bash
265
+ # 5-minute timeout for all operations
266
+ visor --timeout 300000
267
+ ```
268
+
269
+ **Provider-Specific Units:**
270
+ | Provider | Units | Default |
271
+ |----------|-------|---------|
272
+ | command | seconds | 60 |
273
+ | http_client | milliseconds | varies |
274
+ | ai | milliseconds | CLI --timeout or provider default |
275
+
276
+ **Timeout Behavior:**
277
+ - Timed-out checks fail with a timeout error
278
+ - Dependent checks are skipped with `dependency_failed` reason
279
+ - Use `continue_on_failure: true` to allow dependents to proceed anyway
280
+
281
+ For detailed timeout configuration, see [Timeouts](./timeouts.md).
282
+
283
+ ## Execution Limits
284
+
285
+ Protect against infinite loops and runaway execution with run caps.
286
+
287
+ **Global Limit:**
288
+
289
+ ```yaml
290
+ version: "1.0"
291
+
292
+ limits:
293
+ max_runs_per_check: 50 # Default, applies to all checks
294
+ ```
295
+
296
+ **Per-Check Override:**
297
+
298
+ ```yaml
299
+ steps:
300
+ retry-loop:
301
+ type: ai
302
+ max_runs: 10 # Tighter limit for this check
303
+ prompt: "Process with retry..."
304
+ on_fail:
305
+ retry:
306
+ max: 5
307
+
308
+ infinite-safe:
309
+ type: command
310
+ max_runs: 0 # Disable limit (use with caution)
311
+ exec: echo "No limit"
312
+ ```
313
+
314
+ **Behavior:**
315
+ - Counter tracked per check, per scope (for forEach items)
316
+ - Exceeding limit fails the check with `limits/max_runs_exceeded` error
317
+ - Works alongside `routing.max_loops` for comprehensive protection
318
+
319
+ For detailed limit configuration, see [Execution Limits](./limits.md).
320
+
321
+ ## Dependency-Driven Parallelism
322
+
323
+ The execution engine automatically parallelizes independent checks based on the dependency graph (DAG).
324
+
325
+ **Example:**
326
+
327
+ ```yaml
328
+ steps:
329
+ # Level 0: Run in parallel
330
+ security:
331
+ type: ai
332
+ prompt: "Security analysis..."
333
+
334
+ performance:
335
+ type: ai
336
+ prompt: "Performance analysis..."
337
+
338
+ lint:
339
+ type: command
340
+ exec: npm run lint
341
+
342
+ # Level 1: Runs after security completes
343
+ security-report:
344
+ type: ai
345
+ depends_on: [security]
346
+ prompt: "Generate security report..."
347
+
348
+ # Level 2: Runs after all of the above
349
+ final-summary:
350
+ type: ai
351
+ depends_on: [security-report, performance, lint]
352
+ prompt: "Generate final summary..."
353
+ ```
354
+
355
+ **Execution Flow:**
356
+ 1. Level 0: `security`, `performance`, `lint` run in parallel (up to max_parallelism)
357
+ 2. Level 1: `security-report` runs when `security` completes
358
+ 3. Level 2: `final-summary` runs when all dependencies complete
359
+
360
+ **Optimization Tips:**
361
+ - Structure independent checks without dependencies to maximize parallelism
362
+ - Use `depends_on` only when output from one check is needed by another
363
+ - Group related checks with shared dependencies to batch their execution
364
+
365
+ For detailed dependency configuration, see [Dependencies](./dependencies.md).
366
+
367
+ ## Cost Control Strategies
368
+
369
+ ### 1. Use Cheaper Models for Fast Checks
370
+
371
+ ```yaml
372
+ steps:
373
+ quick-lint:
374
+ type: ai
375
+ ai:
376
+ provider: google
377
+ model: gemini-1.5-flash # Faster, cheaper
378
+ prompt: "Quick syntax and style check..."
379
+ tags: [fast, cheap]
380
+
381
+ deep-security:
382
+ type: ai
383
+ ai:
384
+ provider: anthropic
385
+ model: claude-sonnet-4-20250514 # More capable, more expensive
386
+ prompt: "Comprehensive security analysis..."
387
+ tags: [comprehensive, expensive]
388
+ ```
389
+
390
+ ### 2. Session Reuse to Reduce API Calls
391
+
392
+ ```yaml
393
+ steps:
394
+ initial-analysis:
395
+ type: ai
396
+ prompt: "Analyze the codebase..."
397
+
398
+ follow-up-1:
399
+ type: ai
400
+ depends_on: [initial-analysis]
401
+ reuse_ai_session: true # Continues conversation, no new context upload
402
+ prompt: "Based on your analysis, what are the security concerns?"
403
+
404
+ follow-up-2:
405
+ type: ai
406
+ depends_on: [follow-up-1]
407
+ reuse_ai_session: true
408
+ prompt: "Suggest fixes for those concerns."
409
+ ```
410
+
411
+ ### 3. Tag-Based Selective Execution
412
+
413
+ ```yaml
414
+ # Local development: fast, cheap checks only
415
+ visor --tags fast,local
416
+
417
+ # CI on feature branches: moderate checks
418
+ visor --tags local,remote --exclude-tags comprehensive
419
+
420
+ # CI on main branch: full analysis
421
+ visor --tags comprehensive
422
+ ```
423
+
424
+ ### 4. Fail Fast with Progressive Checks
425
+
426
+ ```yaml
427
+ version: "1.0"
428
+
429
+ fail_fast: true
430
+
431
+ steps:
432
+ # Free/cheap checks first
433
+ syntax-check:
434
+ type: command
435
+ exec: npm run lint
436
+
437
+ # Moderate cost
438
+ basic-security:
439
+ type: ai
440
+ ai:
441
+ model: gemini-1.5-flash
442
+ depends_on: [syntax-check]
443
+ prompt: "Basic security scan..."
444
+
445
+ # Expensive - only if basics pass
446
+ deep-analysis:
447
+ type: ai
448
+ ai:
449
+ model: claude-sonnet-4-20250514
450
+ depends_on: [basic-security]
451
+ prompt: "Deep code analysis..."
452
+ ```
453
+
454
+ ### 5. Conditional Execution with `if`
455
+
456
+ ```yaml
457
+ steps:
458
+ expensive-check:
459
+ type: ai
460
+ if: "filesChanged.some(f => f.endsWith('.ts'))"
461
+ prompt: "TypeScript-specific analysis..."
462
+ ```
463
+
464
+ ## CI Optimization Tips
465
+
466
+ ### Cache Dependencies
467
+
468
+ ```yaml
469
+ # GitHub Actions
470
+ - uses: actions/setup-node@v4
471
+ with:
472
+ node-version: '20'
473
+ cache: npm # Cache npm dependencies
474
+ ```
475
+
476
+ ### Environment-Specific Configurations
477
+
478
+ ```yaml
479
+ # .visor.yaml - Base configuration
480
+ version: "1.0"
481
+
482
+ steps:
483
+ security:
484
+ type: ai
485
+ prompt: "Security analysis..."
486
+ tags: [security]
487
+
488
+ # .visor.ci.yaml - CI overrides
489
+ version: "1.0"
490
+ extends: .visor.yaml
491
+
492
+ max_parallelism: 5
493
+ fail_fast: true
494
+ tag_filter:
495
+ include: [security, performance]
496
+ exclude: [experimental]
497
+ ```
498
+
499
+ ```bash
500
+ # Use CI config
501
+ visor --config .visor.ci.yaml
502
+ ```
503
+
504
+ ## Related Documentation
505
+
506
+ - [Tag Filtering](./tag-filtering.md) - Detailed tag-based execution patterns
507
+ - [Advanced AI Features](./advanced-ai.md) - Session reuse and AI configuration
508
+ - [Timeouts](./timeouts.md) - Per-check and global timeout configuration
509
+ - [Execution Limits](./limits.md) - Run caps and loop protection
510
+ - [Dependencies](./dependencies.md) - Dependency graph and parallel execution
511
+ - [Configuration](./configuration.md) - Complete configuration reference
512
+ - [Failure Routing](./failure-routing.md) - Retry policies and error handling
@@ -1,6 +1,8 @@
1
- ## 🔧 Pluggable Architecture
1
+ ## Pluggable Architecture
2
2
 
3
- Visor supports multiple provider types (ai, mcp, http, http_client, log, command, github, claude-code). You can also add custom providers.
3
+ Visor supports multiple provider types. You can also add custom providers.
4
+
5
+ **Built-in Providers:** ai, mcp, command, script, http, http_input, http_client, log, memory, noop, github, human-input, workflow, git-checkout, claude-code
4
6
 
5
7
  ### Custom Provider Skeleton (TypeScript)
6
8
 
@@ -58,6 +60,21 @@ steps:
58
60
 
59
61
  [Learn more](./command-provider.md)
60
62
 
63
+ #### Script Provider (`type: script`)
64
+ Execute JavaScript in a secure sandbox with access to PR context, outputs, and memory.
65
+
66
+ ```yaml
67
+ steps:
68
+ analyze:
69
+ type: script
70
+ content: |
71
+ const issues = outputs['lint-check'] || [];
72
+ memory.set('issue_count', issues.length);
73
+ return { total: issues.length };
74
+ ```
75
+
76
+ [Learn more](./script.md)
77
+
61
78
  #### HTTP Client Provider (`type: http_client`)
62
79
  Make HTTP requests to external APIs.
63
80
 
@@ -85,18 +102,54 @@ steps:
85
102
 
86
103
  [Learn more](./http.md)
87
104
 
88
- #### Logger Provider (`type: logger`)
105
+ #### HTTP Input Provider (`type: http_input`)
106
+ Receive and process HTTP webhook input data for use by dependent checks.
107
+
108
+ ```yaml
109
+ steps:
110
+ webhook-data:
111
+ type: http_input
112
+ endpoint: /webhook/incoming
113
+ ```
114
+
115
+ [Learn more](./http.md)
116
+
117
+ #### Log Provider (`type: log`)
89
118
  Log messages for debugging and workflow visibility.
90
119
 
91
120
  ```yaml
92
121
  steps:
93
122
  debug:
94
- type: logger
123
+ type: log
95
124
  message: "PR #{{ pr.number }}: {{ fileCount }} files changed"
96
125
  ```
97
126
 
98
127
  [Learn more](./debugging.md)
99
128
 
129
+ #### Memory Provider (`type: memory`)
130
+ Persistent key-value storage across checks for stateful workflows.
131
+
132
+ ```yaml
133
+ steps:
134
+ init-counter:
135
+ type: memory
136
+ operation: set
137
+ key: retry_count
138
+ value: 0
139
+ ```
140
+
141
+ [Learn more](./memory.md)
142
+
143
+ #### Noop Provider (`type: noop`)
144
+ No-operation provider for command orchestration and dependency triggering.
145
+
146
+ ```yaml
147
+ steps:
148
+ trigger-all:
149
+ type: noop
150
+ depends_on: [check1, check2, check3]
151
+ ```
152
+
100
153
  #### GitHub Provider (`type: github`)
101
154
  Interact with GitHub API for labels, comments, and status checks.
102
155
 
@@ -110,6 +163,44 @@ steps:
110
163
 
111
164
  [Learn more](./github-ops.md)
112
165
 
166
+ #### Human Input Provider (`type: human-input`)
167
+ Pause workflow execution to request input from a human user.
168
+
169
+ ```yaml
170
+ steps:
171
+ approval:
172
+ type: human-input
173
+ prompt: "Approve deployment? (yes/no)"
174
+ ```
175
+
176
+ [Learn more](./human-input-provider.md)
177
+
178
+ #### Workflow Provider (`type: workflow`)
179
+ Execute reusable workflow definitions as steps.
180
+
181
+ ```yaml
182
+ steps:
183
+ security-scan:
184
+ type: workflow
185
+ workflow: security-scan
186
+ args:
187
+ severity_threshold: high
188
+ ```
189
+
190
+ [Learn more](./workflows.md)
191
+
192
+ #### Git Checkout Provider (`type: git-checkout`)
193
+ Checkout code from git repositories using efficient worktree management.
194
+
195
+ ```yaml
196
+ steps:
197
+ checkout:
198
+ type: git-checkout
199
+ ref: "{{ pr.head }}"
200
+ ```
201
+
202
+ [Learn more](./providers/git-checkout.md)
203
+
113
204
  #### Claude Code Provider (`type: claude-code`)
114
205
  Use Claude Code SDK with MCP tools and advanced agent capabilities.
115
206