test + project hygiene: EditTool/tool-parameter coverage (24 tests) and clean-checkout build repair - #5
Merged
Merged
Conversation
Adds two focused unit-test files covering previously-untested, high-risk,
deterministic logic:
- EditToolTests (10 tests): exact-string file edits, uniqueness enforcement,
replaceAll, atomic multi-edit, backup creation, changed-line counting, and
the EditError message surface. This is the file-mutation ("edit application")
path, so correctness is data-integrity critical.
- ToolParameterParsingTests (14 tests): BaseTool's parameter extraction and
validation helpers (required/default/type-mismatch) that every tool uses to
coerce untrusted LLM-supplied argument dicts, plus the ToolError surface.
Project repair required to make the target compile from a clean checkout:
- Fixed 5 duplicate object UUIDs in project.pbxproj (test PBXBuildFile entries
collided with app PBXFileReference UUIDs), which made the project fail to
open in both xcodebuild and the xcodeproj gem ("project is damaged").
- Restored SessionManager.swift to the app target (it was orphaned, breaking
compilation of the pre-existing SessionManagerTests/FrameTests).
Verified: xcodebuild test ... -only-testing the two new classes reports
** TEST SUCCEEDED ** with 24/24 passing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrPsErCe9kBuRRPyDSA5cF
- Repoint NovaAPIServer.swift file reference from a dead absolute path (/Volumes/Data/xcode/MLX Code/...) to the repo-relative "MLX Code/Services/NovaAPIServer.swift" (sourceTree = "<group>"), matching sibling Services references. - Remove the resulting duplicate/dangling NovaAPIServer file reference and 4 stale nil build-file entries. - Re-attach 5 orphaned source files to the app target's Sources phase: NovaAPIServer, UndoManager, DiffView, CommandPalette, OnboardingView. - Leave 7 files orphaned that cannot compile against the current codebase (duplicate type declarations / API drift / missing deps): ToolUseProtocol, KeyboardShortcuts, AppLogger, LogViewerView, MLXPythonSettings, MLXPythonToolkitSettings, MLXPythonSettingsView. Full `xcodebuild build` reaches BUILD SUCCEEDED and the EditTool / ToolParameterParsing suites pass (24 tests, 0 failures). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QrPsErCe9kBuRRPyDSA5cF
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
Two related improvements so the project both has meaningful test coverage and builds cleanly from a fresh checkout.
Test coverage
EditToolTests(10 tests) andToolParameterParsingTests(14 tests) — 24 tests total, all passing.Xcode project hygiene (new)
The
.xcodeprojhad non-portable references and orphaned sources that broke fresh clones.NovaAPIServer.swiftwas referenced via a dead absolute path/Volumes/Data/xcode/MLX Code/MLX Code/Services/NovaAPIServer.swift(sourceTree = "<absolute>"). Repointed to the repo-relativeMLX Code/Services/NovaAPIServer.swift(sourceTree = "<group>"), matching sibling Services files. Also removed the resulting duplicate file reference and 4 stale nil build-file entries.NovaAPIServer.swift,UndoManager.swift,DiffView.swift,CommandPalette.swift,OnboardingView.swift.ToolUseProtocol.swift— actor-isolation violation +GitStatus→StringAPI mismatchKeyboardShortcuts.swift— redeclaresChatViewModel.regenerateLastResponse()AppLogger.swift— redefines the globallogInfo/logError/...already provided bySecureLogger.swift, plus actor-isolation errorLogViewerView.swift— depends on the excludedAppLoggertypeMLXPythonSettings.swift— redeclaresenum AppTheme(conflicts withAppSettings.swift)MLXPythonToolkitSettings.swift— drop-in template redeclaringenum MLXPythonStatusMLXPythonSettingsView.swift— depends on the excludedMLXPythonSettingsVerification (from a fresh clone)
xcodebuild build ... -scheme "MLX Code" -destination platform=macOS→ BUILD SUCCEEDEDxcodebuild test(EditToolTests+ToolParameterParsingTests) → TEST SUCCEEDED, 24 tests, 0 failures.🤖 Generated with Claude Code