Harden orchestration and MCP response paths#41
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@claude review |
|
Claude finished @christopherkarani's task in 1m 35s ββ View job Code Review: Harden orchestration and MCP response paths
SummaryThis PR makes three targeted hardening improvements: removes Issues Found1. Contradictory contract for empty steps in
|
|
@claude fix all issues |
|
Claude finished @christopherkarani's task in 4m 7s ββ View job All review issues fixed
Summary of changes
|
- MCPProtocol: remove misleading `validatedJsonrpc` param from private init; hardcode "2.0" directly in init body instead. Add assert to enforce the result/error mutual-exclusivity invariant in debug builds. - OrchestrationHiveEngine: remove dead-code guard in makeGraph() (the empty-steps case is handled by execute() before makeGraph is called); replace with an assert to catch future regressions. Document the intentional passthrough behaviour for empty steps in execute(). Extract durationAsDouble(_:) helper to centralise the fragile seconds + attoseconds/1e18 conversion and eliminate duplication. - ParallelToolExecutor: replace silent break in failFast switch case with assertionFailure to surface future logic regressions in debug builds β a silent fallthrough would silently return failures, violating the failFast contract. Co-authored-by: Christopher Karani <christopherkarani@users.noreply.github.com>
Code Review: PR #41 β Harden orchestration and MCP response pathsSummaryThis PR makes four targeted hardening changes: removes Build / Test Results
Change-by-change Analysis
|
Pull Request
Thank you for contributing to Swarm! π
We appreciate your effort to improve the framework. This template helps ensure high-quality contributions that align with the project's standards.
Description
What does this PR do?
Motivation and Context
Fixes # (issue)
Type of Change
Please check the relevant option(s):
Changes Made
Implementation Details
Files Changed
path/to/file.swift- Description of changespath/to/another/file.swift- Description of changesAPI Changes (if applicable)
Testing
Test Coverage
Test Results
# Paste the output of: swift testManual Testing
Breaking Changes
Does this PR introduce breaking changes?
Breaking Change Details
Pre-Submission Checklist
Code Quality
swift buildand ensured no compilation errorsswift testand all tests passswift package plugin --allow-writing-to-package-directory swiftformatswiftlint lintConcurrency & Safety
Sendablewhere appropriateasync/awaitand structured concurrency correctly@MainActor,actor, ornonisolatedannotationsDocumentation
Sources/Swarm/Examples/if introducing new featuresprint()statements (usesswift-loginstead)Testing (TDD Required)
Version Compatibility
Additional Context
Screenshots (if applicable)
Related Issues/PRs
Questions or Concerns
Reviewer Checklist (for maintainers)
Thank you again for your contribution! Your efforts help make Swarm better for the entire Swift community. If you have any questions, feel free to ask in the comments below.