@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,636 @@
|
|
|
1
|
+
# Debugging Guide for Visor
|
|
2
|
+
|
|
3
|
+
This guide provides comprehensive debugging techniques and tools to help troubleshoot Visor configurations, checks, and transformations.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Debug Mode](#debug-mode)
|
|
7
|
+
- [Debugging JavaScript Expressions](#debugging-javascript-expressions)
|
|
8
|
+
- [Debugging Liquid Templates](#debugging-liquid-templates)
|
|
9
|
+
- [Using the Logger Check](#using-the-logger-check)
|
|
10
|
+
- [Common Debugging Patterns](#common-debugging-patterns)
|
|
11
|
+
- [Author Permission Functions](#author-permission-functions)
|
|
12
|
+
- [Troubleshooting Tips](#troubleshooting-tips)
|
|
13
|
+
|
|
14
|
+
## Debug Mode
|
|
15
|
+
|
|
16
|
+
Enable debug mode to see detailed execution information:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# CLI
|
|
20
|
+
visor --check all --debug
|
|
21
|
+
|
|
22
|
+
# GitHub Action
|
|
23
|
+
- uses: probelabs/visor-action@v1
|
|
24
|
+
with:
|
|
25
|
+
debug: true
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Debug mode provides:
|
|
29
|
+
- Detailed AI provider interactions
|
|
30
|
+
- Template rendering details
|
|
31
|
+
- Expression evaluation results
|
|
32
|
+
- Dependency resolution paths
|
|
33
|
+
- Error stack traces
|
|
34
|
+
|
|
35
|
+
## Debugging JavaScript Expressions
|
|
36
|
+
|
|
37
|
+
### Using the `log()` Function
|
|
38
|
+
|
|
39
|
+
The `log()` function is available in JavaScript expressions for debugging:
|
|
40
|
+
|
|
41
|
+
#### In `if` Conditions
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
steps:
|
|
45
|
+
analyze-bugs:
|
|
46
|
+
type: ai
|
|
47
|
+
depends_on: [fetch-tickets]
|
|
48
|
+
if: |
|
|
49
|
+
log("Full outputs object:", outputs);
|
|
50
|
+
log("Ticket data:", outputs["fetch-tickets"]);
|
|
51
|
+
log("Issue type:", outputs["fetch-tickets"]?.issueType);
|
|
52
|
+
outputs["fetch-tickets"]?.issueType === "Bug"
|
|
53
|
+
prompt: "Analyze this bug"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### In `fail_if` Conditions
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
steps:
|
|
60
|
+
security-check:
|
|
61
|
+
type: ai
|
|
62
|
+
prompt: "Check for security issues"
|
|
63
|
+
fail_if: |
|
|
64
|
+
log("Checking issues:", output.issues);
|
|
65
|
+
log("Critical count:", output.issues.filter(i => i.severity === "critical").length);
|
|
66
|
+
output.issues.filter(i => i.severity === "critical").length > 0
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### In `transform_js`
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
steps:
|
|
73
|
+
process-data:
|
|
74
|
+
type: command
|
|
75
|
+
exec: curl -s https://api.example.com/data
|
|
76
|
+
transform_js: |
|
|
77
|
+
log("Raw response:", output);
|
|
78
|
+
|
|
79
|
+
// Parse JSON with error handling
|
|
80
|
+
let data;
|
|
81
|
+
try {
|
|
82
|
+
data = JSON.parse(output);
|
|
83
|
+
log("Parsed successfully:", data);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
log("Parse error:", e.message);
|
|
86
|
+
return { error: e.message };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Transform the data
|
|
90
|
+
const transformed = data.items.map(item => ({
|
|
91
|
+
id: item.id,
|
|
92
|
+
score: item.metrics.score
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
log("Transformed result:", transformed);
|
|
96
|
+
return transformed;
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Debug Output Format
|
|
100
|
+
|
|
101
|
+
The `log()` function prefixes output with 🔍 for easy identification:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
🔍 Debug: Full outputs object: { 'fetch-tickets': { issueType: 'Bug', priority: 'High' } }
|
|
105
|
+
🔍 Debug: Issue type: Bug
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Debugging Liquid Templates
|
|
109
|
+
|
|
110
|
+
### Using the `json` Filter
|
|
111
|
+
|
|
112
|
+
The `json` filter is invaluable for inspecting data structures:
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
steps:
|
|
116
|
+
debug-template:
|
|
117
|
+
type: log
|
|
118
|
+
message: |
|
|
119
|
+
=== Debug Information ===
|
|
120
|
+
|
|
121
|
+
PR Context:
|
|
122
|
+
{{ pr | json }}
|
|
123
|
+
|
|
124
|
+
Dependency Outputs:
|
|
125
|
+
{{ outputs | json }}
|
|
126
|
+
|
|
127
|
+
Environment:
|
|
128
|
+
{{ env | json }}
|
|
129
|
+
|
|
130
|
+
Files Changed:
|
|
131
|
+
{{ files | json }}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Inspecting Specific Values
|
|
135
|
+
|
|
136
|
+
```liquid
|
|
137
|
+
# Check if a variable exists
|
|
138
|
+
{% if outputs.fetch-tickets %}
|
|
139
|
+
Tickets found: {{ outputs.fetch-tickets | json }}
|
|
140
|
+
{% else %}
|
|
141
|
+
No tickets data available
|
|
142
|
+
{% endif %}
|
|
143
|
+
|
|
144
|
+
# Debug array access
|
|
145
|
+
{% for item in outputs.fetch-items %}
|
|
146
|
+
Item {{ forloop.index }}: {{ item | json }}
|
|
147
|
+
{% endfor %}
|
|
148
|
+
|
|
149
|
+
# Debug nested access
|
|
150
|
+
Nested value: {{ outputs["complex-check"]["data"]["nested"]["value"] | default: "Not found" }}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Using the Logger Check
|
|
154
|
+
|
|
155
|
+
The `logger` check type is designed for debugging workflows:
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
steps:
|
|
159
|
+
debug-dependencies:
|
|
160
|
+
type: logger
|
|
161
|
+
depends_on: [fetch-data, process-data]
|
|
162
|
+
message: |
|
|
163
|
+
=== Debugging Dependency Flow ===
|
|
164
|
+
|
|
165
|
+
Fetch Data Output:
|
|
166
|
+
{{ outputs["fetch-data"] | json }}
|
|
167
|
+
|
|
168
|
+
Processed Data:
|
|
169
|
+
{{ outputs["process-data"] | json }}
|
|
170
|
+
|
|
171
|
+
PR Number: {{ pr.number }}
|
|
172
|
+
Files Count: {{ files | size }}
|
|
173
|
+
level: info # info, warning, error, debug
|
|
174
|
+
include_dependencies: true
|
|
175
|
+
include_pr_context: true
|
|
176
|
+
include_metadata: true
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Logger Check Options
|
|
180
|
+
|
|
181
|
+
| Option | Description | Default |
|
|
182
|
+
|--------|-------------|---------|
|
|
183
|
+
| `message` | Liquid template for the log message | Required |
|
|
184
|
+
| `level` | Log level: debug, info, warning, error | `info` |
|
|
185
|
+
| `include_dependencies` | Include dependency results | `true` |
|
|
186
|
+
| `include_pr_context` | Include PR information | `true` |
|
|
187
|
+
| `include_metadata` | Include execution metadata | `true` |
|
|
188
|
+
|
|
189
|
+
## Common Debugging Patterns
|
|
190
|
+
|
|
191
|
+
### 1. Debugging forEach Iterations
|
|
192
|
+
|
|
193
|
+
```yaml
|
|
194
|
+
steps:
|
|
195
|
+
fetch-items:
|
|
196
|
+
type: command
|
|
197
|
+
exec: echo '[{"id":1,"name":"A"},{"id":2,"name":"B"}]'
|
|
198
|
+
transform_js: |
|
|
199
|
+
const items = JSON.parse(output);
|
|
200
|
+
log("Total items:", items.length);
|
|
201
|
+
items.forEach((item, index) => {
|
|
202
|
+
log(`Item ${index}:`, item);
|
|
203
|
+
});
|
|
204
|
+
return items;
|
|
205
|
+
forEach: true
|
|
206
|
+
|
|
207
|
+
process-item:
|
|
208
|
+
type: logger
|
|
209
|
+
depends_on: [fetch-items]
|
|
210
|
+
message: |
|
|
211
|
+
Processing item: {{ outputs["fetch-items"] | json }}
|
|
212
|
+
All processed so far: {{ outputs.history["fetch-items"] | json }}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Note:** Use `outputs.history['check-name']` to access all previous iteration outputs. See [Output History](./output-history.md) for tracking outputs across loop iterations and forEach processing.
|
|
216
|
+
|
|
217
|
+
**Note on forEach outputs**: When a check uses `forEach`, its output is automatically unwrapped in both templates and JavaScript contexts, giving you direct access to the array. This makes it easier to work with the data:
|
|
218
|
+
|
|
219
|
+
```yaml
|
|
220
|
+
steps:
|
|
221
|
+
analyze-tickets:
|
|
222
|
+
type: command
|
|
223
|
+
depends_on: [fetch-tickets]
|
|
224
|
+
if: |
|
|
225
|
+
// Direct access to the array from forEach check
|
|
226
|
+
log("Tickets:", outputs["fetch-tickets"]);
|
|
227
|
+
outputs["fetch-tickets"].some(t => t.issueType === "Bug")
|
|
228
|
+
exec: echo "Processing bugs..."
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### 2. Debugging Conditional Execution
|
|
232
|
+
|
|
233
|
+
```yaml
|
|
234
|
+
steps:
|
|
235
|
+
conditional-check:
|
|
236
|
+
type: command
|
|
237
|
+
exec: echo "test"
|
|
238
|
+
if: |
|
|
239
|
+
// Debug all available context
|
|
240
|
+
log("Event:", event);
|
|
241
|
+
log("Branch:", branch);
|
|
242
|
+
log("Files changed:", filesChanged);
|
|
243
|
+
log("Outputs available:", Object.keys(outputs));
|
|
244
|
+
|
|
245
|
+
// Complex condition with debugging
|
|
246
|
+
const shouldRun = branch === "main" && filesChanged.length > 0;
|
|
247
|
+
log("Should run?", shouldRun);
|
|
248
|
+
return shouldRun;
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### 3. Debugging Transform Chains
|
|
252
|
+
|
|
253
|
+
```yaml
|
|
254
|
+
steps:
|
|
255
|
+
fetch-raw:
|
|
256
|
+
type: command
|
|
257
|
+
exec: curl -s https://api.example.com/data
|
|
258
|
+
transform_js: |
|
|
259
|
+
log("Step 1 - Raw:", output.substring(0, 100));
|
|
260
|
+
return output;
|
|
261
|
+
|
|
262
|
+
parse-json:
|
|
263
|
+
type: command
|
|
264
|
+
depends_on: [fetch-raw]
|
|
265
|
+
exec: echo '{{ outputs["fetch-raw"] }}'
|
|
266
|
+
transform_js: |
|
|
267
|
+
log("Step 2 - Input:", output.substring(0, 100));
|
|
268
|
+
const parsed = JSON.parse(output);
|
|
269
|
+
log("Step 2 - Parsed:", parsed);
|
|
270
|
+
return parsed;
|
|
271
|
+
|
|
272
|
+
extract-data:
|
|
273
|
+
type: logger
|
|
274
|
+
depends_on: [parse-json]
|
|
275
|
+
message: |
|
|
276
|
+
Final data: {{ outputs["parse-json"] | json }}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### 4. Debugging AI Prompts
|
|
280
|
+
|
|
281
|
+
```yaml
|
|
282
|
+
steps:
|
|
283
|
+
debug-ai-context:
|
|
284
|
+
type: logger
|
|
285
|
+
depends_on: [fetch-context]
|
|
286
|
+
message: |
|
|
287
|
+
=== AI Prompt Context ===
|
|
288
|
+
Context data: {{ outputs["fetch-context"] | json }}
|
|
289
|
+
|
|
290
|
+
Files to analyze: {{ files | size }}
|
|
291
|
+
{% for file in files %}
|
|
292
|
+
- {{ file.path }}: {{ file.additions }} additions, {{ file.deletions }} deletions
|
|
293
|
+
{% endfor %}
|
|
294
|
+
|
|
295
|
+
ai-analysis:
|
|
296
|
+
type: ai
|
|
297
|
+
depends_on: [debug-ai-context, fetch-context]
|
|
298
|
+
prompt: |
|
|
299
|
+
Analyze the following data:
|
|
300
|
+
{{ outputs["fetch-context"] | json }}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Troubleshooting Tips
|
|
304
|
+
|
|
305
|
+
### 1. Check Dependency Output Structure
|
|
306
|
+
|
|
307
|
+
When `outputs` access fails, debug the structure:
|
|
308
|
+
|
|
309
|
+
```yaml
|
|
310
|
+
steps:
|
|
311
|
+
debug-outputs:
|
|
312
|
+
type: command
|
|
313
|
+
depends_on: [previous-check]
|
|
314
|
+
exec: echo "debugging"
|
|
315
|
+
transform_js: |
|
|
316
|
+
log("All outputs:", outputs);
|
|
317
|
+
log("Output keys:", Object.keys(outputs));
|
|
318
|
+
log("Previous check type:", typeof outputs["previous-check"]);
|
|
319
|
+
log("Is array?", Array.isArray(outputs["previous-check"]));
|
|
320
|
+
|
|
321
|
+
// Debug output history
|
|
322
|
+
log("History available:", !!outputs.history);
|
|
323
|
+
log("History keys:", Object.keys(outputs.history || {}));
|
|
324
|
+
log("Previous check history length:", outputs.history["previous-check"]?.length);
|
|
325
|
+
|
|
326
|
+
return "debug complete";
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**Tip:** Use `outputs` for current values and `outputs.history` to see all previous values from loop iterations or retries. See [Output History](./output-history.md) for more details.
|
|
330
|
+
|
|
331
|
+
### 2. Validate JSON Before Parsing
|
|
332
|
+
|
|
333
|
+
```yaml
|
|
334
|
+
transform_js: |
|
|
335
|
+
log("Raw output type:", typeof output);
|
|
336
|
+
log("First 50 chars:", output.substring(0, 50));
|
|
337
|
+
|
|
338
|
+
// Safe JSON parsing
|
|
339
|
+
try {
|
|
340
|
+
const data = JSON.parse(output);
|
|
341
|
+
log("Parse successful");
|
|
342
|
+
return data;
|
|
343
|
+
} catch (e) {
|
|
344
|
+
log("Parse failed:", e.message);
|
|
345
|
+
log("Invalid JSON:", output);
|
|
346
|
+
return { error: "Invalid JSON", raw: output };
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### 3. Debug Environment Variables
|
|
351
|
+
|
|
352
|
+
```yaml
|
|
353
|
+
steps:
|
|
354
|
+
debug-env:
|
|
355
|
+
type: logger
|
|
356
|
+
message: |
|
|
357
|
+
Environment Variables:
|
|
358
|
+
{% for key in env %}
|
|
359
|
+
- {{ key }}: {{ env[key] }}
|
|
360
|
+
{% endfor %}
|
|
361
|
+
|
|
362
|
+
GitHub Context:
|
|
363
|
+
- Event: {{ event.event_name }}
|
|
364
|
+
- Action: {{ event.action }}
|
|
365
|
+
- Repository: {{ event.repository }}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### 4. Debug File Patterns
|
|
369
|
+
|
|
370
|
+
```yaml
|
|
371
|
+
steps:
|
|
372
|
+
debug-files:
|
|
373
|
+
type: command
|
|
374
|
+
exec: echo "checking files"
|
|
375
|
+
if: |
|
|
376
|
+
const jsFiles = filesChanged.filter(f => f.endsWith('.js'));
|
|
377
|
+
const tsFiles = filesChanged.filter(f => f.endsWith('.ts'));
|
|
378
|
+
|
|
379
|
+
log("JS files:", jsFiles);
|
|
380
|
+
log("TS files:", tsFiles);
|
|
381
|
+
log("Has source changes:", jsFiles.length > 0 || tsFiles.length > 0);
|
|
382
|
+
|
|
383
|
+
return jsFiles.length > 0 || tsFiles.length > 0;
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### 5. Debug Schema Validation
|
|
387
|
+
|
|
388
|
+
```yaml
|
|
389
|
+
steps:
|
|
390
|
+
validate-output:
|
|
391
|
+
type: command
|
|
392
|
+
exec: echo '{"items":[1,2,3]}'
|
|
393
|
+
transform_js: |
|
|
394
|
+
const data = JSON.parse(output);
|
|
395
|
+
|
|
396
|
+
// Validate structure
|
|
397
|
+
log("Has items?", "items" in data);
|
|
398
|
+
log("Items is array?", Array.isArray(data.items));
|
|
399
|
+
log("Items count:", data.items?.length);
|
|
400
|
+
|
|
401
|
+
if (!data.items || !Array.isArray(data.items)) {
|
|
402
|
+
log("Invalid structure:", data);
|
|
403
|
+
throw new Error("Expected items array");
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
return data.items;
|
|
407
|
+
schema:
|
|
408
|
+
type: array
|
|
409
|
+
items:
|
|
410
|
+
type: number
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
## Best Practices
|
|
414
|
+
|
|
415
|
+
1. **Use Progressive Debugging**: Start with high-level logs, then add more detail as needed
|
|
416
|
+
2. **Clean Up Logs**: Remove or comment out `log()` calls in production configs
|
|
417
|
+
3. **Log at Boundaries**: Add logs at the start/end of transforms and conditions
|
|
418
|
+
4. **Include Context**: Log not just values but also their types and structures
|
|
419
|
+
5. **Use Structured Output**: Return objects with error details rather than throwing errors
|
|
420
|
+
|
|
421
|
+
## Environment Variables for Debugging
|
|
422
|
+
|
|
423
|
+
Set these environment variables for additional debug output:
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
# Show all debug output
|
|
427
|
+
export DEBUG=1
|
|
428
|
+
|
|
429
|
+
# Show Liquid template rendering
|
|
430
|
+
export DEBUG_TEMPLATES=1
|
|
431
|
+
|
|
432
|
+
# Show command execution details
|
|
433
|
+
export DEBUG_COMMANDS=1
|
|
434
|
+
|
|
435
|
+
# Show dependency resolution
|
|
436
|
+
export DEBUG_DEPS=1
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
## Common Issues and Solutions
|
|
440
|
+
|
|
441
|
+
### Issue: "outputs is undefined"
|
|
442
|
+
|
|
443
|
+
```yaml
|
|
444
|
+
# Wrong - check has no dependencies
|
|
445
|
+
steps:
|
|
446
|
+
my-check:
|
|
447
|
+
type: command
|
|
448
|
+
exec: echo "{{ outputs.other }}" # Error: outputs is undefined
|
|
449
|
+
|
|
450
|
+
# Correct - add depends_on
|
|
451
|
+
steps:
|
|
452
|
+
my-check:
|
|
453
|
+
type: command
|
|
454
|
+
depends_on: [other]
|
|
455
|
+
exec: echo "{{ outputs.other }}" # Now outputs is available
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Issue: "Cannot read property of undefined"
|
|
459
|
+
|
|
460
|
+
```yaml
|
|
461
|
+
# Debug the structure first
|
|
462
|
+
transform_js: |
|
|
463
|
+
log("Output structure:", output);
|
|
464
|
+
log("Has data property?", output && output.data !== undefined);
|
|
465
|
+
|
|
466
|
+
// Safe access with optional chaining
|
|
467
|
+
const value = output?.data?.items?.[0]?.value;
|
|
468
|
+
log("Extracted value:", value);
|
|
469
|
+
|
|
470
|
+
return value || "default";
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Issue: "Expression evaluation error"
|
|
474
|
+
|
|
475
|
+
```yaml
|
|
476
|
+
# Debug the expression step by step
|
|
477
|
+
if: |
|
|
478
|
+
log("Step 1 - outputs exists:", outputs !== undefined);
|
|
479
|
+
log("Step 2 - has key:", "my-check" in outputs);
|
|
480
|
+
log("Step 3 - value:", outputs["my-check"]);
|
|
481
|
+
|
|
482
|
+
// Break complex expressions into steps
|
|
483
|
+
const hasData = outputs && outputs["my-check"];
|
|
484
|
+
const isValid = hasData && outputs["my-check"].status === "success";
|
|
485
|
+
|
|
486
|
+
log("Final result:", isValid);
|
|
487
|
+
return isValid;
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
## Author Permission Functions
|
|
491
|
+
|
|
492
|
+
> **📖 For complete documentation, examples, and best practices, see [Author Permissions Guide](./author-permissions.md)**
|
|
493
|
+
|
|
494
|
+
Visor provides helper functions to check the PR author's permission level in JavaScript expressions (`if`, `fail_if`, `transform_js`). These functions use GitHub's `author_association` field.
|
|
495
|
+
|
|
496
|
+
### Permission Hierarchy
|
|
497
|
+
|
|
498
|
+
From highest to lowest privilege:
|
|
499
|
+
- **OWNER** - Repository owner
|
|
500
|
+
- **MEMBER** - Organization member
|
|
501
|
+
- **COLLABORATOR** - Invited collaborator
|
|
502
|
+
- **CONTRIBUTOR** - Has contributed before
|
|
503
|
+
- **FIRST_TIME_CONTRIBUTOR** - First PR to this repo
|
|
504
|
+
- **FIRST_TIMER** - First GitHub contribution ever
|
|
505
|
+
- **NONE** - No association
|
|
506
|
+
|
|
507
|
+
### Available Functions
|
|
508
|
+
|
|
509
|
+
#### `hasMinPermission(level)`
|
|
510
|
+
|
|
511
|
+
Check if author has **at least** the specified permission level (>= logic):
|
|
512
|
+
|
|
513
|
+
```yaml
|
|
514
|
+
steps:
|
|
515
|
+
# Run security scan for external contributors only
|
|
516
|
+
security-scan:
|
|
517
|
+
type: command
|
|
518
|
+
exec: npm run security-scan
|
|
519
|
+
if: "!hasMinPermission('MEMBER')" # Not owner or member
|
|
520
|
+
|
|
521
|
+
# Auto-approve for trusted contributors
|
|
522
|
+
auto-approve:
|
|
523
|
+
type: command
|
|
524
|
+
exec: gh pr review --approve
|
|
525
|
+
if: "hasMinPermission('COLLABORATOR')" # Collaborators and above
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
#### `isOwner()`, `isMember()`, `isCollaborator()`, `isContributor()`
|
|
529
|
+
|
|
530
|
+
Boolean checks for specific or hierarchical permission levels:
|
|
531
|
+
|
|
532
|
+
```yaml
|
|
533
|
+
steps:
|
|
534
|
+
# Different workflows based on permission
|
|
535
|
+
code-review:
|
|
536
|
+
type: ai
|
|
537
|
+
prompt: "Review code"
|
|
538
|
+
if: |
|
|
539
|
+
log("Author is owner:", isOwner());
|
|
540
|
+
log("Author is member:", isMember());
|
|
541
|
+
log("Author is collaborator:", isCollaborator());
|
|
542
|
+
|
|
543
|
+
// Members can skip review
|
|
544
|
+
!isMember()
|
|
545
|
+
|
|
546
|
+
# Block sensitive file changes from non-members
|
|
547
|
+
sensitive-files-check:
|
|
548
|
+
type: command
|
|
549
|
+
exec: echo "Checking sensitive files..."
|
|
550
|
+
fail_if: |
|
|
551
|
+
!isMember() && files.some(f =>
|
|
552
|
+
f.filename.startsWith('secrets/') ||
|
|
553
|
+
f.filename === '.env' ||
|
|
554
|
+
f.filename.endsWith('.key')
|
|
555
|
+
)
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
#### `isFirstTimer()`
|
|
559
|
+
|
|
560
|
+
Check if author is a first-time contributor:
|
|
561
|
+
|
|
562
|
+
```yaml
|
|
563
|
+
steps:
|
|
564
|
+
welcome-message:
|
|
565
|
+
type: command
|
|
566
|
+
exec: gh pr comment --body "Welcome to the project!"
|
|
567
|
+
if: "isFirstTimer()"
|
|
568
|
+
|
|
569
|
+
require-review:
|
|
570
|
+
type: command
|
|
571
|
+
exec: gh pr review --request-changes
|
|
572
|
+
fail_if: "isFirstTimer() && outputs.issues?.length > 5"
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
### Local Mode Behavior
|
|
576
|
+
|
|
577
|
+
When running locally (not in GitHub Actions):
|
|
578
|
+
- All permission checks return `true` (treated as owner)
|
|
579
|
+
- `isFirstTimer()` returns `false`
|
|
580
|
+
- This prevents blocking local development/testing
|
|
581
|
+
|
|
582
|
+
### Examples
|
|
583
|
+
|
|
584
|
+
#### Conditional Security Scanning
|
|
585
|
+
|
|
586
|
+
```yaml
|
|
587
|
+
steps:
|
|
588
|
+
# Run expensive security scan only for external contributors
|
|
589
|
+
deep-security-scan:
|
|
590
|
+
type: command
|
|
591
|
+
exec: npm run security-scan:deep
|
|
592
|
+
if: "!hasMinPermission('MEMBER')"
|
|
593
|
+
|
|
594
|
+
# Quick scan for trusted members
|
|
595
|
+
quick-security-scan:
|
|
596
|
+
type: command
|
|
597
|
+
exec: npm run security-scan:quick
|
|
598
|
+
if: "hasMinPermission('MEMBER')"
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
#### Require Reviews Based on Permission
|
|
602
|
+
|
|
603
|
+
```yaml
|
|
604
|
+
steps:
|
|
605
|
+
require-approval:
|
|
606
|
+
type: command
|
|
607
|
+
exec: gh pr review --request-changes
|
|
608
|
+
fail_if: |
|
|
609
|
+
// First-timers need clean PRs
|
|
610
|
+
(isFirstTimer() && totalIssues > 0) ||
|
|
611
|
+
// Non-collaborators need approval for large changes
|
|
612
|
+
(!hasMinPermission('COLLABORATOR') && pr.totalAdditions > 500)
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
#### Auto-merge for Trusted Contributors
|
|
616
|
+
|
|
617
|
+
```yaml
|
|
618
|
+
steps:
|
|
619
|
+
auto-merge:
|
|
620
|
+
type: command
|
|
621
|
+
depends_on: [tests, lint, security-scan]
|
|
622
|
+
exec: gh pr merge --auto --squash
|
|
623
|
+
if: |
|
|
624
|
+
// Only auto-merge for collaborators with passing checks
|
|
625
|
+
hasMinPermission('COLLABORATOR') &&
|
|
626
|
+
outputs.tests.error === false &&
|
|
627
|
+
outputs.lint.error === false &&
|
|
628
|
+
outputs["security-scan"].criticalIssues === 0
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
## Further Reading
|
|
632
|
+
|
|
633
|
+
- [Liquid Templates Guide](./liquid-templates.md) - Template syntax and variables
|
|
634
|
+
- [Command Provider Documentation](./command-provider.md) - Command execution and transforms
|
|
635
|
+
- [Configuration Reference](./configuration.md) - Full configuration options
|
|
636
|
+
- [GitHub Actions Integration](./github-actions.md) - CI/CD debugging
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Default Output Schema and Timestamps
|
|
2
|
+
|
|
3
|
+
Visor normalizes check outputs to make prompts and history handling predictable. There are exactly two modes:
|
|
4
|
+
|
|
5
|
+
1) Checks with a schema (e.g., `schema: {...}` on the check)
|
|
6
|
+
- The provider's output shape is respected.
|
|
7
|
+
- If the final output is an Object (map), Visor injects a `ts` field (milliseconds since epoch) if it is missing.
|
|
8
|
+
- If the final output is a primitive or an array, it is passed through unchanged (no wrapping, no `ts`).
|
|
9
|
+
|
|
10
|
+
2) Checks without a schema
|
|
11
|
+
- Visor uses a default schema: `{ text: string, ts: number }`.
|
|
12
|
+
- If the provider returned a primitive (string/number/boolean), it is wrapped into `{ text, ts }`.
|
|
13
|
+
- If it returned an Object, Visor injects `ts` if it is missing.
|
|
14
|
+
- If it returned an array, it is passed through unchanged.
|
|
15
|
+
|
|
16
|
+
This normalization happens after the provider returns and before outputs are recorded into `outputs` and `outputs_history`.
|
|
17
|
+
|
|
18
|
+
Why this exists
|
|
19
|
+
- Prompts and templates can reliably access `.text` and `.ts` for no‑schema checks (e.g., human‑input), and can still trust custom shapes for schema’d checks.
|
|
20
|
+
- `ts` allows you to sort/merge histories across steps without bespoke engines or roles.
|
|
21
|
+
|
|
22
|
+
Practical tips
|
|
23
|
+
- Human input defaults to `{ text, ts }`. In Liquid, read `outputs_history.ask[i].text` safely with a fallback: `{% if u.text %}{{ u.text }}{% else %}{{ u }}{% endif %}` for legacy mocks.
|
|
24
|
+
- For schema’d AI checks, add `ts` to your schema if you want it persisted by validators; otherwise Visor will add it at runtime (not validated).
|
|
25
|
+
- Arrays are passed through untouched; if you need timestamps per item, include them in your own schema.
|
|
26
|
+
|
|
27
|
+
Related
|
|
28
|
+
- See `docs/human-input-provider.md` for default output shape of human input.
|