Fix: port build_env to modular expert_harmonizer (restores main broken by #8)#10
Conversation
PR #8 replaced the monolith + ablate_monolith with the modular harmonize_sm package + expert_harmonizer, but build_env (from #6) still imported the deleted ablate_monolith -> ModuleNotFoundError, breaking main's test collection. Port: build_env now copies the kept modules (common.py + non-held-out dataset_NN.py) into the env's data/gold/expert_code/harmonize_sm/ (the path the refactored harmonizer skill reads) instead of writing one ablated notebooks/*.py. Uses expert_harmonizer.kept_module_paths/kept_indices/block_indices/resolve_holdout. Tests updated to the modular fixture. Full suite green (36 + doctests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @cmungall's task —— View job PR Review: Fix build_env port to modular expert_harmonizer
SummaryThis PR correctly fixes the broken Code Quality & Best Practices
✅ Clean import of ✅ Fail-fast pattern at ✅ The docstring at the top is thorough and accurate about the new ablation model. Minor nit — # current (rescans copied dir)
f"{len(block_indices(env / HARMONIZER_REL))} exemplar modules remain"
# simpler
f"{len(kept)} exemplar modules remain"Potential Bugs / Issues
PerformanceNo concerns. The SecurityNo concerns. No secrets handled. Symlink uses Test Coverage✅ Tests are well-structured and cover the main scenarios:
Gap: No test for the
Verdict✅ Approved in spirit — this is a correct, clean fix that unblocks the pipeline. The two minor issues (unnecessary |
Why
mainis currently broken. PR #8 (modular refactor) deletedsrc/folds/ablate_monolith.py, butbuild_env.py(merged in #6) still didfrom src.folds.ablate_monolith import .... Result onmain:build_envwon't import andtests/test_build_env.pyerrors on collection — sostep 2 of the eval pipeline is non-functional. (This is the merge-order hazard
flagged in the #8 review: the refactor branch predated #6 and didn't update
build_env.)Fix
Port
build_envfrom the old monolith/ablate model to the modular harmonizer:kept_module_paths/kept_indices/block_indices/resolve_holdoutfrom
expert_harmonizerinstead of the deletedablate_monolith.common.py+ the keptdataset_NN.pymodules, copied todata/gold/expert_code/harmonize_sm/— thepath the refactored harmonizer skill now reads (Refactor expert harmonizer from monolith to modular package #8 changed its
context_dependencies). Held-out modules are simply not copied (ablation byomission). This replaces writing a single ablated
notebooks/…py.MANIFEST.json(held-out
dataset_identifiers for trace audit), andAGENT_INSTRUCTIONS.mdare unchanged in spirit; instructions text updated to the new code path.
Verification
--holdout 1,2,3,6,16,27→ envharmonize_sm/hascommon.py+the 13 kept dataset modules; held-out modules and mapping entries absent.
Unblocks the pipeline so step 3 (runner) can build on it.