@probelabs/visor 0.1.106 → 0.1.107
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.
- package/README.md +65 -2
- package/action.yml +1 -1
- package/defaults/code-refiner.yaml +114 -0
- package/defaults/{.visor.yaml → code-review.yaml} +35 -226
- package/defaults/override.yaml +52 -0
- package/defaults/task-refinement.yaml +620 -0
- package/defaults/visor.tests.yaml +674 -0
- package/defaults/visor.yaml +482 -0
- package/dist/663.index.js +2 -3
- package/dist/80.index.js +2 -3
- package/dist/action-cli-bridge.d.ts +11 -82
- package/dist/action-cli-bridge.d.ts.map +1 -1
- package/dist/ai-review-service.d.ts +15 -0
- package/dist/ai-review-service.d.ts.map +1 -1
- package/dist/check-execution-engine.d.ts +19 -331
- package/dist/check-execution-engine.d.ts.map +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/cron-scheduler.d.ts +3 -3
- package/dist/cron-scheduler.d.ts.map +1 -1
- package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
- package/dist/defaults/code-refiner.yaml +114 -0
- package/dist/defaults/{.visor.yaml → code-review.yaml} +35 -226
- package/dist/defaults/override.yaml +52 -0
- package/dist/defaults/task-refinement.yaml +620 -0
- package/dist/defaults/visor.tests.yaml +674 -0
- package/dist/defaults/visor.yaml +482 -0
- package/dist/docs/DEPLOYMENT.md +118 -0
- package/dist/docs/GITHUB_CHECKS.md +280 -0
- package/dist/docs/NPM_USAGE.md +208 -0
- package/dist/docs/action-reference.md +19 -0
- package/dist/docs/advanced-ai.md +178 -0
- package/dist/docs/ai-configuration.md +468 -0
- package/dist/docs/author-permissions.md +610 -0
- package/dist/docs/ci-cli-mode.md +34 -0
- package/dist/docs/claude-code.md +74 -0
- package/dist/docs/command-provider.md +559 -0
- package/dist/docs/commands.md +8 -0
- package/dist/docs/configuration.md +303 -0
- package/dist/docs/custom-tools.md +424 -0
- package/dist/docs/dashboards/README.md +23 -0
- package/dist/docs/dashboards/grafana-visor-diagrams.json +20 -0
- package/dist/docs/dashboards/grafana-visor-overview.json +33 -0
- package/dist/docs/debug-visualizer-progress.md +572 -0
- package/dist/docs/debug-visualizer-rfc.md +691 -0
- package/dist/docs/debug-visualizer.md +114 -0
- package/dist/docs/debugging.md +636 -0
- package/dist/docs/default-output-schema.md +28 -0
- package/dist/docs/dependencies.md +369 -0
- package/dist/docs/dev-playbook.md +9 -0
- package/dist/docs/engine-state-machine-plan.md +333 -0
- package/dist/docs/event-driven-github-integration-rfc.md +743 -0
- package/dist/docs/event-triggers.md +292 -0
- package/dist/docs/execution-statistics-rfc.md +290 -0
- package/dist/docs/fact-validator-gap-analysis.md +178 -0
- package/dist/docs/fact-validator-implementation-plan.md +1235 -0
- package/dist/docs/fail-if.md +95 -0
- package/dist/docs/failure-conditions-implementation.md +271 -0
- package/dist/docs/failure-conditions-schema.md +173 -0
- package/dist/docs/failure-routing-rfc.md +193 -0
- package/dist/docs/failure-routing.md +507 -0
- package/dist/docs/foreach-dependency-propagation.md +473 -0
- package/dist/docs/github-ops.md +89 -0
- package/dist/docs/goto-forward-run-plan.md +113 -0
- package/dist/docs/guides/criticality-modes.md +332 -0
- package/dist/docs/guides/fault-management-and-contracts.md +738 -0
- package/dist/docs/guides/workflow-style-guide.md +224 -0
- package/dist/docs/http.md +299 -0
- package/dist/docs/human-input-provider.md +372 -0
- package/dist/docs/limits.md +64 -0
- package/dist/docs/liquid-templates.md +347 -0
- package/dist/docs/loop-routing-refactor.md +89 -0
- package/dist/docs/mcp-provider.md +557 -0
- package/dist/docs/mcp.md +124 -0
- package/dist/docs/memory.md +903 -0
- package/dist/docs/observability.md +12 -0
- package/dist/docs/output-formats.md +20 -0
- package/dist/docs/output-formatting.md +29 -0
- package/dist/docs/output-history.md +383 -0
- package/dist/docs/performance.md +6 -0
- package/dist/docs/pluggable.md +124 -0
- package/dist/docs/proposals/snapshot-scope-execution.md +236 -0
- package/dist/docs/recipes.md +21 -0
- package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
- package/dist/docs/schema-next-pr.md +10 -0
- package/dist/docs/schema-templates.md +68 -0
- package/dist/docs/script.md +34 -0
- package/dist/docs/sdk.md +222 -0
- package/dist/docs/security.md +7 -0
- package/dist/docs/suppressions.md +89 -0
- package/dist/docs/tag-filtering.md +258 -0
- package/dist/docs/telemetry-setup.md +119 -0
- package/dist/docs/telemetry-tracing-rfc.md +275 -0
- package/dist/docs/test-framework-rfc.md +680 -0
- package/dist/docs/testing/assertions.md +85 -0
- package/dist/docs/testing/ci.md +44 -0
- package/dist/docs/testing/cli.md +41 -0
- package/dist/docs/testing/cookbook.md +172 -0
- package/dist/docs/testing/dsl-reference.md +199 -0
- package/dist/docs/testing/fixtures-and-mocks.md +91 -0
- package/dist/docs/testing/flows.md +92 -0
- package/dist/docs/testing/getting-started.md +93 -0
- package/dist/docs/testing/troubleshooting.md +55 -0
- package/dist/docs/timeouts.md +50 -0
- package/dist/docs/troubleshooting.md +7 -0
- package/dist/docs/visor-sdk-rfc.md +186 -0
- package/dist/docs/workflows.md +569 -0
- package/dist/engine/on-finish/orchestrator.d.ts +19 -0
- package/dist/engine/on-finish/orchestrator.d.ts.map +1 -0
- package/dist/engine/on-finish/utils.d.ts +44 -0
- package/dist/engine/on-finish/utils.d.ts.map +1 -0
- package/dist/event-bus/event-bus.d.ts +13 -0
- package/dist/event-bus/event-bus.d.ts.map +1 -0
- package/dist/event-bus/types.d.ts +57 -0
- package/dist/event-bus/types.d.ts.map +1 -0
- package/dist/examples/.claude/agents/code-reviewer.md +69 -0
- package/dist/examples/.mcp.json +34 -0
- package/dist/examples/CALCULATOR-SDK.md +364 -0
- package/dist/examples/README.md +384 -0
- package/dist/examples/ai-retry-fallback-config.yaml +180 -0
- package/dist/examples/ai-with-bash.yaml +126 -0
- package/dist/examples/ai-with-mcp.yaml +82 -0
- package/dist/examples/basic-human-input.yaml +15 -0
- package/dist/examples/bedrock-config.yaml +77 -0
- package/dist/examples/calculator-config.yaml +133 -0
- package/dist/examples/calculator-json-output-guide.md +311 -0
- package/dist/examples/calculator-sdk-automated.ts +340 -0
- package/dist/examples/calculator-sdk-example.ts +275 -0
- package/dist/examples/calculator-sdk-json.ts +331 -0
- package/dist/examples/calculator-sdk-real.ts +374 -0
- package/dist/examples/calculator-sdk-test.ts +148 -0
- package/dist/examples/claude-code-config.yaml +191 -0
- package/dist/examples/cron-webhook-config.yaml +215 -0
- package/dist/examples/custom-template.liquid +57 -0
- package/dist/examples/custom-tools-example.yaml +281 -0
- package/dist/examples/enhanced-config.yaml +165 -0
- package/dist/examples/environments/visor.base.yaml +92 -0
- package/dist/examples/environments/visor.dev.yaml +33 -0
- package/dist/examples/environments/visor.prod.yaml +95 -0
- package/dist/examples/environments/visor.staging.yaml +46 -0
- package/dist/examples/fact-validator.yaml +361 -0
- package/dist/examples/fail-if-simple.yaml +90 -0
- package/dist/examples/failure-conditions-advanced.yaml +136 -0
- package/dist/examples/failure-conditions-basic.yaml +48 -0
- package/dist/examples/failure-conditions-github-style.yaml +119 -0
- package/dist/examples/failure-conditions-migration.yaml +74 -0
- package/dist/examples/for-loop-example.yaml +176 -0
- package/dist/examples/forEach-example.yaml +120 -0
- package/dist/examples/github-workflow-with-tags.yml +163 -0
- package/dist/examples/http-integration-config.yaml +240 -0
- package/dist/examples/https-server-config.yaml +209 -0
- package/dist/examples/human-input-example.yaml +63 -0
- package/dist/examples/if-conditions.yaml +173 -0
- package/dist/examples/jira-simple-example.yaml +56 -0
- package/dist/examples/jira-single-issue-workflow.yaml +166 -0
- package/dist/examples/jira-workflow-mcp.yaml +182 -0
- package/dist/examples/mcp/analyzer.py +119 -0
- package/dist/examples/mcp-provider-example.yaml +301 -0
- package/dist/examples/memory-counter.yaml +99 -0
- package/dist/examples/memory-error-collection.yaml +104 -0
- package/dist/examples/memory-exec-js.yaml +247 -0
- package/dist/examples/memory-namespace-isolation.yaml +184 -0
- package/dist/examples/memory-retry-counter.yaml +65 -0
- package/dist/examples/memory-state-machine.yaml +170 -0
- package/dist/examples/outputs-raw-basic.yaml +26 -0
- package/dist/examples/project-with-tools.yaml +174 -0
- package/dist/examples/prompts/architecture-analysis.liquid +116 -0
- package/dist/examples/prompts/security-comprehensive.liquid +107 -0
- package/dist/examples/quick-start-tags.yaml +53 -0
- package/dist/examples/routing-basic.yaml +35 -0
- package/dist/examples/routing-dynamic-js.yaml +46 -0
- package/dist/examples/routing-foreach.yaml +34 -0
- package/dist/examples/routing-goto-event.yaml +34 -0
- package/dist/examples/routing-on-success.yaml +25 -0
- package/dist/examples/run-calculator-demo.sh +71 -0
- package/dist/examples/sdk-basic.mjs +10 -0
- package/dist/examples/sdk-cjs.cjs +10 -0
- package/dist/examples/sdk-comprehensive.mjs +175 -0
- package/dist/examples/sdk-manual-config.mjs +65 -0
- package/dist/examples/sdk-typescript.js +81 -0
- package/dist/examples/sdk-typescript.ts +92 -0
- package/dist/examples/session-reuse-config.yaml +151 -0
- package/dist/examples/templates/security-report.liquid +137 -0
- package/dist/examples/tools-library.yaml +281 -0
- package/dist/examples/transform-example.yaml +199 -0
- package/dist/examples/visor-with-tags.yaml +198 -0
- package/dist/examples/webhook-pipeline-config.yaml +218 -0
- package/dist/examples/workflows/calculator-workflow.yaml +163 -0
- package/dist/examples/workflows/code-quality.yaml +222 -0
- package/dist/examples/workflows/quick-pr-check.yaml +90 -0
- package/dist/examples/workflows/workflow-composition-example.yaml +130 -0
- package/dist/failure-condition-evaluator.d.ts +1 -0
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/frontends/github-frontend.d.ts +38 -0
- package/dist/frontends/github-frontend.d.ts.map +1 -0
- package/dist/frontends/host.d.ts +43 -0
- package/dist/frontends/host.d.ts.map +1 -0
- package/dist/frontends/ndjson-sink.d.ts +12 -0
- package/dist/frontends/ndjson-sink.d.ts.map +1 -0
- package/dist/generated/config-schema.d.ts +564 -22
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +612 -24
- package/dist/github-check-service.d.ts +4 -6
- package/dist/github-check-service.d.ts.map +1 -1
- package/dist/github-comments.d.ts +0 -4
- package/dist/github-comments.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70335 -62514
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/memory-store.d.ts +6 -0
- package/dist/memory-store.d.ts.map +1 -1
- package/dist/output/assistant-json/template.liquid +0 -0
- package/dist/output/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
- package/dist/output/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
- package/dist/output-formatters.d.ts +1 -1
- package/dist/output-formatters.d.ts.map +1 -1
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/check-provider-registry.d.ts +6 -0
- package/dist/providers/check-provider-registry.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts +34 -1
- package/dist/providers/check-provider.interface.d.ts.map +1 -1
- package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/custom-tool-executor.d.ts +61 -0
- package/dist/providers/custom-tool-executor.d.ts.map +1 -0
- package/dist/providers/github-ops-provider.d.ts.map +1 -1
- package/dist/providers/http-client-provider.d.ts +1 -4
- package/dist/providers/http-client-provider.d.ts.map +1 -1
- package/dist/providers/human-input-check-provider.d.ts +3 -0
- package/dist/providers/human-input-check-provider.d.ts.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/log-check-provider.d.ts +2 -5
- package/dist/providers/log-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-check-provider.d.ts +9 -3
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/memory-check-provider.d.ts +2 -8
- package/dist/providers/memory-check-provider.d.ts.map +1 -1
- package/dist/providers/script-check-provider.d.ts +25 -0
- package/dist/providers/script-check-provider.d.ts.map +1 -0
- package/dist/providers/workflow-check-provider.d.ts +56 -0
- package/dist/providers/workflow-check-provider.d.ts.map +1 -0
- package/dist/reviewer.d.ts +2 -1
- package/dist/reviewer.d.ts.map +1 -1
- package/dist/sdk/chunk-37ZSCMFC.mjs +482 -0
- package/dist/sdk/chunk-37ZSCMFC.mjs.map +1 -0
- package/dist/sdk/chunk-6Y4YTKCF.mjs +197 -0
- package/dist/sdk/chunk-6Y4YTKCF.mjs.map +1 -0
- package/dist/sdk/chunk-CNX7V5JK.mjs +89 -0
- package/dist/sdk/chunk-CNX7V5JK.mjs.map +1 -0
- package/dist/sdk/chunk-IEO6CFLG.mjs +1215 -0
- package/dist/sdk/chunk-IEO6CFLG.mjs.map +1 -0
- package/dist/sdk/chunk-JEHPDJIF.mjs +223 -0
- package/dist/sdk/chunk-JEHPDJIF.mjs.map +1 -0
- package/dist/sdk/chunk-O5EZDNYL.mjs +274 -0
- package/dist/sdk/chunk-O5EZDNYL.mjs.map +1 -0
- package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-OOZITMRU.mjs} +1 -1
- package/dist/sdk/chunk-OOZITMRU.mjs.map +1 -0
- package/dist/sdk/chunk-OWUVOILT.mjs +557 -0
- package/dist/sdk/chunk-OWUVOILT.mjs.map +1 -0
- package/dist/sdk/chunk-OZJ263FM.mjs +986 -0
- package/dist/sdk/chunk-OZJ263FM.mjs.map +1 -0
- package/dist/sdk/chunk-PTL3K3PN.mjs +3128 -0
- package/dist/sdk/chunk-PTL3K3PN.mjs.map +1 -0
- package/dist/sdk/chunk-S2RUE2RG.mjs +145 -0
- package/dist/sdk/chunk-S2RUE2RG.mjs.map +1 -0
- package/dist/sdk/chunk-VMPLF6FT.mjs +127 -0
- package/dist/sdk/chunk-VMPLF6FT.mjs.map +1 -0
- package/dist/sdk/chunk-YSN4G6CI.mjs +146 -0
- package/dist/sdk/chunk-YSN4G6CI.mjs.map +1 -0
- package/dist/sdk/chunk-ZYAUYXSW.mjs +206 -0
- package/dist/sdk/chunk-ZYAUYXSW.mjs.map +1 -0
- package/dist/sdk/config-M4ZNO6NU.mjs +14 -0
- package/dist/sdk/config-merger-PX3WIT57.mjs +10 -0
- package/dist/sdk/event-bus-5BEVPQ6T.mjs +35 -0
- package/dist/sdk/event-bus-5BEVPQ6T.mjs.map +1 -0
- package/dist/sdk/failure-condition-evaluator-NBO5YRXW.mjs +16 -0
- package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs +458 -0
- package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs.map +1 -0
- package/dist/sdk/github-frontend-4AWRJT7D.mjs +1242 -0
- package/dist/sdk/github-frontend-4AWRJT7D.mjs.map +1 -0
- package/dist/sdk/host-7GBC3S7L.mjs +49 -0
- package/dist/sdk/host-7GBC3S7L.mjs.map +1 -0
- package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-C7EG3YKH.mjs} +7 -2
- package/dist/sdk/memory-store-GJACZC2A.mjs +11 -0
- package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
- package/dist/sdk/renderer-schema-6RF26VUS.mjs +50 -0
- package/dist/sdk/renderer-schema-6RF26VUS.mjs.map +1 -0
- package/dist/sdk/routing-RP56JTV2.mjs +23 -0
- package/dist/sdk/routing-RP56JTV2.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +326 -21
- package/dist/sdk/sdk.d.ts +326 -21
- package/dist/sdk/sdk.js +21403 -16366
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +13510 -2096
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/session-registry-N5FFYFTM.mjs +10 -0
- package/dist/sdk/session-registry-N5FFYFTM.mjs.map +1 -0
- package/dist/sdk/trace-helpers-VP6QYVBX.mjs +23 -0
- package/dist/sdk/trace-helpers-VP6QYVBX.mjs.map +1 -0
- package/dist/sdk/{tracer-init-WC75N5NW.mjs → tracer-init-WP4X46IF.mjs} +2 -2
- package/dist/sdk/tracer-init-WP4X46IF.mjs.map +1 -0
- package/dist/sdk/workflow-registry-2YIIXQCK.mjs +11 -0
- package/dist/sdk/workflow-registry-2YIIXQCK.mjs.map +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/snapshot-store.d.ts +59 -0
- package/dist/snapshot-store.d.ts.map +1 -0
- package/dist/state-machine/context/build-engine-context.d.ts +9 -0
- package/dist/state-machine/context/build-engine-context.d.ts.map +1 -0
- package/dist/state-machine/dispatch/dependency-gating.d.ts +12 -0
- package/dist/state-machine/dispatch/dependency-gating.d.ts.map +1 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts +14 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -0
- package/dist/state-machine/dispatch/foreach-processor.d.ts +8 -0
- package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -0
- package/dist/state-machine/dispatch/history-snapshot.d.ts +8 -0
- package/dist/state-machine/dispatch/history-snapshot.d.ts.map +1 -0
- package/dist/state-machine/dispatch/renderer-schema.d.ts +8 -0
- package/dist/state-machine/dispatch/renderer-schema.d.ts.map +1 -0
- package/dist/state-machine/dispatch/stats-manager.d.ts +15 -0
- package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -0
- package/dist/state-machine/dispatch/template-renderer.d.ts +7 -0
- package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -0
- package/dist/state-machine/execution/summary.d.ts +8 -0
- package/dist/state-machine/execution/summary.d.ts.map +1 -0
- package/dist/state-machine/runner.d.ts +73 -0
- package/dist/state-machine/runner.d.ts.map +1 -0
- package/dist/state-machine/states/check-running.d.ts +14 -0
- package/dist/state-machine/states/check-running.d.ts.map +1 -0
- package/dist/state-machine/states/completed.d.ts +12 -0
- package/dist/state-machine/states/completed.d.ts.map +1 -0
- package/dist/state-machine/states/error.d.ts +11 -0
- package/dist/state-machine/states/error.d.ts.map +1 -0
- package/dist/state-machine/states/init.d.ts +11 -0
- package/dist/state-machine/states/init.d.ts.map +1 -0
- package/dist/state-machine/states/level-dispatch.d.ts +17 -0
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -0
- package/dist/state-machine/states/plan-ready.d.ts +12 -0
- package/dist/state-machine/states/plan-ready.d.ts.map +1 -0
- package/dist/state-machine/states/routing.d.ts +52 -0
- package/dist/state-machine/states/routing.d.ts.map +1 -0
- package/dist/state-machine/states/wave-planning.d.ts +14 -0
- package/dist/state-machine/states/wave-planning.d.ts.map +1 -0
- package/dist/state-machine/workflow-projection.d.ts +47 -0
- package/dist/state-machine/workflow-projection.d.ts.map +1 -0
- package/dist/state-machine-execution-engine.d.ts +147 -0
- package/dist/state-machine-execution-engine.d.ts.map +1 -0
- package/dist/telemetry/opentelemetry.d.ts.map +1 -1
- package/dist/test-runner/assertions.d.ts +59 -0
- package/dist/test-runner/assertions.d.ts.map +1 -0
- package/dist/test-runner/core/environment.d.ts +8 -0
- package/dist/test-runner/core/environment.d.ts.map +1 -0
- package/dist/test-runner/core/fixture.d.ts +3 -0
- package/dist/test-runner/core/fixture.d.ts.map +1 -0
- package/dist/test-runner/core/flow-stage.d.ts +32 -0
- package/dist/test-runner/core/flow-stage.d.ts.map +1 -0
- package/dist/test-runner/core/mocks.d.ts +8 -0
- package/dist/test-runner/core/mocks.d.ts.map +1 -0
- package/dist/test-runner/core/test-execution-wrapper.d.ts +18 -0
- package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -0
- package/dist/test-runner/evaluators.d.ts +12 -0
- package/dist/test-runner/evaluators.d.ts.map +1 -0
- package/dist/test-runner/fixture-loader.d.ts +30 -0
- package/dist/test-runner/fixture-loader.d.ts.map +1 -0
- package/dist/test-runner/index.d.ts +120 -0
- package/dist/test-runner/index.d.ts.map +1 -0
- package/dist/test-runner/recorders/github-recorder.d.ts +23 -0
- package/dist/test-runner/recorders/github-recorder.d.ts.map +1 -0
- package/dist/test-runner/recorders/global-recorder.d.ts +4 -0
- package/dist/test-runner/recorders/global-recorder.d.ts.map +1 -0
- package/dist/test-runner/utils/selectors.d.ts +2 -0
- package/dist/test-runner/utils/selectors.d.ts.map +1 -0
- package/dist/test-runner/validator.d.ts +8 -0
- package/dist/test-runner/validator.d.ts.map +1 -0
- package/dist/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
- package/dist/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
- package/dist/types/cli.d.ts +4 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +278 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts +172 -0
- package/dist/types/engine.d.ts.map +1 -0
- package/dist/types/execution.d.ts +73 -0
- package/dist/types/execution.d.ts.map +1 -0
- package/dist/types/github.d.ts +51 -0
- package/dist/types/github.d.ts.map +1 -0
- package/dist/types/workflow.d.ts +237 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/utils/command-executor.d.ts +43 -0
- package/dist/utils/command-executor.d.ts.map +1 -0
- package/dist/utils/comment-metadata.d.ts +21 -0
- package/dist/utils/comment-metadata.d.ts.map +1 -0
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-merger.d.ts.map +1 -1
- package/dist/utils/env-exposure.d.ts +3 -0
- package/dist/utils/env-exposure.d.ts.map +1 -0
- package/dist/utils/file-exclusion.d.ts.map +1 -1
- package/dist/utils/interactive-prompt.d.ts +1 -1
- package/dist/utils/interactive-prompt.d.ts.map +1 -1
- package/dist/utils/sandbox.d.ts.map +1 -1
- package/dist/utils/script-memory-ops.d.ts +21 -0
- package/dist/utils/script-memory-ops.d.ts.map +1 -0
- package/dist/utils/template-context.d.ts +7 -0
- package/dist/utils/template-context.d.ts.map +1 -0
- package/dist/webhook-server.d.ts +3 -3
- package/dist/webhook-server.d.ts.map +1 -1
- package/dist/workflow-executor.d.ts +81 -0
- package/dist/workflow-executor.d.ts.map +1 -0
- package/dist/workflow-registry.d.ts +79 -0
- package/dist/workflow-registry.d.ts.map +1 -0
- package/package.json +10 -5
- package/dist/output/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
- package/dist/sdk/check-execution-engine-2YYKUUSH.mjs +0 -11
- package/dist/sdk/check-execution-engine-6QJXYYON.mjs +0 -11
- package/dist/sdk/check-execution-engine-PJZ4ZOKG.mjs +0 -11
- package/dist/sdk/chunk-33QVZ2D4.mjs +0 -316
- package/dist/sdk/chunk-33QVZ2D4.mjs.map +0 -1
- package/dist/sdk/chunk-B5QBV2QJ.mjs +0 -752
- package/dist/sdk/chunk-B5QBV2QJ.mjs.map +0 -1
- package/dist/sdk/chunk-BVFNRCHT.mjs +0 -14129
- package/dist/sdk/chunk-BVFNRCHT.mjs.map +0 -1
- package/dist/sdk/chunk-KWZW23FG.mjs +0 -14129
- package/dist/sdk/chunk-KWZW23FG.mjs.map +0 -1
- package/dist/sdk/chunk-O4RP4BRH.mjs +0 -14092
- package/dist/sdk/chunk-O4RP4BRH.mjs.map +0 -1
- package/dist/sdk/chunk-TUTOLSFV.mjs.map +0 -1
- package/dist/sdk/chunk-U5D2LY66.mjs +0 -245
- package/dist/sdk/chunk-U5D2LY66.mjs.map +0 -1
- package/dist/sdk/chunk-U7X54EMV.mjs +0 -331
- package/dist/sdk/chunk-U7X54EMV.mjs.map +0 -1
- package/dist/sdk/config-merger-TWUBWFC2.mjs +0 -8
- package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs +0 -61
- package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs.map +0 -1
- package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs +0 -61
- package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs.map +0 -1
- package/dist/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
- /package/dist/sdk/{check-execution-engine-2YYKUUSH.mjs.map → config-M4ZNO6NU.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → failure-condition-evaluator-NBO5YRXW.mjs.map} +0 -0
- /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → liquid-extensions-C7EG3YKH.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → memory-store-GJACZC2A.mjs.map} +0 -0
- /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → metrics-7PP3EJUH.mjs.map} +0 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
# Visor Examples
|
|
2
|
+
|
|
3
|
+
This directory contains SDK examples (programmatic usage) and configuration examples (YAML files).
|
|
4
|
+
|
|
5
|
+
## 🚀 SDK Examples (Programmatic Usage)
|
|
6
|
+
|
|
7
|
+
Use Visor from Node.js without shelling out.
|
|
8
|
+
|
|
9
|
+
### Running SDK Examples
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Build SDK first
|
|
13
|
+
npm run build:sdk
|
|
14
|
+
|
|
15
|
+
# Basic SDK examples
|
|
16
|
+
node examples/sdk-basic.mjs # Minimal (5 lines)
|
|
17
|
+
node examples/sdk-cjs.cjs # CommonJS
|
|
18
|
+
node examples/sdk-manual-config.mjs # Manual config
|
|
19
|
+
node examples/sdk-comprehensive.mjs # Complex with dependencies
|
|
20
|
+
|
|
21
|
+
# TypeScript (full type safety with SDK types)
|
|
22
|
+
npx tsc examples/sdk-typescript.ts --module esnext --target es2022 --moduleResolution bundler --esModuleInterop --skipLibCheck && node examples/sdk-typescript.js
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 🧮 Human-Input Calculator Examples
|
|
26
|
+
|
|
27
|
+
Interactive calculator demonstrating human-in-the-loop workflows:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Interactive calculator with table output
|
|
31
|
+
bun examples/calculator-sdk-real.ts
|
|
32
|
+
|
|
33
|
+
# Calculator with JSON output (programmatic processing)
|
|
34
|
+
bun examples/calculator-sdk-json.ts
|
|
35
|
+
|
|
36
|
+
# Fully automated calculator (for testing/automation)
|
|
37
|
+
bun examples/calculator-sdk-automated.ts
|
|
38
|
+
bun examples/calculator-sdk-automated.ts 10 5 + # With args
|
|
39
|
+
|
|
40
|
+
# YAML config version
|
|
41
|
+
./dist/index.js --config examples/calculator-config.yaml --message "10" --check get-number1
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Features demonstrated:**
|
|
45
|
+
- ✅ Human input via `human-input` check type
|
|
46
|
+
- ✅ Memory provider for state management
|
|
47
|
+
- ✅ JavaScript execution in memory provider
|
|
48
|
+
- ✅ Dependency chains with fail_if validation
|
|
49
|
+
- ✅ JSON output for programmatic processing
|
|
50
|
+
- ✅ Custom visualization in SDK scripts
|
|
51
|
+
- ✅ Suppressing stdout/stderr for clean JSON responses
|
|
52
|
+
|
|
53
|
+
See `docs/sdk.md` for full SDK documentation.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 📝 Configuration Examples (YAML)
|
|
58
|
+
|
|
59
|
+
Example configurations demonstrating various Visor features and use cases.
|
|
60
|
+
|
|
61
|
+
## 📁 Files Overview
|
|
62
|
+
|
|
63
|
+
### Basic Examples
|
|
64
|
+
- **`quick-start-tags.yaml`** - Simple configuration showing basic tag usage
|
|
65
|
+
- **`visor-with-tags.yaml`** - Comprehensive configuration with all tag features
|
|
66
|
+
- **`routing-basic.yaml`** - Failure routing with retry + goto ancestor
|
|
67
|
+
- **`routing-on-success.yaml`** - on_success post-steps + single jump-back
|
|
68
|
+
- **`routing-foreach.yaml`** - forEach remediation with run + retry
|
|
69
|
+
- **`routing-dynamic-js.yaml`** - Dynamic routing via goto_js/run_js
|
|
70
|
+
|
|
71
|
+
### GitHub Actions Workflows
|
|
72
|
+
- **`github-workflow-with-tags.yml`** - Progressive code review workflow using tags
|
|
73
|
+
|
|
74
|
+
### Environment Configurations
|
|
75
|
+
- **`environments/visor.base.yaml`** - Base configuration with all check definitions
|
|
76
|
+
- **`environments/visor.dev.yaml`** - Development environment (fast, local checks)
|
|
77
|
+
- **`environments/visor.staging.yaml`** - Staging environment (balanced checks)
|
|
78
|
+
- **`environments/visor.prod.yaml`** - Production environment (comprehensive validation)
|
|
79
|
+
|
|
80
|
+
## 🚀 Quick Start
|
|
81
|
+
|
|
82
|
+
### 1. Basic Tag Usage
|
|
83
|
+
|
|
84
|
+
Start with the simple configuration:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Copy the quick-start example
|
|
88
|
+
cp examples/quick-start-tags.yaml .visor.yaml
|
|
89
|
+
|
|
90
|
+
# Run local checks
|
|
91
|
+
visor --tags local,fast
|
|
92
|
+
|
|
93
|
+
# Run comprehensive checks
|
|
94
|
+
visor --tags remote,comprehensive
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 2. Environment-Based Configuration
|
|
98
|
+
|
|
99
|
+
Use different configurations for different environments:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Development
|
|
103
|
+
visor --config examples/environments/visor.dev.yaml
|
|
104
|
+
|
|
105
|
+
# Staging
|
|
106
|
+
visor --config examples/environments/visor.staging.yaml
|
|
107
|
+
|
|
108
|
+
# Production
|
|
109
|
+
visor --config examples/environments/visor.prod.yaml
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 3. GitHub Actions Integration
|
|
113
|
+
|
|
114
|
+
Copy the workflow to your repository:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
cp examples/github-workflow-with-tags.yml .github/workflows/code-review.yml
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 🏷️ Tag Strategy Guide
|
|
121
|
+
|
|
122
|
+
### Recommended Tag Taxonomy
|
|
123
|
+
|
|
124
|
+
#### Environment Tags
|
|
125
|
+
- `local` - Runs on developer machines
|
|
126
|
+
- `remote` - Runs in CI/CD
|
|
127
|
+
- `dev` - Development environment
|
|
128
|
+
- `staging` - Staging environment
|
|
129
|
+
- `prod` - Production environment
|
|
130
|
+
|
|
131
|
+
#### Speed Tags
|
|
132
|
+
- `fast` - Completes in < 30 seconds
|
|
133
|
+
- `slow` - Takes > 30 seconds
|
|
134
|
+
- `comprehensive` - Thorough but time-consuming
|
|
135
|
+
|
|
136
|
+
#### Category Tags
|
|
137
|
+
- `security` - Security-related checks
|
|
138
|
+
- `performance` - Performance analysis
|
|
139
|
+
- `quality` - Code quality and style
|
|
140
|
+
- `testing` - Test-related checks
|
|
141
|
+
- `documentation` - Documentation checks
|
|
142
|
+
|
|
143
|
+
#### Priority Tags
|
|
144
|
+
- `critical` - Must pass for deployment
|
|
145
|
+
- `optional` - Nice to have but not blocking
|
|
146
|
+
- `experimental` - Beta features
|
|
147
|
+
|
|
148
|
+
### Tag Combination Examples
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Fast security checks for local development
|
|
152
|
+
visor --tags local,fast,security
|
|
153
|
+
|
|
154
|
+
# All critical checks for production
|
|
155
|
+
visor --tags prod,critical
|
|
156
|
+
|
|
157
|
+
# Comprehensive review excluding experimental
|
|
158
|
+
visor --tags comprehensive --exclude-tags experimental
|
|
159
|
+
|
|
160
|
+
# Just the essentials
|
|
161
|
+
visor --tags critical,fast
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## 📊 Execution Profiles
|
|
165
|
+
|
|
166
|
+
### Profile 1: Developer (Local)
|
|
167
|
+
```yaml
|
|
168
|
+
tag_filter:
|
|
169
|
+
include: ["local", "fast"]
|
|
170
|
+
exclude: ["slow", "experimental"]
|
|
171
|
+
```
|
|
172
|
+
- **Goal**: Quick feedback during development
|
|
173
|
+
- **Runtime**: < 1 minute
|
|
174
|
+
- **Use Case**: Pre-commit hooks, local testing
|
|
175
|
+
|
|
176
|
+
### Profile 2: Pull Request (CI)
|
|
177
|
+
```yaml
|
|
178
|
+
tag_filter:
|
|
179
|
+
include: ["remote", "critical"]
|
|
180
|
+
exclude: ["experimental"]
|
|
181
|
+
```
|
|
182
|
+
- **Goal**: Validate changes before merge
|
|
183
|
+
- **Runtime**: 2-5 minutes
|
|
184
|
+
- **Use Case**: GitHub Actions on PR
|
|
185
|
+
|
|
186
|
+
### Profile 3: Pre-Production (Staging)
|
|
187
|
+
```yaml
|
|
188
|
+
tag_filter:
|
|
189
|
+
include: ["staging", "comprehensive"]
|
|
190
|
+
exclude: ["experimental", "optional"]
|
|
191
|
+
```
|
|
192
|
+
- **Goal**: Thorough validation before production
|
|
193
|
+
- **Runtime**: 5-10 minutes
|
|
194
|
+
- **Use Case**: Staging deployment pipeline
|
|
195
|
+
|
|
196
|
+
### Profile 4: Production Release
|
|
197
|
+
```yaml
|
|
198
|
+
tag_filter:
|
|
199
|
+
include: ["prod", "critical", "comprehensive"]
|
|
200
|
+
exclude: ["experimental"]
|
|
201
|
+
```
|
|
202
|
+
- **Goal**: Maximum confidence for production
|
|
203
|
+
- **Runtime**: 10+ minutes
|
|
204
|
+
- **Use Case**: Production deployment gate
|
|
205
|
+
|
|
206
|
+
## 🔧 Advanced Patterns
|
|
207
|
+
|
|
208
|
+
### Pattern 1: Progressive Enhancement
|
|
209
|
+
|
|
210
|
+
Start with fast checks and progressively run more comprehensive ones:
|
|
211
|
+
|
|
212
|
+
```yaml
|
|
213
|
+
# Stage 1: Critical issues (fail fast)
|
|
214
|
+
visor --tags critical,fast --fail-fast
|
|
215
|
+
|
|
216
|
+
# Stage 2: Security scan (if stage 1 passes)
|
|
217
|
+
visor --tags security --exclude-tags fast
|
|
218
|
+
|
|
219
|
+
# Stage 3: Comprehensive review (if all pass)
|
|
220
|
+
visor --tags comprehensive --exclude-tags security,critical
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Pattern 2: Conditional Execution
|
|
224
|
+
|
|
225
|
+
Run checks based on file changes:
|
|
226
|
+
|
|
227
|
+
```yaml
|
|
228
|
+
steps:
|
|
229
|
+
frontend-checks:
|
|
230
|
+
tags: ["frontend", "conditional"]
|
|
231
|
+
on: [pr_opened]
|
|
232
|
+
if: "filesChanged.some(f => f.endsWith('.tsx'))"
|
|
233
|
+
|
|
234
|
+
backend-checks:
|
|
235
|
+
tags: ["backend", "conditional"]
|
|
236
|
+
on: [pr_opened]
|
|
237
|
+
if: "filesChanged.some(f => f.endsWith('.py'))"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Pattern 3: Dependency Chains with Tags
|
|
241
|
+
|
|
242
|
+
```yaml
|
|
243
|
+
steps:
|
|
244
|
+
quick-scan:
|
|
245
|
+
tags: ["local", "fast"]
|
|
246
|
+
|
|
247
|
+
deep-scan:
|
|
248
|
+
tags: ["remote", "slow"]
|
|
249
|
+
depends_on: [quick-scan] # Only if quick-scan is included
|
|
250
|
+
|
|
251
|
+
report:
|
|
252
|
+
tags: ["reporting"]
|
|
253
|
+
depends_on: [quick-scan, deep-scan] # Uses whatever ran
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## 🎯 Best Practices
|
|
257
|
+
|
|
258
|
+
1. **Start Simple**: Begin with `local`/`remote` or `fast`/`slow`
|
|
259
|
+
2. **Be Consistent**: Use the same tags across all projects
|
|
260
|
+
3. **Document Tags**: Maintain a tag glossary in your docs
|
|
261
|
+
4. **Review Regularly**: Audit and update tags as needs change
|
|
262
|
+
5. **Measure Impact**: Track execution times and adjust tags accordingly
|
|
263
|
+
|
|
264
|
+
## 💡 Tips
|
|
265
|
+
|
|
266
|
+
- Use `visor --help` to see all available options
|
|
267
|
+
- Combine `--tags` and `--exclude-tags` for precise control
|
|
268
|
+
- Set default `tag_filter` in config to avoid repetition
|
|
269
|
+
- Use environment-specific configs with `extends` for DRY principles
|
|
270
|
+
- Test tag filters with `--debug` to see which checks run
|
|
271
|
+
|
|
272
|
+
## 📚 Further Reading
|
|
273
|
+
|
|
274
|
+
- [Main README](../README.md) - Complete Visor documentation
|
|
275
|
+
- [Configuration Guide](../docs/configuration.md) - Detailed config options
|
|
276
|
+
- [GitHub Actions Guide](../docs/github-actions.md) - CI/CD integration
|
|
277
|
+
### 4. Human Input Examples
|
|
278
|
+
|
|
279
|
+
Interactive workflows with human-in-the-loop:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Basic human input patterns
|
|
283
|
+
visor --config examples/human-input-example.yaml
|
|
284
|
+
|
|
285
|
+
# Interactive calculator (demonstrates memory + JS + human input)
|
|
286
|
+
visor --config examples/calculator-config.yaml
|
|
287
|
+
|
|
288
|
+
# Run with inline message
|
|
289
|
+
visor --config examples/human-input-example.yaml --check approval-gate --message "yes"
|
|
290
|
+
|
|
291
|
+
# Run with file input (auto-detected)
|
|
292
|
+
echo "yes" > approval.txt
|
|
293
|
+
visor --config examples/human-input-example.yaml --check approval-gate --message approval.txt
|
|
294
|
+
|
|
295
|
+
# Run with piped input
|
|
296
|
+
echo "yes" | visor --config examples/human-input-example.yaml --check approval-gate
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**Calculator Example:**
|
|
300
|
+
The calculator demonstrates a complete workflow:
|
|
301
|
+
1. Prompts for first number
|
|
302
|
+
2. Prompts for second number
|
|
303
|
+
3. Prompts for operation (+, -, *, /)
|
|
304
|
+
4. Stores values in memory
|
|
305
|
+
5. Calculates result using JavaScript
|
|
306
|
+
6. Displays formatted result
|
|
307
|
+
|
|
308
|
+
**SDK Usage:**
|
|
309
|
+
|
|
310
|
+
Two SDK examples are provided:
|
|
311
|
+
|
|
312
|
+
1. **`calculator-sdk-real.ts`** - Complete, runnable SDK example:
|
|
313
|
+
- Real imports from Visor SDK
|
|
314
|
+
- Config defined inline (no YAML needed)
|
|
315
|
+
- Custom readline-based input hook
|
|
316
|
+
- Full CheckExecutionEngine usage
|
|
317
|
+
- Works in interactive or automated mode
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# Interactive mode
|
|
321
|
+
ts-node examples/calculator-sdk-real.ts
|
|
322
|
+
|
|
323
|
+
# Automated mode (for testing)
|
|
324
|
+
ts-node examples/calculator-sdk-real.ts 42 7 +
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
2. **`calculator-sdk-example.ts`** - Documentation/template example:
|
|
328
|
+
- Shows the structure and patterns
|
|
329
|
+
- Includes comments and explanations
|
|
330
|
+
- Generates YAML config for CLI usage
|
|
331
|
+
|
|
332
|
+
**SDK Pattern:**
|
|
333
|
+
```typescript
|
|
334
|
+
import { HumanInputCheckProvider } from '../src/providers/human-input-check-provider';
|
|
335
|
+
import { CheckExecutionEngine } from '../src/check-execution-engine';
|
|
336
|
+
import { VisorConfig } from '../src/types/config';
|
|
337
|
+
|
|
338
|
+
// Define config inline
|
|
339
|
+
const config: VisorConfig = {
|
|
340
|
+
version: "1.0",
|
|
341
|
+
checks: {
|
|
342
|
+
"my-check": {
|
|
343
|
+
type: "human-input",
|
|
344
|
+
prompt: "Enter value:"
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
output: { pr_comment: { format: "markdown", group_by: "check", collapse: false } }
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
// Set custom hook
|
|
351
|
+
HumanInputCheckProvider.setHooks({
|
|
352
|
+
onHumanInput: async (request) => {
|
|
353
|
+
return await myCustomHandler(request);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
// Run checks
|
|
358
|
+
const engine = new CheckExecutionEngine();
|
|
359
|
+
const results = await engine.executeChecks(prInfo, config, Object.keys(config.checks));
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### 5. Failure Routing Examples
|
|
363
|
+
|
|
364
|
+
Run the examples directly from the repo root:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
# Basic retry + goto ancestor
|
|
368
|
+
npx -y @probelabs/visor@latest --config examples/routing-basic.yaml --output table
|
|
369
|
+
|
|
370
|
+
# on_success: run notify and jump back once to re-run unit-tests
|
|
371
|
+
npx -y @probelabs/visor@latest --config examples/routing-on-success.yaml --output table
|
|
372
|
+
|
|
373
|
+
# forEach remediation: mark missing items then retry
|
|
374
|
+
npx -y @probelabs/visor@latest --config examples/routing-foreach.yaml --output table
|
|
375
|
+
|
|
376
|
+
# Dynamic routing with *_js hooks
|
|
377
|
+
npx -y @probelabs/visor@latest --config examples/routing-dynamic-js.yaml --output table
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Notes:
|
|
381
|
+
- These examples create small temporary files in the repo (prefixed with `.visor_demo_`).
|
|
382
|
+
Run `git clean -fdx` or delete the files manually to reset.
|
|
383
|
+
- The `routing` block supports `max_loops` and default retry policies; step-level settings override defaults.
|
|
384
|
+
- See `docs/failure-routing-rfc.md` for full semantics.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Example configuration demonstrating AI retry and fallback mechanisms
|
|
2
|
+
# This shows how to configure automatic retries with exponential backoff
|
|
3
|
+
# and fallback to alternative AI providers when the primary provider fails
|
|
4
|
+
|
|
5
|
+
version: '1.0'
|
|
6
|
+
|
|
7
|
+
# Global AI provider settings with retry and fallback
|
|
8
|
+
# Note: Check-level settings (in steps.<name>.ai) override these global settings
|
|
9
|
+
ai_provider: anthropic
|
|
10
|
+
ai_model: claude-3-5-sonnet-20241022
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
# Example 1: Basic retry configuration
|
|
14
|
+
# Retries the same provider with exponential backoff
|
|
15
|
+
code-review:
|
|
16
|
+
type: ai
|
|
17
|
+
prompt: |
|
|
18
|
+
Review this code for security vulnerabilities and best practices.
|
|
19
|
+
Focus on:
|
|
20
|
+
- Authentication and authorization issues
|
|
21
|
+
- SQL injection and XSS vulnerabilities
|
|
22
|
+
- Sensitive data exposure
|
|
23
|
+
schema: code-review
|
|
24
|
+
on:
|
|
25
|
+
- pr_opened
|
|
26
|
+
- pr_updated
|
|
27
|
+
ai:
|
|
28
|
+
provider: anthropic
|
|
29
|
+
model: claude-3-5-sonnet-20241022
|
|
30
|
+
# Retry configuration for transient failures
|
|
31
|
+
retry:
|
|
32
|
+
maxRetries: 3 # Retry up to 3 times (0-50 allowed)
|
|
33
|
+
initialDelay: 1000 # Start with 1 second delay (0-60000ms)
|
|
34
|
+
maxDelay: 30000 # Cap delay at 30 seconds (0-300000ms)
|
|
35
|
+
backoffFactor: 2 # Double delay each retry (1-10 allowed)
|
|
36
|
+
retryableErrors: # Optional: custom error patterns to retry on
|
|
37
|
+
- "rate limit"
|
|
38
|
+
- "503"
|
|
39
|
+
- "timeout"
|
|
40
|
+
|
|
41
|
+
# Example 2: Automatic fallback with environment detection
|
|
42
|
+
# Automatically falls back to available providers based on env vars
|
|
43
|
+
security-scan:
|
|
44
|
+
type: ai
|
|
45
|
+
prompt: |
|
|
46
|
+
Perform a comprehensive security analysis of the changes.
|
|
47
|
+
Identify critical security vulnerabilities.
|
|
48
|
+
schema: code-review
|
|
49
|
+
on:
|
|
50
|
+
- pr_opened
|
|
51
|
+
ai:
|
|
52
|
+
provider: anthropic
|
|
53
|
+
model: claude-3-5-sonnet-20241022
|
|
54
|
+
retry:
|
|
55
|
+
maxRetries: 2
|
|
56
|
+
initialDelay: 1000
|
|
57
|
+
backoffFactor: 2
|
|
58
|
+
# Automatic fallback to any available provider
|
|
59
|
+
fallback:
|
|
60
|
+
auto: true # Enable automatic provider detection
|
|
61
|
+
strategy: any # Try any available provider
|
|
62
|
+
maxTotalAttempts: 10 # Total attempts across all providers
|
|
63
|
+
|
|
64
|
+
# Example 3: Custom fallback provider chain
|
|
65
|
+
# Explicitly specify fallback providers in order
|
|
66
|
+
performance-review:
|
|
67
|
+
type: ai
|
|
68
|
+
prompt: |
|
|
69
|
+
Analyze code for performance issues and optimization opportunities.
|
|
70
|
+
schema: code-review
|
|
71
|
+
on:
|
|
72
|
+
- pr_opened
|
|
73
|
+
ai:
|
|
74
|
+
provider: anthropic
|
|
75
|
+
model: claude-3-5-sonnet-20241022
|
|
76
|
+
retry:
|
|
77
|
+
maxRetries: 2
|
|
78
|
+
initialDelay: 500
|
|
79
|
+
backoffFactor: 2
|
|
80
|
+
# Custom fallback chain
|
|
81
|
+
fallback:
|
|
82
|
+
strategy: custom
|
|
83
|
+
maxTotalAttempts: 8
|
|
84
|
+
providers:
|
|
85
|
+
# First fallback: Try OpenAI GPT-4
|
|
86
|
+
- provider: openai
|
|
87
|
+
model: gpt-4-turbo-preview
|
|
88
|
+
maxRetries: 2 # Per-provider retry override
|
|
89
|
+
apiKey: "${OPENAI_API_KEY}" # Can reference env vars
|
|
90
|
+
|
|
91
|
+
# Second fallback: Try Google Gemini
|
|
92
|
+
- provider: google
|
|
93
|
+
model: gemini-2.0-flash-exp
|
|
94
|
+
maxRetries: 2
|
|
95
|
+
apiKey: "${GOOGLE_API_KEY}"
|
|
96
|
+
|
|
97
|
+
# Third fallback: AWS Bedrock (requires AWS credentials)
|
|
98
|
+
- provider: bedrock
|
|
99
|
+
model: anthropic.claude-3-5-sonnet-20241022-v2:0
|
|
100
|
+
maxRetries: 1
|
|
101
|
+
region: us-east-1
|
|
102
|
+
accessKeyId: "${AWS_ACCESS_KEY_ID}"
|
|
103
|
+
secretAccessKey: "${AWS_SECRET_ACCESS_KEY}"
|
|
104
|
+
|
|
105
|
+
# Example 4: Same-model fallback strategy
|
|
106
|
+
# Falls back to same model on different providers
|
|
107
|
+
style-review:
|
|
108
|
+
type: ai
|
|
109
|
+
prompt: |
|
|
110
|
+
Review code style and consistency with project conventions.
|
|
111
|
+
schema: code-review
|
|
112
|
+
on:
|
|
113
|
+
- pr_updated
|
|
114
|
+
ai:
|
|
115
|
+
provider: anthropic
|
|
116
|
+
model: claude-3-5-sonnet-20241022
|
|
117
|
+
retry:
|
|
118
|
+
maxRetries: 1
|
|
119
|
+
fallback:
|
|
120
|
+
strategy: same-model # Try to use same model on other providers
|
|
121
|
+
auto: true
|
|
122
|
+
maxTotalAttempts: 5
|
|
123
|
+
|
|
124
|
+
# Example 5: Same-provider fallback strategy
|
|
125
|
+
# Falls back to different models from same provider
|
|
126
|
+
documentation-review:
|
|
127
|
+
type: ai
|
|
128
|
+
prompt: |
|
|
129
|
+
Review documentation for completeness and clarity.
|
|
130
|
+
schema: code-review
|
|
131
|
+
on:
|
|
132
|
+
- pr_opened
|
|
133
|
+
ai:
|
|
134
|
+
provider: anthropic
|
|
135
|
+
model: claude-3-5-sonnet-20241022
|
|
136
|
+
retry:
|
|
137
|
+
maxRetries: 2
|
|
138
|
+
fallback:
|
|
139
|
+
strategy: same-provider # Try other models from Anthropic
|
|
140
|
+
providers:
|
|
141
|
+
- provider: anthropic
|
|
142
|
+
model: claude-3-opus-20240229
|
|
143
|
+
maxRetries: 1
|
|
144
|
+
- provider: anthropic
|
|
145
|
+
model: claude-3-haiku-20240307
|
|
146
|
+
maxRetries: 1
|
|
147
|
+
|
|
148
|
+
# Example 6: Conservative retry with no fallback
|
|
149
|
+
# Useful when you want to fail fast and don't want to try alternatives
|
|
150
|
+
critical-security-check:
|
|
151
|
+
type: ai
|
|
152
|
+
prompt: |
|
|
153
|
+
Perform critical security validation that requires highest accuracy.
|
|
154
|
+
schema: code-review
|
|
155
|
+
on:
|
|
156
|
+
- pr_opened
|
|
157
|
+
ai:
|
|
158
|
+
provider: anthropic
|
|
159
|
+
model: claude-3-opus-20240229 # Use most capable model
|
|
160
|
+
retry:
|
|
161
|
+
maxRetries: 1 # Only retry once
|
|
162
|
+
initialDelay: 2000
|
|
163
|
+
# No fallback - fail if primary provider fails after retries
|
|
164
|
+
|
|
165
|
+
output:
|
|
166
|
+
pr_comment:
|
|
167
|
+
format: markdown
|
|
168
|
+
group_by: check
|
|
169
|
+
collapse: false
|
|
170
|
+
github_checks:
|
|
171
|
+
enabled: true
|
|
172
|
+
per_check: true
|
|
173
|
+
|
|
174
|
+
# Notes:
|
|
175
|
+
# - Retry logic uses exponential backoff with random jitter to avoid thundering herd
|
|
176
|
+
# - Retries automatically detect transient failures (rate limits, timeouts, 503, etc.)
|
|
177
|
+
# - Fallback providers are tried in order after primary provider exhausts retries
|
|
178
|
+
# - Environment variables are automatically used when fallback.auto is enabled
|
|
179
|
+
# - Each provider in fallback chain can have its own retry configuration
|
|
180
|
+
# - maxTotalAttempts caps total attempts across all providers to prevent excessive API usage
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Example Visor configuration demonstrating bash command execution in AI checks
|
|
2
|
+
version: "1.0"
|
|
3
|
+
|
|
4
|
+
# Global AI provider configuration
|
|
5
|
+
ai_provider: anthropic
|
|
6
|
+
ai_model: claude-3-sonnet
|
|
7
|
+
|
|
8
|
+
steps:
|
|
9
|
+
# Example 1: Simple - Enable bash with default safe commands
|
|
10
|
+
git-status-analysis:
|
|
11
|
+
type: ai
|
|
12
|
+
prompt: |
|
|
13
|
+
Analyze the current git repository status:
|
|
14
|
+
- Check for uncommitted changes
|
|
15
|
+
- Review the current branch
|
|
16
|
+
- List recent commits
|
|
17
|
+
- Identify any potential issues
|
|
18
|
+
ai:
|
|
19
|
+
provider: anthropic
|
|
20
|
+
model: claude-3-opus
|
|
21
|
+
allowBash: true # Simple one-line enable
|
|
22
|
+
on: ["pr_opened", "pr_updated"]
|
|
23
|
+
tags: ["git", "analysis"]
|
|
24
|
+
|
|
25
|
+
# Example 2: Advanced - Custom allow/deny lists for npm commands
|
|
26
|
+
npm-audit-check:
|
|
27
|
+
type: ai
|
|
28
|
+
prompt: |
|
|
29
|
+
Run npm audit and analyze the security vulnerabilities:
|
|
30
|
+
- Check for high/critical vulnerabilities
|
|
31
|
+
- Review outdated dependencies
|
|
32
|
+
- Suggest remediation steps
|
|
33
|
+
ai:
|
|
34
|
+
provider: google
|
|
35
|
+
model: gemini-2.0-flash-exp
|
|
36
|
+
allowBash: true
|
|
37
|
+
bashConfig:
|
|
38
|
+
allow:
|
|
39
|
+
- 'npm audit --json'
|
|
40
|
+
- 'npm outdated --json'
|
|
41
|
+
- 'npm list --depth=0'
|
|
42
|
+
timeout: 60000 # 60 second timeout
|
|
43
|
+
on: ["pr_opened"]
|
|
44
|
+
tags: ["security", "npm"]
|
|
45
|
+
|
|
46
|
+
# Example 3: Advanced - Test execution with custom config
|
|
47
|
+
test-runner-analysis:
|
|
48
|
+
type: ai
|
|
49
|
+
prompt: |
|
|
50
|
+
Run the test suite and analyze the results:
|
|
51
|
+
- Execute all tests
|
|
52
|
+
- Identify failing tests
|
|
53
|
+
- Review code coverage
|
|
54
|
+
- Suggest improvements
|
|
55
|
+
ai:
|
|
56
|
+
provider: anthropic
|
|
57
|
+
allowBash: true
|
|
58
|
+
bashConfig:
|
|
59
|
+
allow:
|
|
60
|
+
- 'npm test'
|
|
61
|
+
- 'npm run test:coverage'
|
|
62
|
+
deny:
|
|
63
|
+
- 'npm install' # Explicitly block installation
|
|
64
|
+
timeout: 300000 # 5 minute timeout for tests
|
|
65
|
+
workingDirectory: '.'
|
|
66
|
+
on: ["pr_opened", "pr_updated"]
|
|
67
|
+
tags: ["tests", "coverage"]
|
|
68
|
+
|
|
69
|
+
# Example 4: Advanced - Build and lint with timeouts
|
|
70
|
+
build-lint-check:
|
|
71
|
+
type: ai
|
|
72
|
+
prompt: |
|
|
73
|
+
Run build and lint checks:
|
|
74
|
+
- Execute the build process
|
|
75
|
+
- Run ESLint
|
|
76
|
+
- Check TypeScript compilation
|
|
77
|
+
- Review any errors or warnings
|
|
78
|
+
ai:
|
|
79
|
+
provider: openai
|
|
80
|
+
model: gpt-4
|
|
81
|
+
allowBash: true
|
|
82
|
+
bashConfig:
|
|
83
|
+
allow:
|
|
84
|
+
- 'npm run build'
|
|
85
|
+
- 'npm run lint'
|
|
86
|
+
- 'tsc --noEmit'
|
|
87
|
+
timeout: 180000 # 3 minute timeout
|
|
88
|
+
on: ["pr_opened"]
|
|
89
|
+
tags: ["build", "lint"]
|
|
90
|
+
|
|
91
|
+
# Example 5: Expert - Custom commands only (no defaults)
|
|
92
|
+
custom-commands-only:
|
|
93
|
+
type: ai
|
|
94
|
+
prompt: "Run custom analysis commands with strict control"
|
|
95
|
+
ai:
|
|
96
|
+
provider: anthropic
|
|
97
|
+
allowBash: true
|
|
98
|
+
bashConfig:
|
|
99
|
+
noDefaultAllow: true # Disable default safe commands
|
|
100
|
+
noDefaultDeny: false # Keep dangerous command blocklist
|
|
101
|
+
allow:
|
|
102
|
+
- 'custom-tool analyze'
|
|
103
|
+
- 'custom-tool report'
|
|
104
|
+
timeout: 30000
|
|
105
|
+
on: ["manual"]
|
|
106
|
+
tags: ["custom", "advanced"]
|
|
107
|
+
|
|
108
|
+
# Example 6: Simple - File system analysis with defaults
|
|
109
|
+
filesystem-analysis:
|
|
110
|
+
type: ai
|
|
111
|
+
prompt: |
|
|
112
|
+
Analyze the project file structure:
|
|
113
|
+
- List all source files
|
|
114
|
+
- Check file sizes
|
|
115
|
+
- Review directory structure
|
|
116
|
+
- Identify any organizational issues
|
|
117
|
+
ai:
|
|
118
|
+
provider: anthropic
|
|
119
|
+
allowBash: true # Uses default safe commands (ls, find, etc.)
|
|
120
|
+
on: ["pr_opened"]
|
|
121
|
+
tags: ["filesystem", "structure"]
|
|
122
|
+
|
|
123
|
+
output:
|
|
124
|
+
pr_comment:
|
|
125
|
+
enabled: true
|
|
126
|
+
group_by: check
|