feat(FOSMVVM): task(error:) twins + unified async cancellation contract - #136
Merged
Conversation
AsyncLifecycle.md walks the async error/lifecycle contract situation-by- situation with sequence diagrams against one rooted screen; ratified as the semantic contract for the .task(error:) twin arc, including the CancellationError sentinel filter and discard logging. The plan file carries the ratified design and decomposition.
…nding The engine's deposit guard now filters the CancellationError sentinel type in addition to the invocation-cancelled check: a CancellationError thrown by a non-cancelled invocation is discarded, making the quiet exit a supported idiom. Filter is sentinel-only; domain-vocabulary cancellation errors still deposit. All discarded outcomes emit a debug notice. Contract documented in the AsyncLifecycle DocC article; pinned by three new AsyncButtonActivityTests.
Twins of SwiftUI's task(priority:_:) and task(id:priority:_:): the action becomes throwing, and a thrown error lands in the required error: binding, cleared on each start. Cancellation — view disappearance, an id-change restart, or the CancellationError sentinel — never reaches the binding; discards emit a debug notice. Both overloads forward to AsyncTaskEngine.run, pinned by AsyncTaskTests. Contract documented in the AsyncLifecycle DocC article.
Retires the hand-caught .task { do/catch } interim from the view-
generator and ui-tests-generator skills; the wiring article gains a
View-Lifetime Loads section and cross-links AsyncLifecycle from the
Overview.
Adds the FOSMVVM § SwiftUI Support catalog entry for the task(error:) twins, updates the button/alert entries for the unified cancellation contract, covers the LocalizableErrorOptions catalog gap from 0.13.0, and indexes the new reach in the discovery skill and CLAUDE.md. Catalog audit: 0 gaps, 0 stale. Full test suite passes (781 tests).
foscomputerservices
added a commit
that referenced
this pull request
Aug 21, 2026
…ction lost in #136 merge
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
Adds the error-routing twins of SwiftUI's
taskmodifiers —task(error:priority:_:)andtask(id:error:priority:_:)— completing the async error surface begun in 0.13.0: view-lifetime and value-keyed loads now deposit thrown errors into the same screen-levelerror:binding the async Button forms feed, presented by onealert(error:).The arc also ratified a unified cancellation contract, applied to both families (a behavior change to the 0.13.0 button engine):
error, of any provenance: a cancelled invocation deposits nothing, and the language'sCancellationErrorsentinel type is filtered even from a non-cancelled invocation — making the quiet exit (throwCancellationErrorto end with nothing presented) a supported idiom.URLError.cancelledetc.) deposit and present normally.Documentation
AsyncLifecycle.md) — the ratified semantic contract, walked situation-by-situation with sequence diagrams against one rooted screen; nine walkthroughs, each ending with the rule it demonstrates.AsyncActionsAndErrors.mdgains a View-Lifetime Loads section and cross-links the new article.fosmvvm-swiftui-view-generator,fosmvvm-ui-tests-generator) retire the hand-caught.task { do/catch }interim; plugin 2.28.0.taskentry, updated button/alert entries,LocalizableErrorOptionsgap covered; audit 0 gaps / 0 stale.Testing
AsyncTaskTestspin the twin's contract throughAsyncTaskEngine.run(clear-on-launch, outcomes, cancellation incl. the raced-genuine-failure discard, the id-restart race, sentinel filter + boundary, compile surface).AsyncButtonActivityTestspin the sentinel filter and discard semantics in the button engine.