CE Code Review
You are reviewing code for conformance with calibrated_explanations standards. Work through each review dimension below and produce a finding per violation.
Load references/review_dimensions.md for full dimension details with code examples.
Review dimensions (summary)
- Module boundary (ADR-001) — CRITICAL:
core/must never importplugins/internals. - Lazy imports — CRITICAL:
matplotlib,pandas,joblibmust be function-scoped. - Future annotations — REQUIRED: every
.pyfile starts withfrom __future__ import annotations. - Docstrings (Numpy style) — REQUIRED:
Parameters->Returns->Raises->Notes->Examples. - Exception handling (ADR-002) — REQUIRED: use CE exception hierarchy, not bare
ValueError. - Fallback visibility — CRITICAL: every fallback needs
_LOGGER.info()+warnings.warn(UserWarning). - Type hints — REQUIRED: avoid
Anywithout documented reason; prefix private with_. - Deprecation (ADR-011) — REQUIRED: use
deprecate()helper; 2 minor releases before removal. - CE-First compliance — public methods return calibrated types; assert fitted + calibrated.
Quick-check command
make local-checks-pr # fast required checks
make local-checks # full checks (only needed for main-branch gates)
pre-commit run --all-files # linting, ruff, mypy subset
Review Report Template
CE Code Review: <module/PR name>
=================================
ADR-001 module boundary: PASS / FAIL
violations: <list file:line>
Lazy imports: PASS / FAIL
eager heavy imports: <list>
Future annotations: PASS / FAIL
missing in: <list>
Docstrings (numpy style): PASS / FAIL
missing sections in: <list fn:section>
Exception handling: PASS / FAIL
bare exceptions at: <list>
Fallback visibility: PASS / FAIL
missing warn()/log() at: <list>
Type hints: PASS / FAIL
untyped parameters: <list>
Deprecation (ADR-011): PASS / FAIL / N_A
CE-First compliance: PASS / FAIL
Overall: CONFORMANT / NON-CONFORMANT (<N> issues)
Evaluation Checklist
- All 9 dimensions checked.
- ADR-001 boundary violations are blocking (must fix before merge).
- Fallback visibility violations are blocking.
- Lazy-import violations are blocking.
- Report produced with file:line references for each issue.