Improve CodeMap parsing concurrency#590
Open
baron wants to merge 1 commit into
Open
Conversation
Comment on lines
353
to
+357
| try Task.checkCancellation() | ||
| let outcome = try CodeMapSyntaxArtifactBuilder.build( | ||
| source: input.source, | ||
| language: input.language | ||
| language: input.language, | ||
| syntaxManager: syntaxManager |
Contributor
There was a problem hiding this comment.
Bug: The CodeMapArtifactBuilderClient initializer now requires a concrete SyntaxManager instead of the any CodeMapSyntaxQuerying protocol, which reduces testability and breaks dependency inversion.
Severity: LOW
Suggested Fix
Revert the syntaxManager parameter in the CodeMapArtifactBuilderClient initializer back to the protocol type any CodeMapSyntaxQuerying. This will restore the abstraction boundary, allowing mock implementations to be injected for testing and adhering to better API design principles.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
Sources/RepoPrompt/Features/CodeMap/CodeMapArtifactBuildCoordinator.swift#L353-L357
Potential issue: The initializer for `CodeMapArtifactBuilderClient` was updated to
require a concrete `SyntaxManager` instance for its `syntaxManager` parameter, instead
of the `any CodeMapSyntaxQuerying` protocol. This change breaks the abstraction
boundary, preventing the injection of mock objects for testing purposes. While existing
tests and production code are unaffected because they either use alternative
initializers or pass a real `SyntaxManager`, this design regression introduces technical
debt. It makes future testing more difficult by removing the ability to substitute mock
implementations that conform to the protocol, violating the dependency inversion
principle.
Did we get this right? 👍 / 👎 to inform future reviews.
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
Performance
Five warmed production-path samples over 16 mixed Swift, TypeScript, Python, and Go artifacts:
The effective CodeMap limit is max(1, min(4, activeProcessorCount) - 1), matching the existing bulk permit cap and retaining foreground capacity.
Validation
The full root-suite PR-ready run reported failures in the three suites above plus unrelated cross-suite state, but each reported suite passed independently afterward. The focused CodeMap suite also passed on the refreshed main base. No implementation scope was added for those unrelated cross-suite failures.
Review
Claude Fable 5 High reviewed the implementation before and after its initial findings were fixed, then reviewed it again after refreshing to current main. Final review found no must-fix or should-fix findings.
Notes