Context
We landed a targeted Swift runtime hardening patch to stabilize CI, but this did not complete the full redesign we discussed.
This issue tracks the full Swift redesign needed for correctness-by-construction under resume/retry/channel concurrency.
Required redesign scope
- Single explicit driver phase state machine with serialized ownership.
- Phases such as
connected, resuming, disconnected.
- Atomic transition boundaries for resume.
- Single outbound writer/sequencer path.
- No side sends that can bypass queued backlog ordering.
- Explicit channel lifecycle FSM.
open/closing/closed (or equivalent) with guarded transitions.
- Eliminate ambiguous buffer/close races.
- Retry/channel rebinding ownership.
- Generation-aware rebinding and finalize semantics owned by a single state authority.
Constraints
- Preserve current protocol semantics.
- Keep strict schema behavior (no duplicate-schema spec relaxation).
- Keep retry behavior consistent with spec tests.
Validation plan
- Repeated local stress loops for:
lang_swift_transport_tcp::direction_harness_to_subject::channel_retry_idem_reruns_with_fresh_channels
lang_swift_transport_tcp::direction_harness_to_subject::channel_retry_non_idem_fails_closed
- Repeated full
lang_swift_transport_tcp:: matrix runs before merge.
Motivation
Current hardening reduced flakiness and got CI green, but architectural debt remains. This redesign should move Swift runtime behavior from “stabilized by patches” to “provably sequenced by design”.
Context
We landed a targeted Swift runtime hardening patch to stabilize CI, but this did not complete the full redesign we discussed.
This issue tracks the full Swift redesign needed for correctness-by-construction under resume/retry/channel concurrency.
Required redesign scope
connected,resuming,disconnected.open/closing/closed(or equivalent) with guarded transitions.Constraints
Validation plan
lang_swift_transport_tcp::direction_harness_to_subject::channel_retry_idem_reruns_with_fresh_channelslang_swift_transport_tcp::direction_harness_to_subject::channel_retry_non_idem_fails_closedlang_swift_transport_tcp::matrix runs before merge.Motivation
Current hardening reduced flakiness and got CI green, but architectural debt remains. This redesign should move Swift runtime behavior from “stabilized by patches” to “provably sequenced by design”.