@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,369 @@
|
|
|
1
|
+
## 📊 Step Dependencies & Intelligent Execution
|
|
2
|
+
|
|
3
|
+
Visor supports defining dependencies between checks using `depends_on`. This enables:
|
|
4
|
+
|
|
5
|
+
- Sequential execution: dependents wait for prerequisites to finish
|
|
6
|
+
- Parallel optimization: independent checks run simultaneously
|
|
7
|
+
- Smart scheduling: automatic topological ordering
|
|
8
|
+
|
|
9
|
+
### Configuration Example
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
version: "1.0"
|
|
13
|
+
steps:
|
|
14
|
+
security:
|
|
15
|
+
type: ai
|
|
16
|
+
group: code-review
|
|
17
|
+
schema: code-review
|
|
18
|
+
prompt: "Comprehensive security analysis..."
|
|
19
|
+
tags:
|
|
20
|
+
- security
|
|
21
|
+
- critical
|
|
22
|
+
- comprehensive
|
|
23
|
+
on:
|
|
24
|
+
- pr_opened
|
|
25
|
+
- pr_updated
|
|
26
|
+
# No dependencies - runs first
|
|
27
|
+
|
|
28
|
+
performance:
|
|
29
|
+
type: ai
|
|
30
|
+
group: code-review
|
|
31
|
+
schema: code-review
|
|
32
|
+
prompt: "Performance analysis..."
|
|
33
|
+
tags:
|
|
34
|
+
- performance
|
|
35
|
+
- fast
|
|
36
|
+
- local
|
|
37
|
+
- remote
|
|
38
|
+
on:
|
|
39
|
+
- pr_opened
|
|
40
|
+
- pr_updated
|
|
41
|
+
# No dependencies - runs parallel with security
|
|
42
|
+
|
|
43
|
+
style:
|
|
44
|
+
type: ai
|
|
45
|
+
group: code-review
|
|
46
|
+
schema: code-review
|
|
47
|
+
prompt: "Style analysis based on security findings..."
|
|
48
|
+
tags:
|
|
49
|
+
- style
|
|
50
|
+
- fast
|
|
51
|
+
- local
|
|
52
|
+
on:
|
|
53
|
+
- pr_opened
|
|
54
|
+
depends_on:
|
|
55
|
+
- security # Waits for security to complete
|
|
56
|
+
|
|
57
|
+
architecture:
|
|
58
|
+
type: ai
|
|
59
|
+
group: code-review
|
|
60
|
+
schema: code-review
|
|
61
|
+
prompt: "Architecture analysis building on previous checks..."
|
|
62
|
+
on:
|
|
63
|
+
- pr_opened
|
|
64
|
+
- pr_updated
|
|
65
|
+
depends_on:
|
|
66
|
+
- security
|
|
67
|
+
- performance
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Execution Flow
|
|
71
|
+
|
|
72
|
+
1. Level 0: `security` and `performance` run in parallel
|
|
73
|
+
2. Level 1: `style` runs after `security`
|
|
74
|
+
3. Level 2: `architecture` runs after both
|
|
75
|
+
|
|
76
|
+
### Advanced Patterns
|
|
77
|
+
|
|
78
|
+
#### Diamond Dependency
|
|
79
|
+
```yaml
|
|
80
|
+
steps:
|
|
81
|
+
foundation: { type: ai, group: base, schema: code-review, prompt: "Base analysis" }
|
|
82
|
+
branch_a: { type: ai, group: code-review, schema: code-review, depends_on: [foundation] }
|
|
83
|
+
branch_b: { type: ai, group: code-review, schema: code-review, depends_on: [foundation] }
|
|
84
|
+
final: { type: ai, group: summary, schema: markdown, depends_on: [branch_a, branch_b] }
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Multiple Independent Chains
|
|
88
|
+
```yaml
|
|
89
|
+
steps:
|
|
90
|
+
security_basic: { type: ai, group: security, schema: code-review }
|
|
91
|
+
security_advanced: { type: ai, group: security, schema: code-review, depends_on: [security_basic] }
|
|
92
|
+
performance_basic: { type: ai, group: performance, schema: code-review }
|
|
93
|
+
performance_advanced:{ type: ai, group: performance, schema: code-review, depends_on: [performance_basic] }
|
|
94
|
+
integration: { type: ai, group: summary, schema: markdown, depends_on: [security_advanced, performance_advanced] }
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
#### Any‑of (OR) Dependency Groups
|
|
98
|
+
|
|
99
|
+
Sometimes a check can proceed when any one of several upstream steps has completed successfully. Visor supports this with pipe‑separated tokens inside `depends_on`.
|
|
100
|
+
|
|
101
|
+
## Criticality and Gating
|
|
102
|
+
|
|
103
|
+
`continue_on_failure` controls whether dependents may run after a failure — it is a gating knob, not the definition of criticality. Classify steps by criticality (external | internal | policy | info) and derive defaults:
|
|
104
|
+
|
|
105
|
+
- Critical: `continue_on_failure: false`, require `assume`/`guarantee`, tighter loop budgets, retries only for transient faults.
|
|
106
|
+
- Non‑critical: may allow `continue_on_failure: true` to keep non‑critical branches moving.
|
|
107
|
+
|
|
108
|
+
Example — non‑critical branch that can proceed after a soft failure:
|
|
109
|
+
```yaml
|
|
110
|
+
steps:
|
|
111
|
+
summarize:
|
|
112
|
+
type: ai
|
|
113
|
+
tags:
|
|
114
|
+
- info
|
|
115
|
+
continue_on_failure: true
|
|
116
|
+
fail_if: "(output.errors || []).length > 0"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
checks:
|
|
121
|
+
parse-issue: { type: noop }
|
|
122
|
+
parse-comment: { type: noop }
|
|
123
|
+
triage: { type: noop, depends_on: ["parse-issue|parse-comment"] }
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Rules:
|
|
127
|
+
- Each string containing `|` denotes an ANY‑OF group. In the example above, either `parse-issue` or `parse-comment` satisfies the dependency for `triage`.
|
|
128
|
+
- You may combine ALL‑OF and ANY‑OF: `depends_on: ["a|b", "c"]` means “(a or b) and c”.
|
|
129
|
+
- Event gating still applies: a dependency only counts if it is applicable to the current event (has compatible `on` or no `on`).
|
|
130
|
+
- Failure/skip semantics: a member that is skipped or fails fatally does not satisfy the group; at least one member must complete without a fatal error for the group to be satisfied.
|
|
131
|
+
- Session reuse: if `reuse_ai_session: true` and `depends_on` contains a pipe group, the session parent is selected from the first satisfied member at runtime.
|
|
132
|
+
|
|
133
|
+
Tip: When targeting a leaf in ad‑hoc runs (e.g., `visor --check final`), include one member of each pipe group explicitly (e.g., `--check a --check final`) to make intent unambiguous. In normal runs Visor computes the plan automatically from your config.
|
|
134
|
+
|
|
135
|
+
### Error Handling
|
|
136
|
+
|
|
137
|
+
- Cycle detection and missing dependency validation
|
|
138
|
+
- Failed checks don't block independent branches
|
|
139
|
+
- Dependency results are available to dependents via `outputs`
|
|
140
|
+
|
|
141
|
+
## forEach Dependency Propagation with on_finish
|
|
142
|
+
|
|
143
|
+
When a check has `forEach: true`, it outputs an array and all its dependent checks run once per array item. After **all** dependents complete **all** iterations, the `on_finish` hook on the forEach check triggers to aggregate results and optionally route to a different check.
|
|
144
|
+
|
|
145
|
+
### Basic Flow
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
checks:
|
|
149
|
+
extract-items:
|
|
150
|
+
type: ai
|
|
151
|
+
forEach: true
|
|
152
|
+
# Outputs: [item1, item2, item3]
|
|
153
|
+
|
|
154
|
+
process-item:
|
|
155
|
+
depends_on: [extract-items]
|
|
156
|
+
# Runs 3 times (once per item)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Execution order:**
|
|
160
|
+
1. `extract-items` runs once → outputs `[item1, item2, item3]`
|
|
161
|
+
2. `process-item` runs 3 times (once for each item)
|
|
162
|
+
3. All 3 iterations complete
|
|
163
|
+
4. Downstream checks that depend on `process-item` can now run
|
|
164
|
+
|
|
165
|
+
### on_finish Hook for Aggregation
|
|
166
|
+
|
|
167
|
+
The `on_finish` hook runs **once** after all dependent checks complete all their iterations, making it perfect for aggregating results and making routing decisions:
|
|
168
|
+
|
|
169
|
+
```yaml
|
|
170
|
+
checks:
|
|
171
|
+
extract-facts:
|
|
172
|
+
type: ai
|
|
173
|
+
forEach: true
|
|
174
|
+
# Outputs: [fact1, fact2, fact3]
|
|
175
|
+
|
|
176
|
+
on_finish:
|
|
177
|
+
# Run aggregation check
|
|
178
|
+
run: [aggregate-validations]
|
|
179
|
+
|
|
180
|
+
# Then decide whether to retry
|
|
181
|
+
goto_js: |
|
|
182
|
+
const allValid = memory.get('all_valid', 'validation');
|
|
183
|
+
return allValid ? null : 'retry-assistant';
|
|
184
|
+
|
|
185
|
+
validate-fact:
|
|
186
|
+
depends_on: [extract-facts]
|
|
187
|
+
# Runs 3 times (once per fact)
|
|
188
|
+
|
|
189
|
+
aggregate-validations:
|
|
190
|
+
type: script
|
|
191
|
+
content: |
|
|
192
|
+
// Access ALL validation results
|
|
193
|
+
const results = outputs.history['validate-fact'];
|
|
194
|
+
const allValid = results.every(r => r.is_valid);
|
|
195
|
+
memory.set('all_valid', allValid, 'validation');
|
|
196
|
+
return { total: results.length, valid: allValid };
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Execution order:**
|
|
200
|
+
1. `extract-facts` runs once → outputs array of facts
|
|
201
|
+
2. `validate-fact` runs N times (once per fact)
|
|
202
|
+
3. **on_finish triggers:**
|
|
203
|
+
- First: `aggregate-validations` runs
|
|
204
|
+
- Then: `goto_js` evaluates
|
|
205
|
+
- If goto returns a check name, jump to that ancestor
|
|
206
|
+
4. Downstream checks continue
|
|
207
|
+
|
|
208
|
+
### When on_finish Triggers
|
|
209
|
+
|
|
210
|
+
- **Only** on checks with `forEach: true`
|
|
211
|
+
- **After** ALL dependent checks complete ALL iterations
|
|
212
|
+
- **Does not** trigger if forEach array is empty
|
|
213
|
+
- **Before** any downstream checks that don't depend on the forEach check
|
|
214
|
+
|
|
215
|
+
### Accessing forEach Results
|
|
216
|
+
|
|
217
|
+
Inside `on_finish` hooks, you have access to all iteration results via `outputs.history`:
|
|
218
|
+
|
|
219
|
+
```javascript
|
|
220
|
+
// In on_finish.goto_js or on_finish.run_js
|
|
221
|
+
{
|
|
222
|
+
outputs: {
|
|
223
|
+
'extract-facts': [...], // The forEach array
|
|
224
|
+
'validate-fact': [...], // Latest results (for compatibility)
|
|
225
|
+
},
|
|
226
|
+
outputs.history: {
|
|
227
|
+
'validate-fact': [[...], ...], // ALL results from ALL iterations
|
|
228
|
+
},
|
|
229
|
+
forEach: {
|
|
230
|
+
total: 3, // Total forEach items
|
|
231
|
+
successful: 3, // Number of successful iterations
|
|
232
|
+
failed: 0, // Number of failed iterations
|
|
233
|
+
items: [...] // The forEach items array
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Complete Example: Multi-Dependent Aggregation
|
|
239
|
+
|
|
240
|
+
The real power of `on_finish` is aggregating results from **multiple** dependent checks:
|
|
241
|
+
|
|
242
|
+
```yaml
|
|
243
|
+
checks:
|
|
244
|
+
# Step 1: Extract claims from AI response
|
|
245
|
+
extract-claims:
|
|
246
|
+
type: ai
|
|
247
|
+
forEach: true
|
|
248
|
+
prompt: "Extract all factual claims from: {{ outputs.ai-response }}"
|
|
249
|
+
transform_js: JSON.parse(output).claims
|
|
250
|
+
depends_on: [ai-response]
|
|
251
|
+
|
|
252
|
+
# Step 4: After ALL validations complete
|
|
253
|
+
on_finish:
|
|
254
|
+
run: [aggregate-all-validations]
|
|
255
|
+
goto_js: |
|
|
256
|
+
const securityOk = memory.get('security_valid', 'validation');
|
|
257
|
+
const technicalOk = memory.get('technical_valid', 'validation');
|
|
258
|
+
const attempt = memory.get('attempt', 'validation') || 0;
|
|
259
|
+
|
|
260
|
+
if (securityOk && technicalOk) {
|
|
261
|
+
return null; // All good, proceed
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (attempt >= 2) {
|
|
265
|
+
return null; // Max attempts, give up
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
memory.increment('attempt', 1, 'validation');
|
|
269
|
+
return 'ai-response'; // Retry with validation context
|
|
270
|
+
|
|
271
|
+
# Step 2: Validate security aspects (runs N times)
|
|
272
|
+
validate-security:
|
|
273
|
+
type: ai
|
|
274
|
+
depends_on: [extract-claims]
|
|
275
|
+
prompt: |
|
|
276
|
+
Validate security implications of: {{ outputs['extract-claims'].claim }}
|
|
277
|
+
|
|
278
|
+
# Step 3: Validate technical accuracy (runs N times)
|
|
279
|
+
validate-technical:
|
|
280
|
+
type: ai
|
|
281
|
+
depends_on: [extract-claims]
|
|
282
|
+
prompt: |
|
|
283
|
+
Validate technical accuracy of: {{ outputs['extract-claims'].claim }}
|
|
284
|
+
|
|
285
|
+
# Step 4a: Aggregate ALL results
|
|
286
|
+
aggregate-all-validations:
|
|
287
|
+
type: script
|
|
288
|
+
content: |
|
|
289
|
+
// Get results from BOTH dependent checks
|
|
290
|
+
const securityResults = outputs.history['validate-security'];
|
|
291
|
+
const technicalResults = outputs.history['validate-technical'];
|
|
292
|
+
|
|
293
|
+
const securityValid = securityResults.every(r => r.is_valid);
|
|
294
|
+
const technicalValid = technicalResults.every(r => r.is_valid);
|
|
295
|
+
|
|
296
|
+
memory.set('security_valid', securityValid, 'validation');
|
|
297
|
+
memory.set('technical_valid', technicalValid, 'validation');
|
|
298
|
+
|
|
299
|
+
// Store issues for retry context
|
|
300
|
+
if (!securityValid || !technicalValid) {
|
|
301
|
+
const issues = [
|
|
302
|
+
...securityResults.filter(r => !r.is_valid),
|
|
303
|
+
...technicalResults.filter(r => !r.is_valid)
|
|
304
|
+
];
|
|
305
|
+
memory.set('validation_issues', issues, 'validation');
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return {
|
|
309
|
+
security: { total: securityResults.length, valid: securityValid },
|
|
310
|
+
technical: { total: technicalResults.length, valid: technicalValid }
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
# Step 5: Post if validation passed
|
|
314
|
+
post-response:
|
|
315
|
+
type: github
|
|
316
|
+
depends_on: [extract-claims]
|
|
317
|
+
if: "memory.get('security_valid', 'validation') && memory.get('technical_valid', 'validation')"
|
|
318
|
+
op: comment.create
|
|
319
|
+
value: "{{ outputs['ai-response'] }}"
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
This is the **only way** to aggregate across multiple dependent checks in a forEach scenario. Without `on_finish`, there would be no single point where all results are available together.
|
|
323
|
+
|
|
324
|
+
### Best Practices
|
|
325
|
+
|
|
326
|
+
1. **Use outputs.history**: Access all forEach iteration results with `outputs.history['check-name']`
|
|
327
|
+
2. **Store in Memory**: Use memory to pass aggregated state to `goto_js` and downstream checks
|
|
328
|
+
3. **Handle Empty Arrays**: Check `forEach.total` or array length before processing
|
|
329
|
+
4. **Limit Loops**: Use attempt counters in memory to prevent infinite retry loops
|
|
330
|
+
5. **Multiple Dependents**: `on_finish` is perfect when you have multiple checks depending on the same forEach check
|
|
331
|
+
6. **Event Preservation**: Use `goto_event` when jumping back to maintain correct event context
|
|
332
|
+
|
|
333
|
+
### Comparison: on_finish vs Regular Dependent
|
|
334
|
+
|
|
335
|
+
| Approach | When It Runs | Access to Results | Use Case |
|
|
336
|
+
|----------|-------------|-------------------|----------|
|
|
337
|
+
| Regular dependent check | After forEach parent completes | Only parent's array items | Process individual items |
|
|
338
|
+
| `on_finish` hook | After **all** dependents complete **all** iterations | All iteration results via `outputs.history` | Aggregate, validate, route |
|
|
339
|
+
|
|
340
|
+
**Example showing the difference:**
|
|
341
|
+
|
|
342
|
+
```yaml
|
|
343
|
+
checks:
|
|
344
|
+
extract-items:
|
|
345
|
+
type: command
|
|
346
|
+
forEach: true
|
|
347
|
+
exec: echo '[1, 2, 3]'
|
|
348
|
+
on_finish:
|
|
349
|
+
run: [summarize-all]
|
|
350
|
+
|
|
351
|
+
process-item:
|
|
352
|
+
depends_on: [extract-items]
|
|
353
|
+
# Runs 3 times, once per item
|
|
354
|
+
# Has access to: outputs['extract-items'] (current item)
|
|
355
|
+
|
|
356
|
+
summarize-all:
|
|
357
|
+
type: script
|
|
358
|
+
# Runs ONCE after all 3 process-item iterations
|
|
359
|
+
# Has access to: outputs.history['process-item'] (all 3 results)
|
|
360
|
+
content: |
|
|
361
|
+
const allResults = outputs.history['process-item'];
|
|
362
|
+
return { processed: allResults.length };
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### See Also
|
|
366
|
+
|
|
367
|
+
- [Failure Routing](./failure-routing.md) - Complete `on_finish` reference
|
|
368
|
+
- [forEach Dependency Propagation](./foreach-dependency-propagation.md) - Detailed forEach mechanics
|
|
369
|
+
- [Output History](./output-history.md) - Accessing historical outputs
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## 🧭 Developer Experience Playbook
|
|
2
|
+
|
|
3
|
+
- Start with defaults: copy `defaults/.visor.yaml` or an example; run `npx -y @probelabs/visor@latest --check all --debug`.
|
|
4
|
+
- Treat config as code: review `.visor.yaml` and templates; pin providers/models for reproducibility.
|
|
5
|
+
- Roll out gradually: gate heavier checks with tags (`local`, `fast`, `critical`).
|
|
6
|
+
- Secure credentials: prefer GitHub App in production; scope/rotate API keys.
|
|
7
|
+
- Make feedback actionable: group related checks; use `/review --check ...` triggers; enable `reuse_ai_session` for follow-ups.
|
|
8
|
+
- Keep suppressions intentional: annotate context; audit `visor-disable-file` periodically.
|
|
9
|
+
- Validate locally: `npx -y @probelabs/visor@latest --check security --output markdown`; run tests; `--fail-fast` for fast lanes.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# RFC: Proper Pause/Resume for State-Machine Engine (Event‑Bus + Snapshots)
|
|
2
|
+
|
|
3
|
+
Status: draft
|
|
4
|
+
|
|
5
|
+
Owner: visor engine
|
|
6
|
+
|
|
7
|
+
Last updated: 2025-11-20
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
|
|
11
|
+
We will add first‑class pause/resume to the state‑machine engine so long‑running or interactive workflows (e.g., human‑input in Slack) can suspend execution and later continue exactly where they left off, without re‑running completed work. The design builds on our event‑bus architecture and the existing ExecutionJournal. It introduces JSON snapshots of the engine’s RunState and journal, and a resume entrypoint that hydrates a new runner from a snapshot. Slack and other frontends trigger resume when the awaited user event arrives.
|
|
12
|
+
|
|
13
|
+
## Goals
|
|
14
|
+
|
|
15
|
+
- Pause a workflow at deterministic points (e.g., when HumanInputRequested is emitted) and resume later.
|
|
16
|
+
- Persist minimal, safe state; do not leak secrets.
|
|
17
|
+
- Avoid re‑executing completed checks; preserve outputs/history/routing.
|
|
18
|
+
- Keep the event‑driven integration pattern (no long‑lived in‑memory runs).
|
|
19
|
+
- Be robust to process restarts (snapshots on disk); work in CI and serverless.
|
|
20
|
+
|
|
21
|
+
## Non‑Goals (initial)
|
|
22
|
+
|
|
23
|
+
- Arbitrary mid‑provider checkpointing (we pause at well‑defined integration points).
|
|
24
|
+
- Time‑travel debugging; only last consistent snapshot is kept by default.
|
|
25
|
+
|
|
26
|
+
## Current State (as of this RFC)
|
|
27
|
+
|
|
28
|
+
- We already end the run on human‑input and rely on PromptState + a new event to re‑enter the workflow. This re‑entry currently performs a cold start and plans from scratch, which is acceptable but can be inefficient and can re‑visit guards.
|
|
29
|
+
- Engine has ExecutionJournal and experimental `saveSnapshotToFile()` that serializes RunState and journal; there is no hydrate/resume path.
|
|
30
|
+
|
|
31
|
+
## High‑Level Design
|
|
32
|
+
|
|
33
|
+
1) Snapshots (JSON)
|
|
34
|
+
- When the engine encounters a pause point (e.g., HumanInputRequested), it writes a snapshot JSON file containing:
|
|
35
|
+
- `version`: number
|
|
36
|
+
- `sessionId`, `event` (trigger), `wave`
|
|
37
|
+
- `state`: serialized RunState (via a new `serializeRunState()` + `deserializeRunState()` pair)
|
|
38
|
+
- `journal`: visible `JournalEntry[]` up to the snapshot
|
|
39
|
+
- `requestedChecks`: string[]
|
|
40
|
+
- `meta`: optional { checkId, channel, threadTs, threadKey, promptTs }
|
|
41
|
+
|
|
42
|
+
2) Pause Points
|
|
43
|
+
- Initial scope: provider‑level pause during HumanInputRequested (event‑bus). Other future pause points can hook the same API.
|
|
44
|
+
|
|
45
|
+
3) Resume Entry Point
|
|
46
|
+
- New `engine.resumeFromSnapshot(snapshot, overrides)` that:
|
|
47
|
+
- Rebuilds `EngineContext` (config, requestedChecks, sessionId, event, journal)
|
|
48
|
+
- Creates a new `StateMachineRunner`, calls `runner.setState(deserializedRunState)` (new API), and continues the main loop.
|
|
49
|
+
- Applies overrides such as `webhookContext` to allow providers to consume the awaited input.
|
|
50
|
+
|
|
51
|
+
4) Frontends & PromptState
|
|
52
|
+
- Frontends (Slack) maintain the human prompt UI and store a pointer to the snapshot path in PromptState. On the awaited reply, frontends look up the snapshot and call `resumeFromSnapshot()` (via the socket/webhook path).
|
|
53
|
+
|
|
54
|
+
5) Storage & Retention
|
|
55
|
+
- Default snapshot directory: `${VISOR_SNAPSHOT_DIR || '.visor/snapshots'}`.
|
|
56
|
+
- File naming: `${threadKey}-${checkId}.json` where `threadKey = "${channel}:${threadTs}"`.
|
|
57
|
+
- Retention: delete on successful resume; background TTL cleanup (e.g., 24h) to reap orphans.
|
|
58
|
+
|
|
59
|
+
## Detailed Design
|
|
60
|
+
|
|
61
|
+
### A. RunState serialization/hydration
|
|
62
|
+
|
|
63
|
+
- Today we have `serializeRunState(state)` for JSON. We will:
|
|
64
|
+
- Add `deserializeRunState(obj): RunState` (recreates Sets/Maps and ensures invariants).
|
|
65
|
+
- Add `StateMachineRunner.setState(state: RunState)`; only valid before `run()`; asserts state consistency.
|
|
66
|
+
- Ensure we never serialize provider internals or secrets; RunState contains only orchestration fields.
|
|
67
|
+
|
|
68
|
+
### B. Engine APIs
|
|
69
|
+
|
|
70
|
+
- `StateMachineExecutionEngine.saveSnapshotToFile(filePath)` already exists.
|
|
71
|
+
- Add `resumeFromSnapshot(snapshot: SnapshotJson, opts?: { webhookContext?: ..., debug?: boolean }): Promise<ExecutionResult>`
|
|
72
|
+
- Recreate `EngineContext` using config and `snapshot.sessionId`.
|
|
73
|
+
- Rehydrate journal into a fresh `ExecutionJournal` (push `snapshot.journal`).
|
|
74
|
+
- Hydrate runner with `deserializeRunState(snapshot.state)` then continue.
|
|
75
|
+
- Wire `eventBus` and frontends like a normal run so integrations keep working.
|
|
76
|
+
|
|
77
|
+
### C. Snapshot triggers & lifecycle
|
|
78
|
+
|
|
79
|
+
- Human‑input path:
|
|
80
|
+
- Provider emits `HumanInputRequested(checkId, prompt, channel, threadTs, threadKey)` and returns.
|
|
81
|
+
- Engine listens for `HumanInputRequested` during the run and immediately calls `saveSnapshotToFile()` to `${SNAP_DIR}/${threadKey}-${checkId}.json`.
|
|
82
|
+
- Slack Frontend posts the prompt, also sets PromptState for `${threadKey}` with `snapshotPath`.
|
|
83
|
+
- The run completes (no blocking).
|
|
84
|
+
- On Slack reply in the same thread, the socket path looks up `${snapshotPath}` and calls `resumeFromSnapshot()` with the current `webhookContext`.
|
|
85
|
+
- After a successful resume (terminal StateTransition), engine deletes the snapshot file and clears PromptState.
|
|
86
|
+
|
|
87
|
+
### D. Idempotency & Safety
|
|
88
|
+
|
|
89
|
+
- Completed checks are recorded in RunState + journal; resuming does not re‑run them.
|
|
90
|
+
- We treat new inbound input as a new event; routing/guards continue from the hydrated state.
|
|
91
|
+
- If snapshot is missing or corrupted, we gracefully fall back to a cold run (today’s behavior).
|
|
92
|
+
|
|
93
|
+
### E. Security/Privacy
|
|
94
|
+
|
|
95
|
+
- Snapshots omit secrets and environment variables. Only engine orchestration and committed results are stored.
|
|
96
|
+
- Snapshot directory is local by default; users can relocate via `VISOR_SNAPSHOT_DIR`.
|
|
97
|
+
|
|
98
|
+
## File Layout
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
.visor/
|
|
102
|
+
snapshots/
|
|
103
|
+
C123:1700.55-ask.json # example: threadKey+checkId
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Snapshot JSON (v1) — Example
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"version": 1,
|
|
111
|
+
"sessionId": "a1b2c3",
|
|
112
|
+
"event": "issue_comment",
|
|
113
|
+
"wave": 2,
|
|
114
|
+
"state": { "currentState": "Routing", "wave": 2, "activeDispatches": [], "completedChecks": ["lint"], "stats": [], "historyLog": [], "forwardRunGuards": [], "currentLevelChecks": [], "pendingRunScopes": [] },
|
|
115
|
+
"journal": [
|
|
116
|
+
{ "commitId": 1, "sessionId": "a1b2c3", "scope": [], "checkId": "lint", "event": "issue_comment", "result": { "issues": [] } }
|
|
117
|
+
],
|
|
118
|
+
"requestedChecks": ["ask", "refine", "run-commands"],
|
|
119
|
+
"meta": { "checkId": "ask", "channel": "C123", "threadTs": "1700.55", "threadKey": "C123:1700.55", "promptTs": "1700.66" }
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Slack Integration Flow (pause/resume)
|
|
124
|
+
|
|
125
|
+
1) Run emits `HumanInputRequested` → engine writes snapshot to `${threadKey}-${checkId}.json`.
|
|
126
|
+
2) Slack Frontend posts prompt and sets PromptState with `snapshotPath`.
|
|
127
|
+
3) User replies in same thread; socket receives the envelope, finds PromptState/snapshot.
|
|
128
|
+
4) Engine `resumeFromSnapshot(snapshot, { webhookContext })` continues the workflow.
|
|
129
|
+
5) On terminal state, snapshot is deleted and PromptState cleared.
|
|
130
|
+
|
|
131
|
+
## CLI/Config
|
|
132
|
+
|
|
133
|
+
- Env:
|
|
134
|
+
- `VISOR_SNAPSHOT_DIR` — optional base directory for snapshots.
|
|
135
|
+
- Config (optional):
|
|
136
|
+
- `limits.max_workflow_depth` continues to apply; pause/resume doesn’t alter nesting rules.
|
|
137
|
+
- Future: `snapshots.enabled` (default true in Slack/webhook contexts), `snapshots.retentionHours`.
|
|
138
|
+
|
|
139
|
+
## Failure Modes & Recovery
|
|
140
|
+
|
|
141
|
+
- Missing snapshot: fall back to cold run.
|
|
142
|
+
- Corrupt snapshot: log, fall back to cold run.
|
|
143
|
+
- Multiple prompts in the same thread: last snapshot wins; older ones are overwritten.
|
|
144
|
+
- Process restart: snapshots survive; PromptState TTL means we rely on snapshot presence to resume.
|
|
145
|
+
|
|
146
|
+
## Testing Plan
|
|
147
|
+
|
|
148
|
+
1) Unit
|
|
149
|
+
- `deserializeRunState(serializeRunState(state))` round‑trip equals for non‑object identity fields.
|
|
150
|
+
- `resumeFromSnapshot` continues and does not re‑execute completed checks (assert via journal size).
|
|
151
|
+
|
|
152
|
+
2) Integration (Slack)
|
|
153
|
+
- First run → emits HumanInputRequested, snapshot written, prompt posted, run completes.
|
|
154
|
+
- Second run (reply) → loads snapshot, resumes, consumes reply, deletes snapshot.
|
|
155
|
+
|
|
156
|
+
3) Crash/Restart Simulation
|
|
157
|
+
- Save snapshot, reset in‑memory state, then `resumeFromSnapshot` from file.
|
|
158
|
+
|
|
159
|
+
## Rollout
|
|
160
|
+
|
|
161
|
+
- Phase 1 (behind feature switch in code): add hydrate APIs and write snapshots on HumanInputRequested; continue to cold‑run on reply but verify snapshot creation.
|
|
162
|
+
- Phase 2: wire socket path to call `resumeFromSnapshot`; delete snapshot on success.
|
|
163
|
+
- Phase 3: expand pause points if needed; add retention cleanup task.
|
|
164
|
+
|
|
165
|
+
## Work Items
|
|
166
|
+
|
|
167
|
+
- Runner
|
|
168
|
+
- [ ] Add `deserializeRunState()`
|
|
169
|
+
- [ ] Add `runner.setState()`
|
|
170
|
+
- Engine
|
|
171
|
+
- [ ] Add `resumeFromSnapshot()`
|
|
172
|
+
- [ ] On HumanInputRequested → `saveSnapshotToFile()` (path via threadKey+checkId)
|
|
173
|
+
- Slack
|
|
174
|
+
- [ ] PromptState stores `snapshotPath` alongside prompt metadata
|
|
175
|
+
- [ ] Socket runner loads snapshot and calls `resumeFromSnapshot()` on reply
|
|
176
|
+
- Tests
|
|
177
|
+
- [ ] Unit: serialize/deserialize round‑trip
|
|
178
|
+
- [ ] Integration: pause/resume end‑to‑end (Slack fixture), snapshot deletion
|
|
179
|
+
- Docs
|
|
180
|
+
- [ ] Update Slack integration docs and human‑input provider docs
|
|
181
|
+
|
|
182
|
+
## Alternatives Considered
|
|
183
|
+
|
|
184
|
+
- Keeping the runner alive across Slack replies → fragile in CI/serverless and ties up resources.
|
|
185
|
+
- Persisting only high‑level outputs and re‑planning on resume → simpler but can re‑emit side‑effects and re‑evaluate guards unexpectedly.
|
|
186
|
+
|
|
187
|
+
## Open Questions
|
|
188
|
+
|
|
189
|
+
- Should we also emit a `RunPaused` event for analytics/observability?
|
|
190
|
+
- Do we want a structured `output.awaiting = true` signal at pause for downstream guards?
|
|
191
|
+
- Snapshot encryption at rest (out of scope for now; directory is local/trusted).
|
|
192
|
+
|