Create FoundationLabCore and define the first shared boundary#120
Open
rudrankriyam wants to merge 1 commit intomainfrom
Open
Create FoundationLabCore and define the first shared boundary#120rudrankriyam wants to merge 1 commit intomainfrom
rudrankriyam wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed:
associatedtype Resultshadows Swift's built-inResulttype- Renamed the associated type to
Outputand updatedexecuteto return it, avoiding the standard libraryResultname collision.
- Renamed the associated type to
Or push these changes by commenting:
@cursor push 24b27fa83a
Preview (24b27fa83a)
diff --git a/FoundationLabCore/Sources/FoundationLabCore/Capabilities/Capability.swift b/FoundationLabCore/Sources/FoundationLabCore/Capabilities/Capability.swift
--- a/FoundationLabCore/Sources/FoundationLabCore/Capabilities/Capability.swift
+++ b/FoundationLabCore/Sources/FoundationLabCore/Capabilities/Capability.swift
@@ -19,9 +19,9 @@
/// A task-oriented use case that can be shared by the app, App Intents, and CLI adapters.
public protocol CapabilityUseCase: Sendable {
associatedtype Request: CapabilityRequest
- associatedtype Result: CapabilityResult
+ associatedtype Output: CapabilityResult
static var descriptor: CapabilityDescriptor { get }
- func execute(_ request: Request) async throws -> Result
+ func execute(_ request: Request) async throws -> Output
}| /// A task-oriented use case that can be shared by the app, App Intents, and CLI adapters. | ||
| public protocol CapabilityUseCase: Sendable { | ||
| associatedtype Request: CapabilityRequest | ||
| associatedtype Result: CapabilityResult |
Contributor
There was a problem hiding this comment.
associatedtype Result shadows Swift's built-in Result type
Medium Severity
The associatedtype Result in CapabilityUseCase shadows Swift's built-in Swift.Result type. Any type conforming to this protocol will find that Result resolves to the associated type rather than Swift.Result, leading to confusing compiler errors when trying to use Swift.Result for error handling within conforming types. This is a well-known Swift antipattern that creates friction for every future implementer of this protocol.
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.



Closes #110
Summary
FoundationLabCore, as the first shared architectural seamWhy
This creates the first clean dependency boundary for later App Intents and CLI work without moving any major user-facing features yet.
Verification
swift testinFoundationLabCorexcodebuild -project FoundationLab.xcodeproj -scheme "Foundation Lab" -destination "platform=macOS" build