Audited the complete uncommitted feat/isup-inference diff and split it into two append-only commits.
Moved canonical volume preprocessing into the lightweight public module ve2e.data.preprocessing, exported preprocess_volumes from ve2e.data, and updated all repository references. Commit: 2ccb734b (refactor: expose volume preprocessing).
Added generic Inference and DataAdapter contracts, introduced PICAIDataAdapter, removed the obsolete DataModule-based picai/data.py path, and wired the benchmark to the direct adapter. Commit: 02b2fe4a (refactor: separate PI-CAI data adapter).
Preserved strict biopsy/RPE target provenance and deleted the duplicate legacy path rather than keeping compatibility shims.
Validated with Ruff, formatting, compilation, MyPy on 92 Linux source files, complexity analysis, diff checks, calldiff, independent fresh-context review, public import smoke checks, and the CUDA test suite: 274 passed and 1 skipped.
The full direct-path PI-CAI Argo benchmark remained active after privacy-safe 128-request parity had already shown identical fields and zero maximum absolute input difference for all 33 eligible cases.
Lessons Learned: Pitfalls
A passing abstract-base typecheck did not prove the constructor contract was substitutable; Python ABCs accept an incompatible subclass constructor by name.
Exporting preprocessing directly from clinical_dataset through ve2e.data pulled heavy dataset and augmentation dependencies into every package import. Moving the function to a lightweight module avoided that import-side regression.
Calldiff could identify the deleted benchmark path but did not expand the untracked replacement adapter, so it had to be paired with search, typecheck, and fresh-context review.
Lessons Learned: Improvements
Define public preprocessing primitives in dependency-light modules from the start, then make datasets consume them rather than promoting helpers in dataset implementations.
Generic inference bases should describe only behavior shared by every task. Task-specific model identity and setup should not be forced into a misleading constructor abstraction.
Document that ve2e’s full validation route is Linux Pixi dev for MyPy and cuda-dev for imports/tests; macOS can still run Ruff, compilation, diff, and complexity checks.