@probelabs/visor 0.1.124 → 0.1.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts.map +1 -1
- package/dist/docs/DEPLOYMENT.md +117 -11
- package/dist/docs/GITHUB_CHECKS.md +18 -4
- package/dist/docs/NPM_USAGE.md +112 -39
- package/dist/docs/action-reference.md +63 -9
- package/dist/docs/advanced-ai.md +58 -51
- package/dist/docs/ai-configuration.md +99 -11
- package/dist/docs/ai-custom-tools-usage.md +70 -33
- package/dist/docs/ai-custom-tools.md +50 -27
- package/dist/docs/architecture.md +1232 -0
- package/dist/docs/bot-transports-rfc.md +13 -3
- package/dist/docs/ci-cli-mode.md +116 -8
- package/dist/docs/claude-code.md +111 -41
- package/dist/docs/command-provider.md +37 -15
- package/dist/docs/commands.md +252 -6
- package/dist/docs/configuration.md +138 -4
- package/dist/docs/contributing.md +737 -0
- package/dist/docs/custom-tools.md +39 -8
- package/dist/docs/dashboards/README.md +33 -19
- package/dist/docs/debug-visualizer-progress.md +14 -13
- package/dist/docs/debug-visualizer-rfc.md +14 -13
- package/dist/docs/debug-visualizer.md +30 -5
- package/dist/docs/debugging.md +73 -8
- package/dist/docs/default-output-schema.md +24 -20
- package/dist/docs/dependencies.md +75 -21
- package/dist/docs/dev-playbook.md +85 -9
- package/dist/docs/engine-pause-resume-rfc.md +11 -11
- package/dist/docs/engine-state-machine-plan.md +10 -3
- package/dist/docs/event-driven-github-integration-rfc.md +20 -11
- package/dist/docs/event-triggers.md +95 -6
- package/dist/docs/execution-statistics-rfc.md +16 -4
- package/dist/docs/fact-validator-gap-analysis.md +12 -1
- package/dist/docs/fact-validator-implementation-plan.md +19 -11
- package/dist/docs/fail-if.md +116 -11
- package/dist/docs/failure-conditions-implementation.md +40 -6
- package/dist/docs/failure-conditions-schema.md +243 -87
- package/dist/docs/failure-routing-rfc.md +43 -18
- package/dist/docs/failure-routing.md +80 -23
- package/dist/docs/faq.md +836 -0
- package/dist/docs/foreach-dependency-propagation.md +32 -15
- package/dist/docs/github-ops.md +6 -5
- package/dist/docs/glossary.md +322 -0
- package/dist/docs/goto-forward-run-plan.md +23 -10
- package/dist/docs/guides/criticality-modes.md +15 -13
- package/dist/docs/guides/fault-management-and-contracts.md +8 -5
- package/dist/docs/guides/workflow-style-guide.md +17 -8
- package/dist/docs/http.md +102 -3
- package/dist/docs/human-input-provider.md +20 -36
- package/dist/docs/index.md +206 -0
- package/dist/docs/lifecycle-hooks.md +322 -2
- package/dist/docs/limits.md +20 -5
- package/dist/docs/liquid-templates.md +86 -14
- package/dist/docs/loop-routing-refactor.md +4 -2
- package/dist/docs/mcp-provider.md +53 -19
- package/dist/docs/mcp.md +27 -1
- package/dist/docs/memory.md +7 -2
- package/dist/docs/migration.md +596 -0
- package/dist/docs/observability.md +227 -6
- package/dist/docs/output-formats.md +388 -9
- package/dist/docs/output-history.md +36 -6
- package/dist/docs/performance.md +510 -4
- package/dist/docs/pluggable.md +95 -4
- package/dist/docs/proposals/snapshot-scope-execution.md +6 -5
- package/dist/docs/providers/git-checkout.md +16 -14
- package/dist/docs/providers/noop.md +696 -0
- package/dist/docs/recipes.md +8 -9
- package/dist/docs/rfc/git-checkout-step.md +3 -1
- package/dist/docs/rfc/on_init-hook.md +18 -5
- package/dist/docs/rfc/workspace-isolation.md +16 -0
- package/dist/docs/roadmap/criticality-implementation-tasks.md +27 -27
- package/dist/docs/router-patterns.md +155 -43
- package/dist/docs/schema-templates.md +51 -15
- package/dist/docs/script.md +162 -13
- package/dist/docs/sdk.md +46 -12
- package/dist/docs/security.md +464 -5
- package/dist/docs/slack-integration.md +481 -0
- package/dist/docs/tag-filtering.md +60 -20
- package/dist/docs/telemetry-setup.md +157 -46
- package/dist/docs/test-framework-rfc.md +37 -36
- package/dist/docs/testing/assertions.md +92 -4
- package/dist/docs/testing/ci.md +56 -7
- package/dist/docs/testing/cli.md +57 -15
- package/dist/docs/testing/cookbook.md +53 -20
- package/dist/docs/testing/dsl-reference.md +110 -9
- package/dist/docs/testing/fixtures-and-mocks.md +28 -3
- package/dist/docs/testing/flows.md +59 -4
- package/dist/docs/testing/getting-started.md +14 -13
- package/dist/docs/testing/troubleshooting.md +39 -2
- package/dist/docs/timeouts.md +174 -18
- package/dist/docs/troubleshooting.md +176 -6
- package/dist/docs/workflow-creation-guide.md +101 -3
- package/dist/docs/workflows.md +138 -41
- package/dist/examples/README.md +169 -4
- package/dist/examples/ai-custom-tools-simple.yaml +2 -3
- package/dist/examples/cron-webhook-config.yaml +15 -0
- package/dist/examples/forEach-example.yaml +6 -0
- package/dist/examples/git-checkout-basic.yaml +4 -0
- package/dist/examples/git-checkout-compare.yaml +6 -0
- package/dist/examples/git-checkout-cross-repo.yaml +7 -0
- package/dist/examples/http-integration-config.yaml +30 -0
- package/dist/examples/https-server-config.yaml +15 -0
- package/dist/examples/mcp-provider-example.yaml +10 -10
- package/dist/examples/transform-example.yaml +3 -0
- package/dist/examples/webhook-pipeline-config.yaml +18 -0
- package/dist/examples/workflows/workflow-composition-example.yaml +4 -0
- package/dist/frontends/slack-frontend.d.ts +2 -0
- package/dist/frontends/slack-frontend.d.ts.map +1 -1
- package/dist/generated/config-schema.d.ts +11 -7
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +11 -7
- package/dist/index.js +3127 -974
- package/dist/output/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
- package/dist/output/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
- package/dist/providers/ai-check-provider.d.ts +9 -2
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts +17 -1
- package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
- package/dist/providers/workflow-check-provider.d.ts.map +1 -1
- package/dist/providers/workflow-tool-executor.d.ts +68 -0
- package/dist/providers/workflow-tool-executor.d.ts.map +1 -0
- package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs → check-provider-registry-3KI5RKXT.mjs} +6 -5
- package/dist/sdk/check-provider-registry-IYILYY35.mjs +28 -0
- package/dist/sdk/chunk-2CPMMNIX.mjs +1459 -0
- package/dist/sdk/chunk-2CPMMNIX.mjs.map +1 -0
- package/dist/sdk/chunk-5LI6T4O3.mjs +3600 -0
- package/dist/sdk/chunk-5LI6T4O3.mjs.map +1 -0
- package/dist/sdk/{chunk-YLQ4UN62.mjs → chunk-A4PGHURG.mjs} +6838 -6257
- package/dist/sdk/chunk-A4PGHURG.mjs.map +1 -0
- package/dist/sdk/chunk-EXFGO4FX.mjs +147 -0
- package/dist/sdk/chunk-EXFGO4FX.mjs.map +1 -0
- package/dist/sdk/chunk-PJ7K5UFC.mjs +17732 -0
- package/dist/sdk/chunk-PJ7K5UFC.mjs.map +1 -0
- package/dist/sdk/{chunk-BHZ4CKUS.mjs → chunk-PXFIALUH.mjs} +77 -8
- package/dist/sdk/chunk-PXFIALUH.mjs.map +1 -0
- package/dist/sdk/{chunk-PVITVJ6J.mjs → chunk-RTKJXNZS.mjs} +32 -9
- package/dist/sdk/chunk-RTKJXNZS.mjs.map +1 -0
- package/dist/sdk/chunk-VW2GBXQT.mjs +606 -0
- package/dist/sdk/chunk-VW2GBXQT.mjs.map +1 -0
- package/dist/sdk/{config-RQQPMLRD.mjs → config-5AUYQFHE.mjs} +2 -2
- package/dist/sdk/config-6CUVEH7H.mjs +16 -0
- package/dist/sdk/config-6CUVEH7H.mjs.map +1 -0
- package/dist/sdk/{github-frontend-6Q4BISZX.mjs → github-frontend-BZ4N3BFZ.mjs} +7 -3
- package/dist/sdk/github-frontend-BZ4N3BFZ.mjs.map +1 -0
- package/dist/sdk/host-4MT3EW2I.mjs +52 -0
- package/dist/sdk/{host-P5NQICP7.mjs → host-NYWXLIFC.mjs} +2 -2
- package/dist/sdk/host-NYWXLIFC.mjs.map +1 -0
- package/dist/sdk/{routing-DEY2AIXM.mjs → routing-6R42GXUO.mjs} +2 -2
- package/dist/sdk/routing-6R42GXUO.mjs.map +1 -0
- package/dist/sdk/routing-7FXPULTO.mjs +24 -0
- package/dist/sdk/routing-7FXPULTO.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +3 -1
- package/dist/sdk/sdk.d.ts +3 -1
- package/dist/sdk/sdk.js +12163 -11204
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +14 -10
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/slack-frontend-JUT3TYVC.mjs +821 -0
- package/dist/sdk/slack-frontend-JUT3TYVC.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs +28 -0
- package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs +28 -0
- package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs.map +1 -0
- package/dist/sdk/workflow-registry-KFWSDSLM.mjs +12 -0
- package/dist/sdk/workflow-registry-KFWSDSLM.mjs.map +1 -0
- package/dist/slack/socket-runner.d.ts +2 -0
- package/dist/slack/socket-runner.d.ts.map +1 -1
- package/dist/state-machine/context/workflow-inputs.d.ts +20 -0
- package/dist/state-machine/context/workflow-inputs.d.ts.map +1 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
- package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -1
- package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -1
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
- package/dist/state-machine/states/routing.d.ts +2 -1
- package/dist/state-machine/states/routing.d.ts.map +1 -1
- package/dist/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
- package/dist/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
- package/dist/types/config.d.ts +3 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/human-id.d.ts +12 -0
- package/dist/utils/human-id.d.ts.map +1 -0
- package/dist/utils/worktree-manager.d.ts +3 -0
- package/dist/utils/worktree-manager.d.ts.map +1 -1
- package/dist/workflow-executor.d.ts.map +1 -1
- package/dist/workflow-registry.d.ts +1 -0
- package/dist/workflow-registry.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/sdk/chunk-BHZ4CKUS.mjs.map +0 -1
- package/dist/sdk/chunk-PVITVJ6J.mjs.map +0 -1
- package/dist/sdk/chunk-YLQ4UN62.mjs.map +0 -1
- package/dist/sdk/github-frontend-6Q4BISZX.mjs.map +0 -1
- /package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs.map → check-provider-registry-3KI5RKXT.mjs.map} +0 -0
- /package/dist/sdk/{config-RQQPMLRD.mjs.map → check-provider-registry-IYILYY35.mjs.map} +0 -0
- /package/dist/sdk/{routing-DEY2AIXM.mjs.map → config-5AUYQFHE.mjs.map} +0 -0
- /package/dist/sdk/{host-P5NQICP7.mjs.map → host-4MT3EW2I.mjs.map} +0 -0
|
@@ -1,9 +1,85 @@
|
|
|
1
|
-
##
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
## Developer Experience Playbook
|
|
2
|
+
|
|
3
|
+
This guide covers both contributing to Visor and using it effectively.
|
|
4
|
+
|
|
5
|
+
### Quick Start for Contributors
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install dependencies
|
|
9
|
+
npm install
|
|
10
|
+
|
|
11
|
+
# Build the project
|
|
12
|
+
npm run build
|
|
13
|
+
|
|
14
|
+
# Run tests
|
|
15
|
+
npm test
|
|
16
|
+
|
|
17
|
+
# Run the CLI locally
|
|
18
|
+
./dist/index.js --help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Development Commands
|
|
22
|
+
|
|
23
|
+
#### Build
|
|
24
|
+
| Command | Description |
|
|
25
|
+
|---------|-------------|
|
|
26
|
+
| `npm run build` | Build CLI and SDK |
|
|
27
|
+
| `npm run build:cli` | Build CLI only |
|
|
28
|
+
| `npm run build:sdk` | Build SDK only |
|
|
29
|
+
| `npm run clean` | Clean dist directory |
|
|
30
|
+
|
|
31
|
+
#### Testing
|
|
32
|
+
| Command | Description |
|
|
33
|
+
|---------|-------------|
|
|
34
|
+
| `npm test` | Run all tests (Jest + YAML tests) |
|
|
35
|
+
| `npm run test:watch` | Run tests in watch mode |
|
|
36
|
+
| `npm run test:coverage` | Generate coverage report |
|
|
37
|
+
| `npm run test:yaml` | Run YAML-based tests only |
|
|
38
|
+
| `npm run test:yaml:parallel` | Run YAML tests with parallelism |
|
|
39
|
+
|
|
40
|
+
#### Code Quality
|
|
41
|
+
| Command | Description |
|
|
42
|
+
|---------|-------------|
|
|
43
|
+
| `npm run lint` | Lint TypeScript files |
|
|
44
|
+
| `npm run lint:fix` | Auto-fix linting issues |
|
|
45
|
+
| `npm run format` | Format code with Prettier |
|
|
46
|
+
| `npm run format:check` | Check code formatting |
|
|
47
|
+
|
|
48
|
+
#### Release
|
|
49
|
+
| Command | Description |
|
|
50
|
+
|---------|-------------|
|
|
51
|
+
| `npm run release` | Interactive release |
|
|
52
|
+
| `npm run release:patch` | Release patch version |
|
|
53
|
+
| `npm run release:minor` | Release minor version |
|
|
54
|
+
| `npm run release:major` | Release major version |
|
|
55
|
+
|
|
56
|
+
#### Deployment
|
|
57
|
+
| Command | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| `npm run deploy` | Deploy site and worker |
|
|
60
|
+
| `npm run deploy:site` | Deploy site to Cloudflare Pages |
|
|
61
|
+
| `npm run deploy:worker` | Deploy worker to Cloudflare |
|
|
62
|
+
|
|
63
|
+
#### Simulation & Debugging
|
|
64
|
+
| Command | Description |
|
|
65
|
+
|---------|-------------|
|
|
66
|
+
| `npm run simulate:issue` | Simulate GitHub issue event |
|
|
67
|
+
| `npm run simulate:comment` | Simulate GitHub comment event |
|
|
68
|
+
|
|
69
|
+
### Using Visor Effectively
|
|
70
|
+
|
|
71
|
+
- **Start with defaults**: Copy `defaults/visor.yaml` or an example from `examples/`; run `npx -y @probelabs/visor@latest --check all --debug`.
|
|
72
|
+
- **Treat config as code**: Review `.visor.yaml` and templates; pin providers/models for reproducibility.
|
|
73
|
+
- **Roll out gradually**: Gate heavier checks with tags (`local`, `fast`, `critical`). See [Tag Filtering](tag-filtering.md).
|
|
74
|
+
- **Secure credentials**: Prefer GitHub App in production; scope/rotate API keys. See [Security](security.md).
|
|
75
|
+
- **Make feedback actionable**: Group related checks; use `/review --check ...` triggers; enable `reuse_ai_session` for follow-ups.
|
|
76
|
+
- **Keep suppressions intentional**: Annotate context; audit `visor-disable-file` periodically. See [Suppressions](suppressions.md).
|
|
77
|
+
- **Validate locally**: `npx -y @probelabs/visor@latest --check security --output markdown`; run tests; `--fail-fast` for fast lanes.
|
|
78
|
+
|
|
79
|
+
### Related Documentation
|
|
80
|
+
|
|
81
|
+
- [Configuration](configuration.md) - Full configuration reference
|
|
82
|
+
- [Debugging](debugging.md) - Debugging techniques and troubleshooting
|
|
83
|
+
- [Troubleshooting](troubleshooting.md) - Common issues and solutions
|
|
84
|
+
- [CI/CLI Mode](ci-cli-mode.md) - Running Visor in CI environments
|
|
85
|
+
- [Output Formats](output-formats.md) - Available output formats
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# RFC: Proper Pause/Resume for State-Machine Engine (Event‑Bus + Snapshots)
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: implemented
|
|
4
4
|
|
|
5
5
|
Owner: visor engine
|
|
6
6
|
|
|
7
|
-
Last updated:
|
|
7
|
+
Last updated: 2026-01-28
|
|
8
8
|
|
|
9
9
|
## Summary
|
|
10
10
|
|
|
@@ -165,19 +165,19 @@ We will add first‑class pause/resume to the state‑machine engine so long‑r
|
|
|
165
165
|
## Work Items
|
|
166
166
|
|
|
167
167
|
- Runner
|
|
168
|
-
- [
|
|
169
|
-
- [
|
|
168
|
+
- [x] Add `runner.setState()` - Implemented in `src/state-machine/runner.ts`
|
|
169
|
+
- [~] Add `deserializeRunState()` - Not needed; resume uses fresh run with journal hydration
|
|
170
170
|
- Engine
|
|
171
|
-
- [
|
|
172
|
-
- [
|
|
171
|
+
- [x] Add `resumeFromSnapshot()` - Implemented in `src/state-machine-execution-engine.ts`
|
|
172
|
+
- [x] On HumanInputRequested → `saveSnapshotToFile()` (path via threadKey+checkId)
|
|
173
173
|
- Slack
|
|
174
|
-
- [
|
|
175
|
-
- [
|
|
174
|
+
- [x] PromptState stores `snapshotPath` alongside prompt metadata - Implemented in `src/slack/prompt-state.ts`
|
|
175
|
+
- [x] Socket runner loads snapshot and calls `resumeFromSnapshot()` on reply - Implemented in `src/slack/socket-runner.ts`
|
|
176
176
|
- Tests
|
|
177
|
-
- [
|
|
178
|
-
- [
|
|
177
|
+
- [x] Unit: workspace initialization test in `tests/unit/resume-from-snapshot-workspace.test.ts`
|
|
178
|
+
- [x] Integration: pause/resume tests in `tests/integration/slack-pause-resume-e2e.test.ts` and `tests/integration/slack-resume-from-snapshot.test.ts`
|
|
179
179
|
- Docs
|
|
180
|
-
- [
|
|
180
|
+
- [x] Human-input provider docs mention workflow pausing in `docs/human-input-provider.md`
|
|
181
181
|
|
|
182
182
|
## Alternatives Considered
|
|
183
183
|
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Engine State Machine (v2) Research
|
|
2
2
|
|
|
3
|
+
> **Status: COMPLETED**
|
|
4
|
+
>
|
|
5
|
+
> This planning document describes the state machine engine implementation. All milestones (M0-M4) have been completed. The state machine is now the default engine, and `CheckExecutionEngine` in `src/check-execution-engine.ts` is a compatibility wrapper that re-exports `StateMachineExecutionEngine`.
|
|
6
|
+
>
|
|
7
|
+
> **Note:** Line references in section 1 ("Current Engine Map") are historical and refer to the legacy implementation that has since been refactored into `src/state-machine/`. See `src/state-machine/runner.ts` and `src/state-machine/states/` for the current implementation.
|
|
8
|
+
|
|
3
9
|
This note captures the current execution flow of the Visor engine, the surfaces where a feature flag can live, and an initial proposal for a bespoke state-machine-based Runner v2. The user-provided research artifact referenced in the request is not available inside this workspace yet, so there are a few open questions that we should fill in once we can read it.
|
|
4
10
|
|
|
5
11
|
> Safety Model & Criticality (Summary)
|
|
@@ -296,12 +302,13 @@ Execution steps:
|
|
|
296
302
|
3. Emit telemetry (`engine.contract.assume_failed`, `engine.contract.guarantee_failed`) so CI and runtime monitoring can flag contract regressions.
|
|
297
303
|
|
|
298
304
|
By lifting control flow into `transitions` and correctness rules into `assume`/`guarantee`, we make configurations statically analyzable, reduce reliance on imperative `goto_js`, and move closer to NASA-inspired static validation goals while still honoring legacy constructs for advanced scenarios.
|
|
299
|
-
|
|
305
|
+
|
|
306
|
+
## 6. Routing and Loops (spec to impl status)
|
|
300
307
|
|
|
301
308
|
- on_success/on_fail evaluate `run`, `run_js`, and `goto` (with optional `goto_event`).
|
|
302
309
|
- on_finish for forEach parents is processed after children complete; loop budget enforced.
|
|
303
310
|
|
|
304
|
-
###
|
|
311
|
+
### 6.1 Declarative transitions (implemented)
|
|
305
312
|
|
|
306
313
|
In addition to `goto`/`goto_js`, checks can use declarative transitions on `on_success`, `on_fail`, and `on_finish`:
|
|
307
314
|
|
|
@@ -318,7 +325,7 @@ on_finish:
|
|
|
318
325
|
- Backward compatible: if `transitions` is omitted or none match, the engine falls back to `goto_js/goto`.
|
|
319
326
|
- Helpers available: `outputs`, `outputs_history`, `output`, `event`, `memory`, plus `any/all/none/count`.
|
|
320
327
|
|
|
321
|
-
###
|
|
328
|
+
### 6.2 Assume/Guarantee contracts (implemented)
|
|
322
329
|
|
|
323
330
|
Per-check contracts:
|
|
324
331
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# RFC: Event-Driven Integrations via Frontends (GitHub, Slack, …)
|
|
2
2
|
|
|
3
|
-
**Status**:
|
|
3
|
+
**Status**: Implemented (Phases 1-2 Complete)
|
|
4
4
|
**Created**: 2025-11-19
|
|
5
|
+
**Updated**: 2026-01-28
|
|
5
6
|
**Author**: Architecture Planning
|
|
6
7
|
|
|
7
8
|
## Abstract
|
|
@@ -710,24 +711,32 @@ Kept intentionally small after adopting defaults above:
|
|
|
710
711
|
## Implementation Checklist
|
|
711
712
|
|
|
712
713
|
### Phase 1: Foundation
|
|
713
|
-
- [
|
|
714
|
-
- [
|
|
715
|
-
- [
|
|
714
|
+
- [x] Implement `EventBus` class with subscription management (`src/event-bus/event-bus.ts`)
|
|
715
|
+
- [x] Implement `EventEnvelope` and `IntegrationEvent` types (`src/event-bus/types.ts`)
|
|
716
|
+
- [x] Add `eventBus` optional parameter to `StateMachineRunner` (via `EngineContext`)
|
|
717
|
+
- [x] Implement `FrontendsHost` with `Frontend` API (`src/frontends/host.ts`)
|
|
718
|
+
- [x] Implement `NdjsonSink` frontend (`src/frontends/ndjson-sink.ts`)
|
|
716
719
|
- [ ] Add unit tests for `EventBus`
|
|
717
720
|
|
|
718
|
-
### Phase 2: GitHub
|
|
719
|
-
- [
|
|
720
|
-
- [
|
|
721
|
-
- [
|
|
721
|
+
### Phase 2: GitHub Frontend
|
|
722
|
+
- [x] Implement `GitHubFrontend` with request handlers (`src/frontends/github-frontend.ts`)
|
|
723
|
+
- [x] Wire up adapter in `state-machine-execution-engine.ts`
|
|
724
|
+
- [x] Implement comment grouping with section markers
|
|
725
|
+
- [x] Implement debounce/coalescing for comment updates
|
|
726
|
+
- [x] Implement mutex-based serialization for updates
|
|
727
|
+
- [ ] Add feature flag `experimental.eventDrivenGitHub` (skipped - frontends are enabled by default)
|
|
722
728
|
- [ ] Add integration tests for dual-mode operation
|
|
723
729
|
|
|
724
|
-
### Phase 3: Multi-Platform
|
|
725
|
-
- [
|
|
730
|
+
### Phase 3: Multi-Platform Frontends
|
|
731
|
+
- [x] Implement `SlackFrontend` with direct replies (`src/frontends/slack-frontend.ts`)
|
|
732
|
+
- [x] Slack reaction management (acknowledgement and completion)
|
|
733
|
+
- [x] Mermaid diagram rendering and upload
|
|
734
|
+
- [x] Human input prompt handling via prompt-state
|
|
726
735
|
- [ ] Implement `MetricsEventAdapter` (example)
|
|
727
736
|
- [ ] Document adapter API and patterns
|
|
728
737
|
|
|
729
738
|
### Phase 4: Migration (Breaking Change)
|
|
730
|
-
- [ ] Remove `gitHubChecks` from `EngineContext`
|
|
739
|
+
- [ ] Remove `gitHubChecks` from `EngineContext` (legacy DI still present for backward compatibility)
|
|
731
740
|
- [ ] Make `eventBus` required parameter
|
|
732
741
|
- [ ] Update all state handlers to emit events
|
|
733
742
|
- [ ] Update all tests to new pattern
|
|
@@ -22,10 +22,11 @@ Visor can be triggered in two main modes:
|
|
|
22
22
|
When running as a GitHub Action, Visor responds to these events:
|
|
23
23
|
|
|
24
24
|
### Pull Request Events (`pull_request`)
|
|
25
|
-
- **Actions**: `opened`, `synchronize`, `edited`
|
|
25
|
+
- **Actions**: `opened`, `synchronize`, `edited`, `closed`
|
|
26
26
|
- **Trigger mapping**:
|
|
27
27
|
- `opened` → `pr_opened`
|
|
28
28
|
- `synchronize` / `edited` → `pr_updated`
|
|
29
|
+
- `closed` → `pr_closed`
|
|
29
30
|
- **Log format**:
|
|
30
31
|
```
|
|
31
32
|
🤖 Mode: GitHub Action
|
|
@@ -35,6 +36,18 @@ When running as a GitHub Action, Visor responds to these events:
|
|
|
35
36
|
🔀 Context: Pull Request #123
|
|
36
37
|
```
|
|
37
38
|
|
|
39
|
+
### Pull Request Review Events (`pull_request_review`)
|
|
40
|
+
- **Actions**: `submitted`, `edited`, `dismissed`
|
|
41
|
+
- **Trigger mapping**: `pr_updated`
|
|
42
|
+
- **Log format**:
|
|
43
|
+
```
|
|
44
|
+
🤖 Mode: GitHub Action
|
|
45
|
+
📂 Repository: owner/repo
|
|
46
|
+
📋 Event: pull_request_review (action: submitted)
|
|
47
|
+
🎯 Trigger: pr_updated
|
|
48
|
+
🔀 Context: Pull Request #123
|
|
49
|
+
```
|
|
50
|
+
|
|
38
51
|
### Issue Events (`issues`)
|
|
39
52
|
- **Actions**: `opened`, `edited`, etc.
|
|
40
53
|
- **Trigger mapping**: `issue_opened`
|
|
@@ -51,6 +64,7 @@ When running as a GitHub Action, Visor responds to these events:
|
|
|
51
64
|
- **Actions**: `created`, `edited`
|
|
52
65
|
- **Trigger mapping**: `issue_comment`
|
|
53
66
|
- **Context**: Can be on either a Pull Request or an Issue
|
|
67
|
+
- **Note**: The EventMapper class may treat PR comments as `pr_updated` for advanced routing, but the GitHub Action entry point maps all issue comments to `issue_comment`.
|
|
54
68
|
- **Log format** (on PR):
|
|
55
69
|
```
|
|
56
70
|
🤖 Mode: GitHub Action
|
|
@@ -68,6 +82,28 @@ When running as a GitHub Action, Visor responds to these events:
|
|
|
68
82
|
💬 Context: Comment on Issue #456
|
|
69
83
|
```
|
|
70
84
|
|
|
85
|
+
### Schedule Events (`schedule`)
|
|
86
|
+
- **Trigger mapping**: `schedule`
|
|
87
|
+
- **Use case**: Cron-triggered workflows
|
|
88
|
+
- **Log format**:
|
|
89
|
+
```
|
|
90
|
+
🤖 Mode: GitHub Action
|
|
91
|
+
📂 Repository: owner/repo
|
|
92
|
+
📋 Event: schedule
|
|
93
|
+
🎯 Trigger: schedule
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Workflow Dispatch Events (`workflow_dispatch`)
|
|
97
|
+
- **Trigger mapping**: `schedule` (treated as scheduled execution)
|
|
98
|
+
- **Use case**: Manual workflow triggers
|
|
99
|
+
- **Log format**:
|
|
100
|
+
```
|
|
101
|
+
🤖 Mode: GitHub Action
|
|
102
|
+
📂 Repository: owner/repo
|
|
103
|
+
📋 Event: workflow_dispatch
|
|
104
|
+
🎯 Trigger: schedule
|
|
105
|
+
```
|
|
106
|
+
|
|
71
107
|
## Example Logs
|
|
72
108
|
|
|
73
109
|
### Before (old logging):
|
|
@@ -135,9 +171,24 @@ This is **normal and correct** - it means:
|
|
|
135
171
|
✓ Skipping bot's own comment to prevent recursion. Author: probelabs[bot], Type: Bot, Has markers: true
|
|
136
172
|
```
|
|
137
173
|
|
|
174
|
+
## Available Event Triggers
|
|
175
|
+
|
|
176
|
+
The complete list of event triggers that can be used in the `on` field:
|
|
177
|
+
|
|
178
|
+
| Trigger | Description |
|
|
179
|
+
|---------|-------------|
|
|
180
|
+
| `pr_opened` | Pull request was opened |
|
|
181
|
+
| `pr_updated` | Pull request was updated (synchronize, edited, or review submitted) |
|
|
182
|
+
| `pr_closed` | Pull request was closed (merged or dismissed) |
|
|
183
|
+
| `issue_opened` | Issue was opened |
|
|
184
|
+
| `issue_comment` | Comment on an issue (not a PR) |
|
|
185
|
+
| `manual` | Manual CLI invocation |
|
|
186
|
+
| `schedule` | Scheduled execution (cron or workflow_dispatch) |
|
|
187
|
+
| `webhook_received` | HTTP webhook was received (via http_input provider) |
|
|
188
|
+
|
|
138
189
|
## Configuration
|
|
139
190
|
|
|
140
|
-
|
|
191
|
+
Steps are configured to run on specific triggers using the `on` field:
|
|
141
192
|
|
|
142
193
|
```yaml
|
|
143
194
|
steps:
|
|
@@ -150,13 +201,24 @@ steps:
|
|
|
150
201
|
on: [issue_comment, issue_opened] # Runs on issue events
|
|
151
202
|
type: ai
|
|
152
203
|
# ... rest of config
|
|
204
|
+
|
|
205
|
+
scheduled-report:
|
|
206
|
+
on: [schedule] # Only runs on scheduled triggers
|
|
207
|
+
type: ai
|
|
208
|
+
schedule: "0 9 * * 1" # Every Monday at 9am
|
|
209
|
+
# ... rest of config
|
|
210
|
+
|
|
211
|
+
webhook-handler:
|
|
212
|
+
on: [webhook_received] # Only runs when webhook is received
|
|
213
|
+
type: http_input
|
|
214
|
+
# ... rest of config
|
|
153
215
|
```
|
|
154
216
|
|
|
155
|
-
If `on` is not specified, the check can run on any event type.
|
|
217
|
+
If `on` is not specified, the check can run on any event type (except `manual`-only checks when using `--event all`).
|
|
156
218
|
|
|
157
219
|
### Using goto_event to simulate a different trigger for a jump
|
|
158
220
|
|
|
159
|
-
Sometimes you want to
|
|
221
|
+
Sometimes you want to "re-run" an ancestor step as if a different event happened (e.g., from an `issue_comment` flow you want to re-execute a PR step under `pr_updated`). Use `goto_event` together with `goto` in `on_success` or `on_fail` blocks:
|
|
160
222
|
|
|
161
223
|
```yaml
|
|
162
224
|
steps:
|
|
@@ -173,7 +235,14 @@ steps:
|
|
|
173
235
|
goto_event: pr_updated # simulate PR update for the inline jump
|
|
174
236
|
```
|
|
175
237
|
|
|
176
|
-
During that inline execution, event filtering and `if:` expressions see the simulated event. The current step is then re-run once.
|
|
238
|
+
During that inline execution, event filtering and `if:` expressions see the simulated event. The current step is then re-run once.
|
|
239
|
+
|
|
240
|
+
The `goto_event` field accepts any valid `EventTrigger` value:
|
|
241
|
+
- `pr_opened`, `pr_updated`, `pr_closed`
|
|
242
|
+
- `issue_opened`, `issue_comment`
|
|
243
|
+
- `manual`, `schedule`, `webhook_received`
|
|
244
|
+
|
|
245
|
+
For complete documentation on failure routing, retry policies, and loop control, see [Failure Routing](./failure-routing.md).
|
|
177
246
|
|
|
178
247
|
## CLI Event Simulation
|
|
179
248
|
|
|
@@ -188,12 +257,21 @@ visor --event pr_updated
|
|
|
188
257
|
# Simulate a PR opened event
|
|
189
258
|
visor --event pr_opened
|
|
190
259
|
|
|
260
|
+
# Simulate a PR closed event
|
|
261
|
+
visor --event pr_closed
|
|
262
|
+
|
|
191
263
|
# Simulate an issue comment event
|
|
192
264
|
visor --event issue_comment
|
|
193
265
|
|
|
194
266
|
# Simulate an issue opened event
|
|
195
267
|
visor --event issue_opened
|
|
196
268
|
|
|
269
|
+
# Simulate a manual trigger (runs checks with on: [manual])
|
|
270
|
+
visor --event manual
|
|
271
|
+
|
|
272
|
+
# Simulate a scheduled trigger
|
|
273
|
+
visor --event schedule
|
|
274
|
+
|
|
197
275
|
# Run all checks regardless of event filters (default)
|
|
198
276
|
visor --event all
|
|
199
277
|
```
|
|
@@ -215,10 +293,13 @@ visor --check security --event pr_updated
|
|
|
215
293
|
|
|
216
294
|
| Flag | Behavior | Use Case |
|
|
217
295
|
|------|----------|----------|
|
|
218
|
-
| `--event pr_updated` | Only runs checks with `on: [pr_updated]` | Test PR update scenario locally |
|
|
219
296
|
| `--event pr_opened` | Only runs checks with `on: [pr_opened]` | Test PR opened scenario |
|
|
297
|
+
| `--event pr_updated` | Only runs checks with `on: [pr_updated]` | Test PR update scenario locally |
|
|
298
|
+
| `--event pr_closed` | Only runs checks with `on: [pr_closed]` | Test PR close/merge scenario |
|
|
299
|
+
| `--event issue_opened` | Only runs checks with `on: [issue_opened]` | Test issue opened scenario |
|
|
220
300
|
| `--event issue_comment` | Only runs checks with `on: [issue_comment]` | Test comment assistant |
|
|
221
301
|
| `--event manual` | Only runs checks with `on: [manual]` | Test manual-triggered checks |
|
|
302
|
+
| `--event schedule` | Only runs checks with `on: [schedule]` | Test scheduled/cron checks |
|
|
222
303
|
| `--event all` | Runs all checks (except manual-only) | Default behavior, ignores `on:` filters |
|
|
223
304
|
| (no flag) | Auto-detects based on schema | Smart default |
|
|
224
305
|
|
|
@@ -290,3 +371,11 @@ visor --event issue_comment
|
|
|
290
371
|
```bash
|
|
291
372
|
visor --event all # or just: visor
|
|
292
373
|
```
|
|
374
|
+
|
|
375
|
+
## Related Documentation
|
|
376
|
+
|
|
377
|
+
- [Configuration](./configuration.md) - Full configuration reference including check types
|
|
378
|
+
- [CI/CLI Mode](./ci-cli-mode.md) - Running Visor in CI environments
|
|
379
|
+
- [Failure Routing](./failure-routing.md) - Auto-fix loops and `goto_event` usage
|
|
380
|
+
- [Commands](./commands.md) - CLI commands and PR comment commands
|
|
381
|
+
- [Tag Filtering](./tag-filtering.md) - Selective check execution with tags
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
# RFC: Enhanced Execution Logging & Statistics
|
|
2
2
|
|
|
3
|
-
**Status:** Implemented
|
|
3
|
+
**Status:** Implemented (with architectural changes)
|
|
4
4
|
**Date:** 2025-10-04
|
|
5
5
|
**Version:** 1.0
|
|
6
6
|
|
|
7
|
+
> **Note (January 2026):** This RFC has been implemented, but the underlying architecture
|
|
8
|
+
> has evolved significantly since the original design. The `CheckExecutionEngine` class
|
|
9
|
+
> described below has been replaced by `StateMachineExecutionEngine` (see
|
|
10
|
+
> `src/state-machine-execution-engine.ts`). Statistics tracking is now handled via:
|
|
11
|
+
> - `src/types/execution.ts` - Type definitions for `CheckExecutionStats` and `ExecutionStatistics`
|
|
12
|
+
> - `src/state-machine/dispatch/stats-manager.ts` - Runtime statistics collection
|
|
13
|
+
> - `src/state-machine/execution/summary.ts` - Result aggregation
|
|
14
|
+
>
|
|
15
|
+
> The data structures remain largely compatible with the RFC specification, with some
|
|
16
|
+
> additions like `skippedRuns`, `providerDurationMs`, and additional skip reasons
|
|
17
|
+
> (`forEach_empty`, `assume`). The formatting methods (`formatStatusColumn`,
|
|
18
|
+
> `formatDetailsColumn`) remain in the engine class for test compatibility.
|
|
19
|
+
|
|
7
20
|
## Summary
|
|
8
21
|
|
|
9
22
|
This RFC describes the implementation of comprehensive execution statistics tracking and enhanced logging for Visor checks, providing users with clear visibility into forEach iterations, skip reasons, and overall execution metrics.
|
|
@@ -285,6 +298,5 @@ Potential future improvements:
|
|
|
285
298
|
|
|
286
299
|
## References
|
|
287
300
|
|
|
288
|
-
- Implementation
|
|
289
|
-
-
|
|
290
|
-
- Documentation: Updated in CLAUDE.md and README.md
|
|
301
|
+
- Implementation: See `src/state-machine-execution-engine.ts`, `src/types/execution.ts`, and `src/state-machine/dispatch/stats-manager.ts`
|
|
302
|
+
- Tests: `tests/unit/execution-statistics.test.ts`, `tests/unit/execution-statistics-formatting.test.ts`, `tests/integration/execution-statistics-integration.test.ts`
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
# on_finish Hook - Implementation Status
|
|
2
2
|
|
|
3
|
+
> **Note (2026-01-28)**: This is a **historical planning document** from October 2025.
|
|
4
|
+
> The `on_finish` feature has been implemented but the codebase has since been refactored.
|
|
5
|
+
> Some file paths and line numbers in this document are outdated.
|
|
6
|
+
>
|
|
7
|
+
> **Current implementation locations:**
|
|
8
|
+
> - Core logic: `src/engine/on-finish/orchestrator.ts`, `src/engine/on-finish/utils.ts`
|
|
9
|
+
> - State machine integration: `src/state-machine/states/level-dispatch.ts`, `src/state-machine/dispatch/foreach-processor.ts`
|
|
10
|
+
> - Tests: `tests/engine/foreach-on-finish.engine.test.ts`, `tests/e2e/on-finish-*.test.ts`
|
|
11
|
+
>
|
|
12
|
+
> For current usage documentation, see `docs/failure-routing.md` and `docs/foreach-dependency-propagation.md`.
|
|
13
|
+
|
|
3
14
|
**Last Updated:** 2025-10-16
|
|
4
|
-
**Status:** ✅ FEATURE COMPLETE (Infrastructure Ready)
|
|
15
|
+
**Status:** ✅ FEATURE COMPLETE (Infrastructure Ready) - See note above for current locations
|
|
5
16
|
|
|
6
17
|
## What Was Built
|
|
7
18
|
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
# Fact Validator Implementation Plan
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Note (2026-01-28)**: This is a historical planning document. The core `on_finish` hook
|
|
4
|
+
> infrastructure has been implemented and refactored since this plan was written.
|
|
5
|
+
> Implementation has moved from `src/check-execution-engine.ts` to a dedicated module at
|
|
6
|
+
> `src/engine/on-finish/orchestrator.ts` and `src/engine/on-finish/utils.ts`. Method names
|
|
7
|
+
> like `executeCheckInline()` and `handleOnFinishHooks()` mentioned below no longer exist.
|
|
8
|
+
> The test file references may also be outdated. See the actual source files for current
|
|
9
|
+
> implementation details.
|
|
4
10
|
|
|
5
|
-
|
|
11
|
+
## 🎯 CURRENT STATUS: 50% COMPLETE (Phases 1-4 done, Phases 5-6 pending)
|
|
12
|
+
|
|
13
|
+
**Last Updated:** 2025-10-16 (see note above for 2026 status)
|
|
6
14
|
|
|
7
15
|
### Implementation Status
|
|
8
16
|
|
|
9
17
|
| Component | Status | Files |
|
|
10
18
|
|-----------|--------|-------|
|
|
11
|
-
| **Phase 1: Infrastructure** | ✅ COMPLETE | `src/types/config.ts`, `src/config.ts
|
|
12
|
-
| **Phase 2: Execution** | ✅ COMPLETE | `src/
|
|
19
|
+
| **Phase 1: Infrastructure** | ✅ COMPLETE | `src/types/config.ts`, `src/config.ts` |
|
|
20
|
+
| **Phase 2: Execution** | ✅ COMPLETE | `src/engine/on-finish/orchestrator.ts`, `src/engine/on-finish/utils.ts` |
|
|
13
21
|
| **Phase 3: Configuration** | ✅ COMPLETE | `examples/fact-validator.yaml` |
|
|
14
|
-
| **Phase 4: Documentation** |
|
|
15
|
-
| **Phase 5: Testing** |
|
|
22
|
+
| **Phase 4: Documentation** | ✅ COMPLETE | `docs/failure-routing.md`, `docs/dependencies.md`, `docs/foreach-dependency-propagation.md` |
|
|
23
|
+
| **Phase 5: Testing** | 🚧 PARTIAL | `tests/engine/foreach-on-finish.engine.test.ts`, `tests/unit/on-finish-validation.test.ts` |
|
|
16
24
|
| **Phase 6: Deployment** | ⏳ PENDING | - |
|
|
17
25
|
|
|
18
26
|
### Test Results
|
|
19
27
|
|
|
20
|
-
✅ **
|
|
28
|
+
✅ **16 on_finish-specific tests passing** (as of 2026-01-28)
|
|
21
29
|
|
|
22
30
|
### What's Working
|
|
23
31
|
|
|
@@ -613,10 +621,10 @@ if (check.on_finish && !check.forEach) {
|
|
|
613
621
|
|
|
614
622
|
### Documentation Updates
|
|
615
623
|
|
|
616
|
-
1. **`docs/failure-routing.md`**: Add `on_finish` section
|
|
617
|
-
2. **`docs/dependencies.md`**: Explain `on_finish` with forEach
|
|
618
|
-
3. **`examples/
|
|
619
|
-
4. **`docs/foreach-dependency-propagation.md`**: Update with `on_finish`
|
|
624
|
+
1. **`docs/failure-routing.md`**: Add `on_finish` section ✅
|
|
625
|
+
2. **`docs/dependencies.md`**: Explain `on_finish` with forEach ✅
|
|
626
|
+
3. **`examples/fact-validator.yaml`**: Complete working example ✅
|
|
627
|
+
4. **`docs/foreach-dependency-propagation.md`**: Update with `on_finish` ✅
|
|
620
628
|
|
|
621
629
|
## Testing Strategy
|
|
622
630
|
|