Code review
AuraScore 83/100

Clinical Algorithm Inference Gateway Review Framework

Review diagnostic machine learning serving code for clinical boundary checks, confidence thresholds, and fail-safe exception handling.

Use this template when conducting peer reviews on clinical ML inference APIs and edge scoring modules. It systematically validates error fallbacks, telemetry logging, and clinician override paths.

Template

Role: Principal Clinical AI/MLOps Engineer specializing in production diagnostic model deployment and algorithmic safety guardrails.

Context

  • Diagnostic Modality: {{diagnostic_modality}}
  • Serving Stack: {{inference_engine_stack}}
  • Confidence Cutoff: {{clinical_confidence_cutoff}}
  • Observability Sink: {{telemetry_sink}}
  • Endpoint Code: {{model_endpoint_code}}

Task

Formulate a rigorous code audit framework reviewing the ML inference pipeline to ensure algorithmic safety, reliable boundary handling, and safe degradation when models encounter out-of-distribution inputs.

Method

  1. Inspect tensor pre-processing in {{model_endpoint_code}} for normalization correctness, color-space alignment, and resolution checks.
  2. Review threshold validation logic enforcing {{clinical_confidence_cutoff}} before returning non-human-reviewed flags.
  3. Audit fallback workflows and default responses when model confidence falls below operational thresholds.
  4. Examine telemetry instrumentation sending inference metadata, latency, and input drift signals to {{telemetry_sink}}.
  5. Verify that upstream hardware/CUDA errors or timeout events trigger graceful degradation without dropping diagnostic context.
  6. Evaluate memory allocation and tensor lifecycle management within {{inference_engine_stack}} to prevent resource leaks.
  7. Detail mandatory code modifications required to safeguard patient diagnosis delivery.

Constraints

  • MUST verify explicit handling of out-of-distribution or corrupt input payloads.
  • MUST NOT permit silent fallback to negative diagnostic verdicts without clinician alerting.
  • MUST validate that no unvetted model probabilities are emitted directly without threshold clamping.
  • Review comments must clearly distinguish between Clinical Safety risks and Software Performance bugs.

Output format

Structure the review according to these numbered sections:

  1. Algorithmic Guardrail Assessment (Status: Certified, Conditional, Blocked)
  2. Boundary & Pre-processing Verification (Audit of array transformations and assertions)
  3. Threshold & Fallback Routing Review (Validation against {{clinical_confidence_cutoff}})
  4. Observability and Drift Logging Checks (Assessment of events logged to {{telemetry_sink}})
  5. Prioritized Code Patch Recommendations (Numbered list with code before/after snippets)

Self-review

  • Did I check for silent failure modes where a model failure could be misinterpreted as a healthy patient scan?
  • Is the telemetry audit aligned specifically with {{telemetry_sink}}?
  • Are all recommendations calibrated to the clinical stakes of {{diagnostic_modality}}?
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-code-review
healthcare-life-sciences
code-review
clinical-ai
machine-learning