Mission-critical audit: fix stale tests and safety gaps#31
Open
christopherkarani wants to merge 2 commits intomainfrom
Open
Mission-critical audit: fix stale tests and safety gaps#31christopherkarani wants to merge 2 commits intomainfrom
christopherkarani wants to merge 2 commits intomainfrom
Conversation
- Gate DiffusionModelDownloader tests behind MLX trait + module conditions to match production availability
- Add GeneratedContent regression tests and map non-finite numeric values to JSON null instead of silently falling back to {}
- Remove strict-concurrency warning source in GenerationSchema by making EncodingError.invalidValue strongly typed
- Replace deprecated DeviceCapabilities C-string conversion with safe UTF-8 byte decoding
- Update ModelIdentifier/ProtocolCompilation XCTest expectations for current provider/model surface (Kimi + MiniMax additions)
- Refresh ModelRegistry docs to match actual catalog composition
Verification:
- swift build
- swift test --filter GeneratedContentTests
- swift test --filter ModelIdentifierTests
- swift test --filter ProtocolCompilationTests
- swift test (570 XCTest + 354 Swift Testing tests, all passing)
Owner
Author
|
@claude review |
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 executes the framework audit remediation pass and fixes the highest-impact correctness/testing issues found during verification.
What was fixed
DiffusionModelDownloaderTestscompile guard to match production availability:CONDUIT_TRAIT_MLX && canImport(MLX) && (canImport(Hub) || canImport(HuggingFace))GeneratedContentTestsfor:NaN) serializing asnullGeneratedContent.toJSONValue()to map non-finiteDoublevalues toNSNullinstead of hitting JSON serialization failures and silently falling back to{}.GenerationSchemainternalEncodingError.invalidValuenow usesStringinstead ofAny, removing the non-Sendable associated-value warning source under strict concurrency.String(cString:)usage inDeviceCapabilitieswith explicit null-terminated UTF-8 byte decoding.ModelIdentifierTestscounts and cloud-provider assumptionsProtocolCompilationTestsProviderType.allCasescount and case coverageModelRegistrycomments to match current model catalog composition and cloud-provider description.Verification
swift build✅swift test --filter GeneratedContentTests✅swift test --filter ModelIdentifierTests✅swift test --filter ProtocolCompilationTests✅swift test✅Notes
tasks/per repo rule.