Conversation
Design for embedding Rhai scripting engine to enable complex monitors with custom logic, conditional flows, polling, and multi-step orchestration beyond what YAML-based monitors support. https://claude.ai/code/session_01DT5Gh9uynVDN2xDcFFXbQu
Adds Section 7 covering integration with the v1.0 database-backed config system: dual representation (script_path for YAML, script for DB/API), CRUD API validation, seeding flow, MonitorManager hot-reload compatibility, and updated architecture diagram. https://claude.ai/code/session_01DT5Gh9uynVDN2xDcFFXbQu
Fix async bridging (Handle::block_on panics from spawn_blocking), ScriptRunner borrow violations, wrong add_monitor_result signature, incorrect Rhai API, and wrong ApiError discriminant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduces a third monitor type alongside single-step and multi-step. Scripted monitors run arbitrary Rhai scripts with access to HTTP, JSON parsing, assertions, environment variables, and structured step recording. - Add `script`, `script_path`, `script_timeout_seconds` fields to Monitor - Validate three-way mutual exclusivity (url+method | steps | script) - Resolve `script_path` to inline content at config load time - New `src/scripting/` module: ScriptRunner, engine with resource limits, and host functions (http, assert, parse_json, env, uuid, step, logging) - Branch monitor execution to ScriptRunner for scripted monitors - Validate inline scripts on create/update via the CRUD API - Add .cargo/config.toml to redirect target dir to native fs (virtiofs fix) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a Scripted Monitors section to README with YAML config examples, full function reference table, and a step-chaining example that mirrors the multi-step IP flow. Update project overview and feature roadmap. Update AGENTS.md to reflect the new monitor type and scripting module. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code reviewFound 1 issue:
prodzilla/src/monitor/monitor_logic.rs Lines 78 to 90 in 9849a03 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
|
Issue: The non-scripted execution path never panics — all errors are captured as failed prodzilla/src/monitor/monitor_logic.rs Lines 73 to 76 in 9849a03 |
|
Issue: When an assertion fails inside a Fix: in prodzilla/src/scripting/host_functions/steps.rs Lines 15 to 31 in 9849a03 prodzilla/src/scripting/mod.rs Lines 94 to 103 in 9849a03 |
|
Issue:
prodzilla/src/monitor/model.rs Lines 78 to 81 in 9849a03 |
|
Issue:
prodzilla/src/scripting/types.rs Lines 9 to 14 in 9849a03 |
|
Issue: Test comment and logic don't account for scripted monitors The test comment says "Verify one is single-step and one is multi-step" and uses Lines 113 to 123 in 9849a03 |
- Fix duration metric double-counting by using time_since(timestamp_started) - Replace unwrap() on ScriptRunner::new() with failed MonitorResult - Preserve clean assertion messages in step() by unwrapping Rhai error wrappers - Add #[serde(skip_serializing)] to script_path (YAML-only field) - Remove dead code: assertion_failures and metadata from ScriptContext - Fix config test filter to exclude scripted monitors from single-step count - Add regression tests for all fixed bugs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
No description provided.