validate_debug_completion
Validates that post-run debug artifacts (JSON and log file) exist and contain required content. Checks artifact JSON keys and log markers, returning any errors found.
Instructions
Validate post-run debug artifacts landed on disk with the right shape.
Three deterministic checks:
- STR-001: ``selected_robust_trial.json`` + log file both exist.
- VAL-003: artifact JSON parses and carries every required top-level key.
- BT-010: log contains each required marker substring (order irrelevant).
Args:
artifact_path: Absolute path to the JSON artifact (typically
``<workspace>/backtest/selected_robust_trial.json``).
log_path: Absolute path to the debug log file.
required_json_keys: Top-level keys expected on the artifact.
Defaults to ``["trial_number", "params", "metrics"]``.
required_log_markers: Substrings expected in the log. Defaults
to ``["STAGE 4 COMPLETE", "STAGE 5 COMPLETE", "FINAL SUCCESS"]``.
Returns ``{"any_errors": bool, "findings": [{"code", "message",
"context"}, ...]}``. Never raises — parse / file-access failures
surface as findings with the appropriate error code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| artifact_path | Yes | ||
| log_path | Yes | ||
| required_json_keys | No | ||
| required_log_markers | No |