Enable Swift 6 strict concurrency on the library target #2
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 255 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.332
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2"
general
weight: 0.35
shruti-p-s
Enable Swift 6 strict concurrency on the CassandraClient library target.
Stacked on apple/swift-cassandra-client#108, will open on main once PR#108 merges.
### Motivation:
Completes the Swift 6 strict-concurrency migration. After the earlier annotation and race-fix work, the remaining data-race errors were in the async-bridge closures (
CassFuture's completion callback and the synchronouswithConnectionbody). Making those safe lets the library drop its Swift 5 language-mode opt-out and build under Swift 6.### Modifications:
- CassFuture: constrain the value type to
Sendable, mark the completion@Sendable, and replacesyncWait's mutable-varresult bridge withNIOLockedValueBox.-
Rows: conform toSendable; add an internalCassPreparedwrapper so the prepare future carries aSendablevalue (a rawOpaquePointercan't beSendable).-
withConnection: constrainResulttoSendableand markbody@Sendable; confine the non-Sendablestatementandbatchcaptures withnonisolated(unsafe).- Document
Statement's concurrency contract.- Remove
.swiftLanguageMode(.v5)from the library target (the test target keeps it).Driver-pointer wrappers are justified by the driver's documented thread-safety (see
include/cassandra.h).### Result:
The
CassandraClientlibrary now builds in Swift 6 language mode (strict concurrency).Source-breaking changes consumers may need to adapt to:
- Public closure parameters are now
@Sendable(Configuration.contactPointsProvider, thequery(...)row-transform closures, thewithSessionhandlers) — closures may only captureSendablevalues.-
Statement/ parameters are handed off viasendingonexecute(statement:pageSize:)andquery(_:parameters:pageSize:)— callers must transfer ownership, not reuse the instance.- Building in Swift 6 mode may make inferred
Sendableconformances on public types stricter.Additive (non-breaking):
Rowsnow conforms toSendable.