@@ -173,6 +173,31 @@ def _frozen_runtime_target():
173173 )
174174
175175
176+ def _frozen_runtime_target_from_minimal_json ():
177+ """Mirror a valid legacy target JSON that omits derived execution fields."""
178+
179+ payload = {
180+ "platform_id" : "ibkr" ,
181+ "strategy_profile" : "soxl_soxx_trend_income" ,
182+ "dry_run_only" : False ,
183+ "deployment_selector" : "live" ,
184+ "account_selector" : ["group" ],
185+ "account_scope" : "live" ,
186+ "service_name" : "ibkr-live" ,
187+ }
188+ return build_runtime_target (
189+ ** payload ,
190+ live_continuity = {
191+ "state" : "RECONCILE_ONLY" ,
192+ "baseline_kind" : "legacy_authorized" ,
193+ "baseline_id" : "ibkr-soxl-lkg-20260830" ,
194+ "baseline_target_sha256" : runtime_target_fingerprint (payload ),
195+ "captured_at" : "2026-08-30" ,
196+ },
197+ continuity_fingerprint_payload = payload ,
198+ )
199+
200+
176201def _observations () -> IBKRReconciliationObservations :
177202 return IBKRReconciliationObservations (
178203 account_scope = {"account_ids" : ["U123" ]},
@@ -210,6 +235,25 @@ def test_candidate_stays_frozen_without_private_expected_digests(tmp_path) -> No
210235 assert candidate .to_safe_dict ()["evidence" ]["positions_sha256" ]
211236
212237
238+ def test_candidate_accepts_startup_validated_legacy_json_baseline (tmp_path ) -> None :
239+ candidate = build_reconciliation_candidate (
240+ observations = _observations (),
241+ runtime_target = _frozen_runtime_target_from_minimal_json (),
242+ platform_id = "ibkr" ,
243+ strategy_profile = "soxl_soxx_trend_income" ,
244+ account_group = "LIVE" ,
245+ project_id = None ,
246+ env_reader = lambda name , default = None : (
247+ str (tmp_path ) if name == "IBKR_EXECUTION_STATE_DIR" else default
248+ ),
249+ )
250+
251+ assert "broker_reconciliation_baseline_target_mismatch" not in {
252+ finding .value for finding in candidate .recovery_blockers
253+ }
254+ assert candidate .permits_active_lkg is False
255+
256+
213257def test_candidate_can_only_pass_with_all_matching_private_digests (tmp_path ) -> None :
214258 target = _frozen_runtime_target ()
215259
0 commit comments