Commit 12f94d4
feat: liveness probes, recovery strategies, and skip_if rename (#111)
## Summary
- Adds k8s-inspired **readiness and liveness probes** for both `command`
and `start_server` nodes to detect unhealthy state (dropped SSH tunnels,
crashed processes, unreachable databases)
- Adds **recovery strategies** (`notify`, `restart_node_and_dependents`,
`restart_environment`) configurable at project/node/variant level
- Renames `verify` to **`skip_if`** for clarity (alias preserved)
- Bumps schema version to `"2"` (v1 fully backward compatible)
- Daemon automatically detects liveness failures and triggers recovery
via `veld restart` subprocess
### New config shape
```json
{
"schemaVersion": "2",
"recovery_strategy": "restart_node_and_dependents",
"nodes": {
"database": {
"variants": {
"dblab": {
"type": "command",
"command": "./scripts/dblab/start.sh veld-${veld.run}",
"on_stop": "./scripts/dblab/stop.sh veld-${veld.run}",
"outputs": ["DATABASE_URL"],
"skip_if": "./scripts/dblab/verify.sh veld-${veld.run}",
"probes": {
"liveness": {
"type": "command",
"command": "pg_isready -h ${DB_HOST} -p ${DB_PORT}",
"interval_ms": 5000,
"failure_threshold": 3,
"max_recoveries": 3
}
}
}
}
}
}
}
```
### Key changes
| Area | Changes |
|------|---------|
| Schema | `probes` (readiness + liveness), `recovery_strategy`,
`skip_if`, `LivenessProbe` def |
| Config | `RecoveryStrategy` enum, `ProbesConfig`, `LivenessProbe`,
`resolve_recovery_strategy()`, `readiness_probe()`, `liveness_probe()` |
| State | `NodeStatus::Unhealthy`, `RunStatus::Recovering`, liveness
tracking fields |
| Orchestrator | Uses `probes.readiness` (fallback to `health_check`),
readiness probes for command nodes, `skip_if` rename |
| Daemon | Liveness monitor with per-probe intervals, failure counting,
recovery triggering, `veld restart` subprocess |
| Graph | `get_dependents()` for recovery subgraph identification |
| Recovery | New module: `stop_subgraph()`, state helpers, strategy
resolution |
## Test plan
- [x] All 121 existing + new tests pass (`cargo test`)
- [x] Zero clippy warnings (`cargo clippy`)
- [x] Schema v1 configs still load (backward compat)
- [x] `verify` alias works for `skip_if`
- [x] `probes.readiness` takes precedence over `health_check`
- [x] Recovery strategy resolution: variant > node > global > default
- [x] `get_dependents()` correctly identifies transitive dependents
- [ ] Manual test: command node with liveness probe detects failure and
triggers restart
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 5c5262b commit 12f94d4
File tree
29 files changed
+2433
-423
lines changed- crates
- veld-core/src
- veld-daemon
- assets
- src
- veld/src
- commands
- docs
- schema
- v1
- v2
- skills/veld
- reference
- tests
- website
29 files changed
+2433
-423
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
724 | 724 | | |
725 | 725 | | |
726 | 726 | | |
727 | | - | |
| 727 | + | |
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
76 | | - | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
86 | | - | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
155 | | - | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
0 commit comments