A small Swift search example testing cancellation and stale completions

I've published a small standalone Swift package illustrating a search-state problem: an old request must not change results, errors or loading state after a newer query starts.

It combines task cancellation with a request revision and keeps selection by event identifier. The seven tests use controlled continuations, including a fetcher that deliberately ignores cancellation until the test resolves it. They cover stale success, stale failure, cleanup, an empty query, selection identity, a current error and cancelling during debounce.

Code and tests: RobinWinters/swift-search-request-ownership: Robin Winters: standalone Swift search example with cancellation, request ownership, stable selection and deterministic tests. - Codeberg.org

This is an educational example prepared with coding-assistant support and tested with Swift 6.4 on macOS. It isn't extracted application code and doesn't include a SwiftUI observation adapter or live networking. I'd welcome feedback on the state contract and additional troublesome completion orderings worth testing.

Robin Winters