OCDocker.Workbench.Evidence module

Read-only OCScore evidence discovery for Workbench dashboards.

OCDocker.Workbench.Evidence.build_evidence_index(root, *, max_depth=6, source_depth=6, max_entries=400, max_csv_rows=1000, max_series=8, max_shap_features=30)[source]

Build a read-only evidence index from adopted Workbench sources.

Parameters:
  • root (str or pathlib.Path) – Workspace root or result manifest file to scan.

  • max_depth (int) – Maximum Workbench manifest scan depth.

  • source_depth (int) – Maximum recursive depth below each adopted source path.

  • max_entries (int) – Maximum evidence entries to return.

  • max_csv_rows (int) – Maximum CSV rows read per evidence file for plot previews.

  • max_series (int) – Maximum Optuna trial series included in preview points.

  • max_shap_features (int) – Maximum SHAP feature previews returned per SHAP CSV file.

Returns:

Evidence index and plot-ready preview points.

Return type:

WorkbenchEvidenceIndex

OCDocker.Workbench.Evidence.resolve_evidence_asset(root, asset_path, *, max_depth=6, source_depth=6)[source]

Resolve a discovered image evidence asset for local API serving.

Parameters:
  • root (str or pathlib.Path) – Workspace root or result manifest file used to discover adopted sources.

  • asset_path (str or pathlib.Path) – Requested image path. Relative paths are resolved below root.

  • max_depth (int) – Maximum Workbench manifest scan depth.

  • source_depth (int) – Maximum recursive depth below each adopted source path.

Returns:

Resolved image path and HTTP content type.

Return type:

tuple[pathlib.Path, str]

Raises:
  • FileNotFoundError – If the requested asset is absent.

  • ValueError – If the requested path is not a supported discovered image asset.

OCScore evidence discovery

The evidence helper scans adopted Workbench source paths and discovers produced OCScore evidence such as performance CSV files, Optuna trial traces, SHAP value exports, SHAP figures, cross-validation tables, and analysis figures. The scan is read-only: it does not launch jobs, stop jobs, mutate OCScore output directories, or regenerate plots.

ocdocker workbench evidence workbench-runs --source-depth 5
ocdocker workbench serve workbench-runs --host 127.0.0.1 --port 8765

The local API exposes the payload at /api/evidence. The Workbench browser dashboard can use the same payload to render performance, optimization, and SHAP previews when those evidence files are present in adopted OCScore outputs. Raster figure previews are served through /api/evidence-asset only when the requested image belongs to a discovered SHAP or analysis figure under an adopted source path.