OCDocker.OCScore.Utils.LeakageAudit module

Leakage audit helpers for staged OCScore production-grade protocols.

class OCDocker.OCScore.Utils.LeakageAudit.LeakageAuditResult(passed, findings=<factory>)[source]

Bases: object

Aggregated leakage audit output.

Parameters:
passed: bool
findings: list[LeakageFinding]
to_dict()[source]

Serialize leakage audit findings for JSON reports.

Returns:

Pass/fail flag and structured finding list.

Return type:

dict[str, Any]

class OCDocker.OCScore.Utils.LeakageAudit.LeakageFinding(severity, code, message, details=<factory>)[source]

Bases: object

Single leakage audit finding.

Parameters:
  • severity (str)

  • code (str)

  • message (str)

  • details (dict[str, Any])

severity: str
code: str
message: str
details: dict[str, Any]
OCDocker.OCScore.Utils.LeakageAudit.run_leakage_audit(*, feature_selection=None, pdbbind_split_diagnostics=None, dudez_split_diagnostics=None, scaling_metadata=None, strict=False)[source]

Run production-grade leakage checks on staged protocol metadata.

Parameters:
  • feature_selection (dict | None) – Feature-selection scope metadata.

  • pdbbind_split_diagnostics (dict | None) – PDBbind split diagnostics from the regression stage.

  • dudez_split_diagnostics (dict | None) – DUDEz split diagnostics from the screening stage.

  • scaling_metadata (dict | None) – DUDEz scaling metadata.

  • strict (bool) – When True, critical findings fail the audit.

Returns:

Audit outcome and findings list.

Return type:

LeakageAuditResult

OCDocker.OCScore.Utils.LeakageAudit.write_leakage_audit_report(output_dir, result)[source]

Write leakage_audit.json to output_dir.

Parameters:
Return type:

Path