Retain K1 connection between scans and admit the next named acquisition

This commit is contained in:
DCCONSTRUCTIONS
2026-09-07 21:13:17 +03:00
parent ed9a77ba73
commit c6693d6f44
17 changed files with 586 additions and 274 deletions
@@ -34792,3 +34792,24 @@ def test_power_loss_during_observation_preserves_audit_and_releases_ownership(
is True
)
assert write_calls == 1
@pytest.mark.parametrize("socket_open", [True, False])
def test_completed_acquisition_does_not_imply_control_loss(tmp_path, socket_open):
service, _ = service_with_fake_runtime(tmp_path)
binding = _seed_supervised_connection(service)
control = {
"state": "completed", "control_socket_open": socket_open,
"verified_control": _verified_control_for_binding(
binding, control_session_id="retained-control-session",
),
}
service._reconcile_connection_supervisor(control, {"source_mode": "idle"}) # noqa: SLF001
snapshot = service._connection_supervisor.snapshot() # noqa: SLF001
assert snapshot.authority.control_allowed is socket_open
assert snapshot.authority.acquisition_start_allowed is socket_open
if socket_open:
service._reconcile_connection_supervisor( # noqa: SLF001
{**control, "state": "failed"}, {"source_mode": "idle"},
)
assert not service._connection_supervisor.snapshot().authority.control_allowed # noqa: SLF001