feat! Major Design and Feature Improvements - #22
Merged
Conversation
couchdeveloper
force-pushed
the
feature/improveDesign
branch
from
August 2, 2026 19:48
fd32c28 to
e00b68d
Compare
**Summary** This PR consolidates the feature/improveDesign branch into main, representing a substantial architectural overhaul of the Transduce runtime. The changes span the effect system, task management, concurrency model, and host layer — with a focus on correctness under Swift 6 strict concurrency and a cleaner, more composable public API. This is a breaking change. Several public types and signatures have been restructured. At this early development stage, API instability is expected and acceptable. Consumers on 0.9.0 should not merge until 1.0 beta is released. **Effect System** The effect system has been simplified from a fragmented set of factory functions into a cohesive enum with explicit cases for each effect variant. Task effects now use nonisolated(nonsending) closures, eliminating ambiguity around actor isolation. The TaskReturn enum gives fine-grained control over how tasks dispatch their results — supporting .response, .send, .post, .request, and .uniqueRequest dispatch styles. Action effects are split into sync/async x terminal/partial/maybe-partial variants, each with clear isolation semantics documented inline. **Task Management** The TaskManager now implements a full 2x2 overlap policy matrix: .switchToLatest and .shareable policies, each behaving correctly for both runtime-owned and caller-owned continuations. Anonymous tasks get auto-generated identifiers. Waiter lifecycle is enforced via the Waiters enum with exactly-once resume semantics. The test suite for task management has grown to ~30 tests covering add, cancel, subscribe, switch, and cross-id isolation scenarios. **Concurrency & Swift 6** The runtime is fully compliant with Swift 6 strict concurrency. The Transducer protocol uses a primary associated type (Transducer<Env>) for cleaner constraint expressions. BaseRuntime is @unchecked Sendable with host-level guarantees enforced by GlobalActorRuntime. The compute gate serializes all compute cycles on the system actor, preventing re-entrancy. All closure parameters carry explicit isolation annotations — nonisolated(nonsending) for task operations, isolated variants for actions that touch actor state. **Hosts & Observation** EffectView remains the primary SwiftUI host, with TransducerHost providing a lightweight actor-isolated wrapper for non-UI contexts. The TransducerObservable host bridges to Swift's Observation framework. The observe() function enables reactive keypath tracking inside task effects, with proper cancellation on task teardown. **Version & Release Intent** This commit is the candidate for a beta release, positioning the library near its first beta release. The core runtime is stable, the test suite is comprehensive (162 tests, all passing), and the public API surface is well-documented. Remaining work before 1.0 beta includes: sequence effects discarding intermediate events (deferred), stress testing under high concurrency, and filling Observation host test coverage. Remove analysis reports Remove development todos files Reset tool version to 6.3 in package manifest Adjust code for Swift 6.3.x
couchdeveloper
force-pushed
the
feature/improveDesign
branch
from
August 2, 2026 21:21
e00b68d to
30d28ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR consolidates the feature/improveDesign branch into main, representing a substantial architectural overhaul of the Transduce runtime. The changes span the effect system, task management, concurrency model, and host layer — with a focus on correctness under Swift 6 strict concurrency and a cleaner, more composable public API.
This is a breaking change. Several public types and signatures have been restructured. At this early development stage, API instability is expected and acceptable. Consumers on 0.9.0 should not merge until 1.0 beta is released.
Effect System
The effect system has been simplified from a fragmented set of factory functions into a cohesive enum with explicit cases for each effect variant. Task effects now use nonisolated(nonsending) closures, eliminating ambiguity around actor isolation. The TaskReturn enum gives fine-grained control over how tasks dispatch their results — supporting .response, .send, .post, .request, and .uniqueRequest dispatch styles. Action effects are split into sync/async x terminal/partial/maybe-partial variants, each with clear isolation semantics documented inline.
Task Management
The TaskManager now implements a full 2x2 overlap policy matrix: .switchToLatest and .shareable policies, each behaving correctly for both runtime-owned and caller-owned continuations. Anonymous tasks get auto-generated identifiers. Waiter lifecycle is enforced via the Waiters enum with exactly-once resume semantics. The test suite for task management has grown to ~30 tests covering add, cancel, subscribe, switch, and cross-id isolation scenarios.
Concurrency & Swift 6
The runtime is fully compliant with Swift 6 strict concurrency. The Transducer protocol uses a primary associated type (Transducer) for cleaner constraint expressions. BaseRuntime is @unchecked Sendable with host-level guarantees enforced by GlobalActorRuntime. The compute gate serializes all compute cycles on the system actor, preventing re-entrancy. All closure parameters carry explicit isolation annotations — nonisolated(nonsending) for task operations, isolated variants for actions that touch actor state.
Hosts & Observation
EffectView remains the primary SwiftUI host, with TransducerHost providing a lightweight actor-isolated wrapper for non-UI contexts. The TransducerObservable host bridges to Swift's Observation framework. The observe() function enables reactive keypath tracking inside task effects, with proper cancellation on task teardown.
Version & Release Intent
This commit is the candidate for a beta release, positioning the library near its first beta release. The core runtime is stable, the test suite is comprehensive (162 tests, all passing), and the public API surface is well-documented. Remaining work before 1.0 beta includes: sequence effects discarding intermediate events (deferred), stress testing under high concurrency, and filling Observation host test coverage.