|
19 | 19 | export_strategy_artifact_manifest, |
20 | 20 | resolve_clean_source_revision, |
21 | 21 | ) |
22 | | -from src.pipeline import resolve_scoring_input_timestamp |
| 22 | +from src.pipeline import build_live_pool_outputs, resolve_scoring_input_timestamp |
23 | 23 |
|
24 | 24 |
|
25 | 25 | PROJECT_ROOT = Path(__file__).resolve().parents[1] |
@@ -118,6 +118,27 @@ def fake_build_live_pool_outputs(config, as_of_date=None, universe_mode=None): |
118 | 118 | self.assertEqual(validation["version"], "2026-03-13-core_major") |
119 | 119 | self.assertEqual(validation["pool_size"], 5) |
120 | 120 |
|
| 121 | + def test_build_live_pool_rejects_disabled_legacy_before_any_output_write(self) -> None: |
| 122 | + with tempfile.TemporaryDirectory() as tmp_dir: |
| 123 | + output_dir = Path(tmp_dir) / "fresh-output" |
| 124 | + config = { |
| 125 | + "paths": {"output_dir": output_dir}, |
| 126 | + "export": {"save_legacy_live_pool": False}, |
| 127 | + "universe": {"live_mode": "core_major", "modes": {"core_major": {}}}, |
| 128 | + } |
| 129 | + |
| 130 | + with ( |
| 131 | + patch("src.pipeline.prepare_research_panel") as prepare_research_panel, |
| 132 | + self.assertRaisesRegex( |
| 133 | + ValueError, |
| 134 | + r"export\.save_legacy_live_pool=false is incompatible with the required four-artifact release contract", |
| 135 | + ), |
| 136 | + ): |
| 137 | + build_live_pool_outputs(config) |
| 138 | + |
| 139 | + prepare_research_panel.assert_not_called() |
| 140 | + self.assertFalse(output_dir.exists()) |
| 141 | + |
121 | 142 | def test_manifest_identity_uses_git_head_and_panel_cutoff_not_environment_or_now(self) -> None: |
122 | 143 | with tempfile.TemporaryDirectory() as tmp_dir: |
123 | 144 | output_dir = Path(tmp_dir) |
|
0 commit comments