fix(k1): admit start after reopened standby

This commit is contained in:
DCCONSTRUCTIONS
2026-08-14 15:50:03 +03:00
parent 606cbbfae2
commit 9ef115d3b4
2 changed files with 35 additions and 3 deletions
@@ -3820,13 +3820,21 @@ def _is_reopened_classified_stop_standby_settlement(
) -> bool:
"""Accept one fresh READY that settles a reopened READY-classified STOP."""
classification = _prepared_stop_classification(record)
operation_id = reconciliation.original_attempt.operation_id
classification = next(
(
item
for item in record.reconciliations
if item.kind == "prepared-stop-classification"
and item.original_attempt.operation_id == operation_id
),
None,
)
if not (
classification is not None
and classification.resolution == "physical-standby-observed"
and reconciliation.kind == "resolved-active-cessation"
and reconciliation.resolution == "physical-standby-observed"
and reconciliation.original_attempt.operation_id == record.operation_id
and reconciliation.observation.session_state == "ready"
and not reconciliation.observation.project_bound
and not reconciliation.observation.init_ready
@@ -3837,7 +3845,7 @@ def _is_reopened_classified_stop_standby_settlement(
for reopening in record.operator_reconciliation_reopens
for retirement in record.operator_retirements
if reopening.retirement_id == retirement.retirement_id
and retirement.original_attempt.operation_id == record.operation_id
and retirement.original_attempt.operation_id == operation_id
and retirement.original_attempt.resolution == "not-dispatched"
]
if settlement_index >= len(matching_reopens):