@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.
- package/README.md +71 -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 +624 -0
- package/defaults/visor.tests.yaml +685 -0
- package/defaults/visor.yaml +483 -0
- 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 +28 -9
- 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 +7 -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 +624 -0
- package/dist/defaults/visor.tests.yaml +685 -0
- package/dist/defaults/visor.yaml +483 -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 +237 -0
- package/dist/docs/ai-configuration.md +535 -0
- package/dist/docs/ai-custom-tools-usage.md +261 -0
- package/dist/docs/ai-custom-tools.md +392 -0
- package/dist/docs/author-permissions.md +610 -0
- package/dist/docs/bot-transports-rfc.md +23 -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 +324 -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-pause-resume-rfc.md +192 -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/lifecycle-hooks.md +253 -0
- package/dist/docs/limits.md +64 -0
- package/dist/docs/liquid-templates.md +490 -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/providers/git-checkout.md +589 -0
- package/dist/docs/recipes.md +474 -0
- package/dist/docs/rfc/git-checkout-step.md +601 -0
- package/dist/docs/rfc/on_init-hook.md +1294 -0
- package/dist/docs/rfc/workspace-isolation.md +216 -0
- package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
- package/dist/docs/router-patterns.md +339 -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 +71 -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-custom-tools-example.yaml +206 -0
- package/dist/examples/ai-custom-tools-simple.yaml +76 -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/git-checkout-basic.yaml +32 -0
- package/dist/examples/git-checkout-compare.yaml +59 -0
- package/dist/examples/git-checkout-cross-repo.yaml +76 -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/on-init-import-demo.yaml +179 -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/reusable-tools.yaml +92 -0
- package/dist/examples/reusable-workflows.yaml +88 -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/session-reuse-self.yaml +81 -0
- package/dist/examples/slack-simple-chat.yaml +775 -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 +3 -0
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/frontends/github-frontend.d.ts +58 -0
- package/dist/frontends/github-frontend.d.ts.map +1 -0
- package/dist/frontends/host.d.ts +47 -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/frontends/slack-frontend.d.ts +58 -0
- package/dist/frontends/slack-frontend.d.ts.map +1 -0
- package/dist/generated/config-schema.d.ts +967 -57
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +1033 -56
- 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 +2 -4
- package/dist/github-comments.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +134327 -99004
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/logger.d.ts +2 -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-2026-01-20T19-22-58-043Z.ndjson +138 -0
- package/dist/output/traces/run-2026-01-20T19-23-52-175Z.ndjson +1067 -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 +12 -0
- 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 +43 -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/git-checkout-provider.d.ts +25 -0
- package/dist/providers/git-checkout-provider.d.ts.map +1 -0
- package/dist/providers/github-ops-provider.d.ts.map +1 -1
- package/dist/providers/http-client-provider.d.ts +4 -4
- package/dist/providers/http-client-provider.d.ts.map +1 -1
- package/dist/providers/human-input-check-provider.d.ts +5 -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 +10 -4
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts +66 -0
- package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -0
- 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/check-provider-registry-534KL5HT.mjs +27 -0
- package/dist/sdk/chunk-23L3QRYX.mjs +16872 -0
- package/dist/sdk/chunk-23L3QRYX.mjs.map +1 -0
- package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-3OMWVM6J.mjs} +11 -1
- package/dist/sdk/chunk-3OMWVM6J.mjs.map +1 -0
- package/dist/sdk/chunk-7UK3NIIT.mjs +482 -0
- package/dist/sdk/chunk-7UK3NIIT.mjs.map +1 -0
- package/dist/sdk/chunk-AGIZJ4UZ.mjs +173 -0
- package/dist/sdk/chunk-AGIZJ4UZ.mjs.map +1 -0
- package/dist/sdk/chunk-AIVFBIS4.mjs +1371 -0
- package/dist/sdk/chunk-AIVFBIS4.mjs.map +1 -0
- package/dist/sdk/chunk-AK6BVWIT.mjs +426 -0
- package/dist/sdk/chunk-AK6BVWIT.mjs.map +1 -0
- package/dist/sdk/chunk-AUT26LHW.mjs +139 -0
- package/dist/sdk/chunk-AUT26LHW.mjs.map +1 -0
- package/dist/sdk/chunk-BOVFH3LI.mjs +232 -0
- package/dist/sdk/chunk-BOVFH3LI.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-HTOKWMPO.mjs +157 -0
- package/dist/sdk/chunk-HTOKWMPO.mjs.map +1 -0
- package/dist/sdk/chunk-NAW3DB3I.mjs +197 -0
- package/dist/sdk/chunk-NAW3DB3I.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-QR7MOMJH.mjs +558 -0
- package/dist/sdk/chunk-QR7MOMJH.mjs.map +1 -0
- package/dist/sdk/chunk-QY2XYPEV.mjs +3556 -0
- package/dist/sdk/chunk-QY2XYPEV.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-SIWNBRTK.mjs +800 -0
- package/dist/sdk/chunk-SIWNBRTK.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/command-executor-TYUV6HUS.mjs +14 -0
- package/dist/sdk/config-YNC2EOOT.mjs +16 -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-YGTF2GHG.mjs +17 -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-SIAEOCON.mjs +1420 -0
- package/dist/sdk/github-frontend-SIAEOCON.mjs.map +1 -0
- package/dist/sdk/host-DXUYTNMU.mjs +52 -0
- package/dist/sdk/host-DXUYTNMU.mjs.map +1 -0
- package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-PKWCKK7E.mjs} +8 -2
- package/dist/sdk/memory-store-XGBB7LX7.mjs +12 -0
- package/dist/sdk/memory-store-XGBB7LX7.mjs.map +1 -0
- package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
- package/dist/sdk/metrics-7PP3EJUH.mjs.map +1 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
- package/dist/sdk/prompt-state-YRJY6QAL.mjs +16 -0
- package/dist/sdk/prompt-state-YRJY6QAL.mjs.map +1 -0
- package/dist/sdk/renderer-schema-LPKN5UJS.mjs +51 -0
- package/dist/sdk/renderer-schema-LPKN5UJS.mjs.map +1 -0
- package/dist/sdk/routing-6N45MJ4F.mjs +24 -0
- package/dist/sdk/routing-6N45MJ4F.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +541 -22
- package/dist/sdk/sdk.d.ts +541 -22
- package/dist/sdk/sdk.js +27963 -16505
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +1116 -2169
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/session-registry-4E6YRQ77.mjs +10 -0
- package/dist/sdk/session-registry-4E6YRQ77.mjs.map +1 -0
- package/dist/sdk/slack-frontend-BVKW3GD5.mjs +735 -0
- package/dist/sdk/slack-frontend-BVKW3GD5.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-GSLPPLCD.mjs} +2 -2
- package/dist/sdk/tracer-init-GSLPPLCD.mjs.map +1 -0
- package/dist/sdk/workflow-registry-R6KSACFR.mjs +12 -0
- package/dist/sdk/workflow-registry-R6KSACFR.mjs.map +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/slack/adapter.d.ts +36 -0
- package/dist/slack/adapter.d.ts.map +1 -0
- package/dist/slack/cache-prewarmer.d.ts +31 -0
- package/dist/slack/cache-prewarmer.d.ts.map +1 -0
- package/dist/slack/client.d.ts +77 -0
- package/dist/slack/client.d.ts.map +1 -0
- package/dist/slack/markdown.d.ts +45 -0
- package/dist/slack/markdown.d.ts.map +1 -0
- package/dist/slack/prompt-state.d.ts +33 -0
- package/dist/slack/prompt-state.d.ts.map +1 -0
- package/dist/slack/rate-limiter.d.ts +56 -0
- package/dist/slack/rate-limiter.d.ts.map +1 -0
- package/dist/slack/signature.d.ts +2 -0
- package/dist/slack/signature.d.ts.map +1 -0
- package/dist/slack/socket-runner.d.ts +42 -0
- package/dist/slack/socket-runner.d.ts.map +1 -0
- package/dist/slack/thread-cache.d.ts +51 -0
- package/dist/slack/thread-cache.d.ts.map +1 -0
- 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 +17 -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/on-init-handlers.d.ts +43 -0
- package/dist/state-machine/dispatch/on-init-handlers.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 +79 -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 +159 -0
- package/dist/state-machine-execution-engine.d.ts.map +1 -0
- package/dist/telemetry/opentelemetry.d.ts.map +1 -1
- package/dist/telemetry/state-capture.d.ts +5 -0
- package/dist/telemetry/state-capture.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 +45 -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 +127 -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/recorders/slack-recorder.d.ts +17 -0
- package/dist/test-runner/recorders/slack-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-2026-01-20T19-22-58-043Z.ndjson +138 -0
- package/dist/traces/run-2026-01-20T19-23-52-175Z.ndjson +1067 -0
- package/dist/types/bot.d.ts +109 -0
- package/dist/types/bot.d.ts.map +1 -0
- package/dist/types/cli.d.ts +8 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +459 -9
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts +177 -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/git-checkout.d.ts +76 -0
- package/dist/types/git-checkout.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/json-text-extractor.d.ts +17 -0
- package/dist/utils/json-text-extractor.d.ts.map +1 -0
- package/dist/utils/sandbox.d.ts +10 -0
- 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 +8 -0
- package/dist/utils/template-context.d.ts.map +1 -0
- package/dist/utils/tracer-init.d.ts.map +1 -1
- package/dist/utils/workspace-manager.d.ts +118 -0
- package/dist/utils/workspace-manager.d.ts.map +1 -0
- package/dist/utils/worktree-cleanup.d.ts +33 -0
- package/dist/utils/worktree-cleanup.d.ts.map +1 -0
- package/dist/utils/worktree-manager.d.ts +153 -0
- package/dist/utils/worktree-manager.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 +12 -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 → check-provider-registry-534KL5HT.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → command-executor-TYUV6HUS.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → config-YNC2EOOT.mjs.map} +0 -0
- /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → failure-condition-evaluator-YGTF2GHG.mjs.map} +0 -0
- /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → liquid-extensions-PKWCKK7E.mjs.map} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
## 📋 Schema-Template System
|
|
2
|
+
|
|
3
|
+
Visor pairs JSON Schemas (data shape) with Liquid templates (rendering) so outputs are predictable, auditable, and GitHub‑native.
|
|
4
|
+
|
|
5
|
+
### Overview
|
|
6
|
+
- Schema validates check output at runtime (via AJV)
|
|
7
|
+
- Template renders tables/markdown and GitHub Checks annotations
|
|
8
|
+
- Group controls which GitHub comment a check posts to
|
|
9
|
+
|
|
10
|
+
### Quick Example
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
steps:
|
|
14
|
+
security:
|
|
15
|
+
type: ai
|
|
16
|
+
group: code-review
|
|
17
|
+
schema: code-review
|
|
18
|
+
prompt: "Review for security issues and return JSON"
|
|
19
|
+
|
|
20
|
+
overview:
|
|
21
|
+
type: ai
|
|
22
|
+
group: summary
|
|
23
|
+
schema: text
|
|
24
|
+
prompt: "Summarize PR in markdown"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Built-in Schemas
|
|
28
|
+
- code-review: structured findings with severity, file, line → native annotations
|
|
29
|
+
- text: free‑form markdown content (no annotations)
|
|
30
|
+
|
|
31
|
+
### Grouping
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
steps:
|
|
35
|
+
security: { group: code-review }
|
|
36
|
+
performance:{ group: code-review }
|
|
37
|
+
overview: { group: summary }
|
|
38
|
+
assistant: { group: dynamic } # always creates a new comment
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Custom Schemas
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
schemas:
|
|
45
|
+
custom-metrics:
|
|
46
|
+
file: ./schemas/metrics.json
|
|
47
|
+
|
|
48
|
+
steps:
|
|
49
|
+
metrics:
|
|
50
|
+
schema: custom-metrics
|
|
51
|
+
group: metrics
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### GitHub Checks API Compatibility
|
|
55
|
+
|
|
56
|
+
For status checks and annotations, use structured output with `issues[]` having:
|
|
57
|
+
- severity: critical | error | warning | info
|
|
58
|
+
- file, line, message
|
|
59
|
+
|
|
60
|
+
Unstructured (none/plain) → posted as-is, no status checks.
|
|
61
|
+
|
|
62
|
+
### Enhanced Prompts
|
|
63
|
+
- Smart auto‑detection, Liquid templating, file‑based prompts
|
|
64
|
+
- Template context: `pr`, `files`, `event`, `outputs`, `utils`
|
|
65
|
+
- See [Liquid Templates Guide](./liquid-templates.md) for available variables and filters
|
|
66
|
+
|
|
67
|
+
See full examples in `defaults/.visor.yaml`.
|
|
68
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## Script step (type: `script`)
|
|
2
|
+
|
|
3
|
+
The `script` provider executes JavaScript in a secure sandbox with access to
|
|
4
|
+
PR context, dependency outputs, and the Visor memory store.
|
|
5
|
+
|
|
6
|
+
- Use `type: script` with a `content` block containing your code.
|
|
7
|
+
- The sandbox exposes these objects:
|
|
8
|
+
- `pr`: basic PR metadata and file list.
|
|
9
|
+
- `outputs`: map of dependency outputs (plus `outputs.history`).
|
|
10
|
+
- `outputs_raw`: aggregated values from `-raw` dependencies.
|
|
11
|
+
- `outputs_history_stage`: per-stage output history slice for tests.
|
|
12
|
+
- `memory`: synchronous helpers `get`, `set`, `append`, `increment`, `delete`, `clear`.
|
|
13
|
+
- The value you `return` becomes this step’s `output` (for `depends_on`).
|
|
14
|
+
|
|
15
|
+
Example:
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
steps:
|
|
19
|
+
extract-facts:
|
|
20
|
+
type: command
|
|
21
|
+
exec: node ./scripts/extract-facts.js
|
|
22
|
+
|
|
23
|
+
aggregate:
|
|
24
|
+
type: script
|
|
25
|
+
depends_on: [extract-facts]
|
|
26
|
+
content: |
|
|
27
|
+
const facts = outputs['extract-facts'] || [];
|
|
28
|
+
memory.set('total_facts', Array.isArray(facts) ? facts.length : 0, 'fact-validation');
|
|
29
|
+
const allValid = Array.isArray(facts) && facts.every(f => f.valid === true);
|
|
30
|
+
memory.set('all_valid', allValid, 'fact-validation');
|
|
31
|
+
return { total: memory.get('total_facts', 'fact-validation'), allValid };
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The script context and memory helpers mirror other providers’ contexts.
|
package/dist/docs/sdk.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Visor SDK (Programmatic Usage)
|
|
2
|
+
|
|
3
|
+
Run Visor from Node.js without shelling out. The SDK is a thin façade over the existing engine: it just wires inputs/outputs and reuses all core behavior (routing, providers, templates, etc.).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -D @probelabs/visor
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### JavaScript (ESM)
|
|
14
|
+
```ts
|
|
15
|
+
import { loadConfig, runChecks } from '@probelabs/visor/sdk';
|
|
16
|
+
|
|
17
|
+
// Load config from object (not file!) - validation and defaults applied
|
|
18
|
+
const config = await loadConfig({
|
|
19
|
+
version: '1.0',
|
|
20
|
+
checks: {
|
|
21
|
+
'security': { type: 'command', exec: 'npm audit' },
|
|
22
|
+
'lint': { type: 'command', exec: 'npm run lint' },
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const result = await runChecks({
|
|
27
|
+
config,
|
|
28
|
+
checks: Object.keys(config.checks),
|
|
29
|
+
output: { format: 'json' },
|
|
30
|
+
});
|
|
31
|
+
console.log('Total issues:', result.reviewSummary.issues?.length ?? 0);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### TypeScript
|
|
35
|
+
```typescript
|
|
36
|
+
import { loadConfig, runChecks, type VisorConfig, type RunOptions } from '@probelabs/visor/sdk';
|
|
37
|
+
|
|
38
|
+
// Type-safe config construction
|
|
39
|
+
const rawConfig: Partial<VisorConfig> = {
|
|
40
|
+
version: '1.0',
|
|
41
|
+
checks: {
|
|
42
|
+
'security': { type: 'command', exec: 'npm audit' },
|
|
43
|
+
'lint': { type: 'command', exec: 'npm run lint' },
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const config = await loadConfig(rawConfig);
|
|
48
|
+
const result = await runChecks({
|
|
49
|
+
config,
|
|
50
|
+
checks: Object.keys(config.checks),
|
|
51
|
+
output: { format: 'json' },
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Type-safe result access with full type inference
|
|
55
|
+
console.log('Total issues:', result.reviewSummary.issues?.length ?? 0);
|
|
56
|
+
console.log('Checks executed:', result.checksExecuted);
|
|
57
|
+
console.log('Execution time:', result.executionTime);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
CommonJS
|
|
61
|
+
```js
|
|
62
|
+
const { loadConfig, runChecks } = require('@probelabs/visor/sdk');
|
|
63
|
+
(async () => {
|
|
64
|
+
const config = await loadConfig({
|
|
65
|
+
version: '1.0',
|
|
66
|
+
checks: { test: { type: 'command', exec: 'echo test' } }
|
|
67
|
+
});
|
|
68
|
+
const result = await runChecks({ config, checks: Object.keys(config.checks), output: { format: 'json' } });
|
|
69
|
+
console.log('Total issues:', result.reviewSummary.issues?.length ?? 0);
|
|
70
|
+
})();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Loading from Files
|
|
74
|
+
|
|
75
|
+
You can also load config from files:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import { loadConfig, runChecks } from '@probelabs/visor/sdk';
|
|
79
|
+
|
|
80
|
+
// Load from specific file path
|
|
81
|
+
const config = await loadConfig('./my-config.yaml');
|
|
82
|
+
|
|
83
|
+
// Or discover default (.visor.yaml/.visor.yml)
|
|
84
|
+
const config2 = await loadConfig();
|
|
85
|
+
|
|
86
|
+
const result = await runChecks({
|
|
87
|
+
config,
|
|
88
|
+
checks: Object.keys(config.checks),
|
|
89
|
+
output: { format: 'json' },
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Note:** The `output` parameter in `runChecks()` options controls the CLI output format (table/json/markdown/sarif). The config's `output` field is for GitHub PR comments and is optional for programmatic use.
|
|
94
|
+
|
|
95
|
+
### Strict Validation Mode
|
|
96
|
+
|
|
97
|
+
By default, unknown config keys generate warnings but don't fail. Enable strict mode to catch config errors early:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { runChecks } from '@probelabs/visor/sdk';
|
|
101
|
+
|
|
102
|
+
const config = {
|
|
103
|
+
version: '1.0',
|
|
104
|
+
checks: { test: { type: 'command', exec: 'echo test' } },
|
|
105
|
+
typo_field: 'oops' // This would normally just warn
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
await runChecks({
|
|
110
|
+
config,
|
|
111
|
+
checks: ['test'],
|
|
112
|
+
strictValidation: true // Now throws error for unknown keys
|
|
113
|
+
});
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.error('Config error:', error.message);
|
|
116
|
+
// Error: Unknown top-level key 'typo_field' will be ignored.
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## API
|
|
121
|
+
|
|
122
|
+
- `loadConfig(configOrPath?: string | Partial<VisorConfig>, options?: { strict?: boolean }): Promise<VisorConfig>`
|
|
123
|
+
- Loads and validates a config from an object, file path, or discovers defaults
|
|
124
|
+
- Accepts config objects (validates and applies defaults) or file paths
|
|
125
|
+
- Returns fully validated config with all defaults applied
|
|
126
|
+
- Set `options.strict` to treat warnings as errors
|
|
127
|
+
- `resolveChecks(checkIds: string[], config: VisorConfig | undefined): string[]`
|
|
128
|
+
- Expands check IDs to include dependencies in the correct order.
|
|
129
|
+
- `runChecks(options: RunOptions): Promise<AnalysisResult>`
|
|
130
|
+
- Runs checks programmatically. Thin wrapper around the engine's `executeChecks`.
|
|
131
|
+
|
|
132
|
+
### Types
|
|
133
|
+
|
|
134
|
+
- `RunOptions`
|
|
135
|
+
- `config?: VisorConfig` | `configPath?: string`
|
|
136
|
+
- `checks?: string[]`
|
|
137
|
+
- `cwd?: string`
|
|
138
|
+
- `timeoutMs?: number`
|
|
139
|
+
- `output?: { format?: 'table'|'json'|'markdown'|'sarif' }`
|
|
140
|
+
- `debug?: boolean`
|
|
141
|
+
- `maxParallelism?: number`
|
|
142
|
+
- `failFast?: boolean`
|
|
143
|
+
- `tagFilter?: { include?: string[]; exclude?: string[] }`
|
|
144
|
+
- `strictValidation?: boolean` - Treat config warnings (unknown keys) as errors (default: false)
|
|
145
|
+
|
|
146
|
+
- `AnalysisResult`
|
|
147
|
+
- `reviewSummary.issues: Issue[]`
|
|
148
|
+
- `executionTime: number`, `timestamp: string`, `checksExecuted: string[]`
|
|
149
|
+
|
|
150
|
+
Refer to `src/types/config.ts` for `VisorConfig`, `Issue`, and related types.
|
|
151
|
+
|
|
152
|
+
## Safety & Criticality (Quick Note)
|
|
153
|
+
|
|
154
|
+
When building configs programmatically, model safety explicitly:
|
|
155
|
+
|
|
156
|
+
- Declare criticality on steps with `criticality: external|internal|policy|info`.
|
|
157
|
+
- Add contracts to critical steps:
|
|
158
|
+
- `assume:` preconditions checked before execution
|
|
159
|
+
- `guarantee:` postconditions checked after execution
|
|
160
|
+
- Use declarative `transitions` for routing rather than `goto_js`.
|
|
161
|
+
|
|
162
|
+
Example config (JS object):
|
|
163
|
+
```ts
|
|
164
|
+
const cfg = await loadConfig({
|
|
165
|
+
version: '1.0',
|
|
166
|
+
checks: {
|
|
167
|
+
'post-comment': {
|
|
168
|
+
type: 'github',
|
|
169
|
+
criticality: 'external',
|
|
170
|
+
on: ['pr_opened'],
|
|
171
|
+
op: 'comment.create',
|
|
172
|
+
assume: ["isMember()"],
|
|
173
|
+
guarantee: ["output && typeof output.id === 'number'"],
|
|
174
|
+
continue_on_failure: false,
|
|
175
|
+
},
|
|
176
|
+
// Structured outputs with unified `schema` (object) for validation
|
|
177
|
+
'summarize-json': {
|
|
178
|
+
type: 'ai',
|
|
179
|
+
schema: {
|
|
180
|
+
type: 'object',
|
|
181
|
+
properties: { ok: { type: 'boolean' }, items: { type: 'array', items: { type: 'string' } } },
|
|
182
|
+
required: ['ok', 'items']
|
|
183
|
+
},
|
|
184
|
+
prompt: 'Return JSON with ok and items...'
|
|
185
|
+
},
|
|
186
|
+
// Command/script can also use JSON Schema via `schema`
|
|
187
|
+
'aggregate': {
|
|
188
|
+
type: 'script',
|
|
189
|
+
content: 'return { all_valid: true };',
|
|
190
|
+
schema: { type: 'object', properties: { all_valid: { type: 'boolean' } }, required: ['all_valid'], additionalProperties: false }
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Notes
|
|
197
|
+
|
|
198
|
+
- SDK adds no new sandboxing or providers; all safety lives in the core engine.
|
|
199
|
+
- For offline demos, unset provider env vars if you rely on mock providers.
|
|
200
|
+
- You can still use all CLI features alongside the SDK in the same project.
|
|
201
|
+
|
|
202
|
+
## Examples (in repo)
|
|
203
|
+
|
|
204
|
+
- `examples/sdk-basic.mjs` (ESM) – Minimal example with raw config object
|
|
205
|
+
- `examples/sdk-cjs.cjs` (CJS) – CommonJS usage
|
|
206
|
+
- `examples/sdk-manual-config.mjs` (ESM) – Manual config construction with validation
|
|
207
|
+
- `examples/sdk-typescript.ts` (TypeScript) – **Type-safe example** showing:
|
|
208
|
+
- Full TypeScript type safety with SDK type definitions
|
|
209
|
+
- Importing types from `@probelabs/visor/sdk`
|
|
210
|
+
- Type inference for configs and results
|
|
211
|
+
- Compile-time type checking
|
|
212
|
+
- Using exported types (`VisorConfig`, `RunOptions`)
|
|
213
|
+
- To run: `npx tsc examples/sdk-typescript.ts --module esnext --target es2022 --moduleResolution bundler --esModuleInterop --skipLibCheck && node examples/sdk-typescript.js`
|
|
214
|
+
- `examples/sdk-comprehensive.mjs` (ESM) – **Complex example** showing:
|
|
215
|
+
- Multi-level check dependencies (`depends_on`)
|
|
216
|
+
- Tag filtering
|
|
217
|
+
- Parallel execution control
|
|
218
|
+
- Dependency resolution with `resolveChecks()`
|
|
219
|
+
- Strict validation mode
|
|
220
|
+
- Complete pipeline execution
|
|
221
|
+
|
|
222
|
+
These are also exercised by CI smoke tests.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## 🔐 Security Defaults
|
|
2
|
+
|
|
3
|
+
- Prefer GitHub App for bot identity and granular org/repo permissions.
|
|
4
|
+
- Lock remote extends with `--allowed-remote-patterns`; default is off.
|
|
5
|
+
- No external network calls unless configured (providers, HTTP checks, etc.).
|
|
6
|
+
- Document where tokens are used; rotate provider keys regularly.
|
|
7
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
## 🔇 Suppressing Warnings
|
|
2
|
+
|
|
3
|
+
Visor supports suppressing specific warnings or all warnings in a file using special comments in your code. This is useful for false positives or intentional code patterns that should not trigger warnings.
|
|
4
|
+
|
|
5
|
+
### Line-Level Suppression
|
|
6
|
+
|
|
7
|
+
Add `visor-disable` in a comment within ±2 lines of the issue to suppress it:
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
// Example: Suppress a specific warning
|
|
11
|
+
function authenticate() {
|
|
12
|
+
const testPassword = "demo123"; // visor-disable
|
|
13
|
+
// This hardcoded password warning will be suppressed
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The suppression works with any comment style:
|
|
18
|
+
- `// visor-disable` (JavaScript, TypeScript, C++, etc.)
|
|
19
|
+
- `# visor-disable` (Python, Ruby, Shell, etc.)
|
|
20
|
+
- `/* visor-disable */` (Multi-line comments)
|
|
21
|
+
- `<!-- visor-disable -->` (HTML, XML)
|
|
22
|
+
|
|
23
|
+
### File-Level Suppression
|
|
24
|
+
|
|
25
|
+
To suppress all warnings in an entire file, add `visor-disable-file` in the first 5 lines:
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
// visor-disable-file
|
|
29
|
+
// All warnings in this file will be suppressed
|
|
30
|
+
|
|
31
|
+
function insecureCode() {
|
|
32
|
+
eval("user input"); // No warning
|
|
33
|
+
const password = "hardcoded"; // No warning
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Configuration
|
|
38
|
+
|
|
39
|
+
The suppression feature is enabled by default. You can disable it in your configuration:
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
# .visor.yaml
|
|
43
|
+
version: "1.0"
|
|
44
|
+
output:
|
|
45
|
+
suppressionEnabled: false # Disable suppression comments
|
|
46
|
+
pr_comment:
|
|
47
|
+
format: markdown
|
|
48
|
+
group_by: check
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Important Notes
|
|
52
|
+
|
|
53
|
+
- Suppression comments are case-insensitive (`visor-disable`, `VISOR-DISABLE`, `Visor-Disable`)
|
|
54
|
+
- The comment just needs to contain the suppression keyword as a substring
|
|
55
|
+
- When issues are suppressed, Visor logs a summary showing which files had suppressed issues
|
|
56
|
+
- Use suppression judiciously - it's better to fix issues than suppress them
|
|
57
|
+
|
|
58
|
+
### Examples
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
# Python example
|
|
62
|
+
def process_data():
|
|
63
|
+
api_key = "sk-12345" # visor-disable
|
|
64
|
+
return api_key
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
// TypeScript example - suppress within range
|
|
69
|
+
function riskyOperation() {
|
|
70
|
+
// visor-disable
|
|
71
|
+
const unsafe = eval(userInput); // Suppressed (within 2 lines)
|
|
72
|
+
processData(unsafe); // Suppressed (within 2 lines)
|
|
73
|
+
|
|
74
|
+
doSomethingElse();
|
|
75
|
+
anotherOperation(); // NOT suppressed (> 2 lines away)
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```go
|
|
80
|
+
// Go example - file-level suppression
|
|
81
|
+
// visor-disable-file
|
|
82
|
+
package main
|
|
83
|
+
|
|
84
|
+
func main() {
|
|
85
|
+
password := "hardcoded" // All issues suppressed
|
|
86
|
+
fmt.Println(password)
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
## 🏷️ Tag-Based Check Filtering
|
|
2
|
+
|
|
3
|
+
Visor supports tagging checks to create flexible execution profiles. This lets you run different sets of checks in different environments (e.g., lightweight checks locally, comprehensive checks in CI).
|
|
4
|
+
|
|
5
|
+
### How It Works
|
|
6
|
+
|
|
7
|
+
1. Tag your checks with descriptive labels
|
|
8
|
+
2. Filter execution using `--tags` and `--exclude-tags`
|
|
9
|
+
3. Dependencies adapt intelligently based on what’s included
|
|
10
|
+
|
|
11
|
+
Note on defaults
|
|
12
|
+
- If you do NOT provide any tag filter (no `--tags`/`--exclude-tags` and no `tag_filter` in config), Visor only runs untagged checks. Any check that has `tags: [...]` is skipped by default. This keeps day‑to‑day runs lightweight and makes tagged groups opt‑in.
|
|
13
|
+
- To run tagged checks, explicitly include their tags (for example, `--tags github,security`).
|
|
14
|
+
|
|
15
|
+
### Basic Configuration
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
# .visor.yaml
|
|
19
|
+
version: "1.0"
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
# Fast, local security check
|
|
23
|
+
security-quick:
|
|
24
|
+
type: ai
|
|
25
|
+
prompt: "Quick security scan for common vulnerabilities"
|
|
26
|
+
tags: ["local", "fast", "security"]
|
|
27
|
+
on: [pr_opened, pr_updated]
|
|
28
|
+
|
|
29
|
+
# Comprehensive security analysis (for CI)
|
|
30
|
+
security-comprehensive:
|
|
31
|
+
type: ai
|
|
32
|
+
prompt: "Deep security analysis with full vulnerability scanning"
|
|
33
|
+
tags: ["remote", "comprehensive", "security", "slow"]
|
|
34
|
+
on: [pr_opened]
|
|
35
|
+
|
|
36
|
+
# Performance check that runs everywhere
|
|
37
|
+
performance:
|
|
38
|
+
type: ai
|
|
39
|
+
prompt: "Analyze performance issues"
|
|
40
|
+
tags: ["local", "remote", "performance", "fast"]
|
|
41
|
+
on: [pr_opened, pr_updated]
|
|
42
|
+
|
|
43
|
+
# Experimental new check
|
|
44
|
+
ai-architecture:
|
|
45
|
+
type: ai
|
|
46
|
+
prompt: "AI-powered architecture review"
|
|
47
|
+
tags: ["experimental", "architecture", "slow"]
|
|
48
|
+
on: [manual]
|
|
49
|
+
|
|
50
|
+
# Report that depends on security checks
|
|
51
|
+
security-report:
|
|
52
|
+
type: noop
|
|
53
|
+
tags: ["reporting", "local", "remote"]
|
|
54
|
+
depends_on: [security-quick, security-comprehensive]
|
|
55
|
+
on: [pr_opened, pr_updated]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### CLI Usage
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Run only fast, local checks (great for pre-commit hooks)
|
|
62
|
+
visor --tags local,fast
|
|
63
|
+
|
|
64
|
+
# Run comprehensive remote checks (for CI/CD)
|
|
65
|
+
visor --tags remote,comprehensive
|
|
66
|
+
|
|
67
|
+
# Run all security-related checks
|
|
68
|
+
visor --tags security
|
|
69
|
+
|
|
70
|
+
# Run everything except slow checks
|
|
71
|
+
visor --exclude-tags slow
|
|
72
|
+
|
|
73
|
+
# Run everything except experimental features
|
|
74
|
+
visor --exclude-tags experimental
|
|
75
|
+
|
|
76
|
+
# Combine filters: Run fast security checks only
|
|
77
|
+
visor --tags security,fast
|
|
78
|
+
|
|
79
|
+
# Run local checks but skip experimental ones
|
|
80
|
+
visor --tags local --exclude-tags experimental
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### GitHub Action Usage
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
name: Code Review with Tags
|
|
87
|
+
on: pull_request
|
|
88
|
+
|
|
89
|
+
jobs:
|
|
90
|
+
# Fast checks on every push
|
|
91
|
+
fast-review:
|
|
92
|
+
runs-on: ubuntu-latest
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@v4
|
|
95
|
+
- uses: probelabs/visor@v1
|
|
96
|
+
with:
|
|
97
|
+
tags: "local,fast"
|
|
98
|
+
exclude-tags: "experimental"
|
|
99
|
+
env:
|
|
100
|
+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
101
|
+
|
|
102
|
+
# Comprehensive checks only on main branch PRs
|
|
103
|
+
comprehensive-review:
|
|
104
|
+
if: github.base_ref == 'main'
|
|
105
|
+
runs-on: ubuntu-latest
|
|
106
|
+
steps:
|
|
107
|
+
- uses: actions/checkout@v4
|
|
108
|
+
- uses: probelabs/visor@v1
|
|
109
|
+
with:
|
|
110
|
+
tags: "remote,comprehensive"
|
|
111
|
+
env:
|
|
112
|
+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Common Tag Patterns
|
|
116
|
+
|
|
117
|
+
| Tag | Purpose | Example Use |
|
|
118
|
+
|-----|---------|-------------|
|
|
119
|
+
| `local` | Checks suitable for local development | Pre-commit hooks, developer testing |
|
|
120
|
+
| `remote` | Checks designed for CI/CD environments | GitHub Actions, Jenkins |
|
|
121
|
+
| `fast` | Quick checks (< 30 seconds) | Rapid feedback loops |
|
|
122
|
+
| `slow` | Time-consuming checks | Nightly builds, release validation |
|
|
123
|
+
| `security` | Security-related checks | Security audits |
|
|
124
|
+
| `performance` | Performance analysis | Performance testing |
|
|
125
|
+
| `style` | Code style and formatting | Linting, formatting |
|
|
126
|
+
| `experimental` | Beta/testing features | Opt-in testing |
|
|
127
|
+
| `critical` | Must-pass checks | Release gates |
|
|
128
|
+
| `comprehensive` | Thorough analysis | Full PR reviews |
|
|
129
|
+
|
|
130
|
+
### Advanced Examples
|
|
131
|
+
|
|
132
|
+
#### Default behavior vs. explicit tags
|
|
133
|
+
|
|
134
|
+
By default (no tag filter provided), only untagged checks execute. To include tagged checks, specify them explicitly:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Default (no flags): only untagged checks
|
|
138
|
+
visor
|
|
139
|
+
|
|
140
|
+
# Include github-tagged checks (e.g., GitHub operations)
|
|
141
|
+
visor --tags github
|
|
142
|
+
|
|
143
|
+
# Include multiple tag groups
|
|
144
|
+
visor --tags github,security
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
In the test runner, you can mirror this behavior with the tests DSL:
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
# defaults/.visor.tests.yaml
|
|
151
|
+
tests:
|
|
152
|
+
defaults:
|
|
153
|
+
# Run GitHub-tagged checks during tests
|
|
154
|
+
tags: "github"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Environment-Specific Execution
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
# Development environment - fast feedback
|
|
161
|
+
development:
|
|
162
|
+
extends: .visor.yaml
|
|
163
|
+
tag_filter:
|
|
164
|
+
include: ["local", "fast"]
|
|
165
|
+
exclude: ["experimental"]
|
|
166
|
+
|
|
167
|
+
# Staging environment - balanced
|
|
168
|
+
staging:
|
|
169
|
+
extends: .visor.yaml
|
|
170
|
+
tag_filter:
|
|
171
|
+
include: ["remote", "security", "performance"]
|
|
172
|
+
exclude: ["experimental"]
|
|
173
|
+
|
|
174
|
+
# Production environment - comprehensive
|
|
175
|
+
production:
|
|
176
|
+
extends: .visor.yaml
|
|
177
|
+
tag_filter:
|
|
178
|
+
include: ["remote", "comprehensive", "critical"]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### Multi-Stage Pipeline
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
# GitHub Actions workflow with progressive checks
|
|
185
|
+
name: Progressive Code Review
|
|
186
|
+
on: pull_request
|
|
187
|
+
|
|
188
|
+
jobs:
|
|
189
|
+
stage-1-fast:
|
|
190
|
+
runs-on: ubuntu-latest
|
|
191
|
+
steps:
|
|
192
|
+
- uses: actions/checkout@v4
|
|
193
|
+
- uses: probelabs/visor@v1
|
|
194
|
+
with:
|
|
195
|
+
tags: "fast,critical"
|
|
196
|
+
fail-fast: "true" # Stop if critical issues found
|
|
197
|
+
|
|
198
|
+
stage-2-security:
|
|
199
|
+
needs: stage-1-fast
|
|
200
|
+
runs-on: ubuntu-latest
|
|
201
|
+
steps:
|
|
202
|
+
- uses: actions/checkout@v4
|
|
203
|
+
- uses: probelabs/visor@v1
|
|
204
|
+
with:
|
|
205
|
+
tags: "security"
|
|
206
|
+
exclude-tags: "fast" # Run deeper security checks
|
|
207
|
+
|
|
208
|
+
stage-3-comprehensive:
|
|
209
|
+
needs: [stage-1-fast, stage-2-security]
|
|
210
|
+
runs-on: ubuntu-latest
|
|
211
|
+
steps:
|
|
212
|
+
- uses: actions/checkout@v4
|
|
213
|
+
- uses: probelabs/visor@v1
|
|
214
|
+
with:
|
|
215
|
+
tags: "comprehensive"
|
|
216
|
+
exclude-tags: "fast,security" # Run remaining checks
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
#### Dependency-Aware Filtering
|
|
220
|
+
|
|
221
|
+
When using tags with dependencies, Visor intelligently handles missing dependencies:
|
|
222
|
+
|
|
223
|
+
```yaml
|
|
224
|
+
steps:
|
|
225
|
+
data-validation:
|
|
226
|
+
type: ai
|
|
227
|
+
prompt: "Validate data structures"
|
|
228
|
+
tags: ["local", "data"]
|
|
229
|
+
|
|
230
|
+
api-validation:
|
|
231
|
+
type: ai
|
|
232
|
+
prompt: "Validate API contracts"
|
|
233
|
+
tags: ["remote", "api"]
|
|
234
|
+
|
|
235
|
+
integration-report:
|
|
236
|
+
type: noop
|
|
237
|
+
tags: ["reporting"]
|
|
238
|
+
depends_on: [data-validation, api-validation]
|
|
239
|
+
# When filtered by "local" tag, only uses data-validation
|
|
240
|
+
# When filtered by "remote" tag, only uses api-validation
|
|
241
|
+
# With no filter, uses both dependencies
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Tag Validation Rules
|
|
245
|
+
|
|
246
|
+
- Tags must start with an alphanumeric character
|
|
247
|
+
- Can contain letters, numbers, hyphens, and underscores
|
|
248
|
+
- Examples: `local`, `test-env`, `feature_flag`, `v2`
|
|
249
|
+
- Invalid: `-invalid`, `@special`, `tag with spaces`
|
|
250
|
+
|
|
251
|
+
### Best Practices
|
|
252
|
+
|
|
253
|
+
1. Use consistent naming conventions across your organization
|
|
254
|
+
2. Document your tag taxonomy in your team's wiki
|
|
255
|
+
3. Start simple: begin with `local`/`remote` or `fast`/`slow`
|
|
256
|
+
4. Avoid over-tagging to reduce confusion
|
|
257
|
+
5. Use tag combinations for fine-grained control
|
|
258
|
+
6. Test tag filters before deploying broadly
|