Skip to content

test + project hygiene: EditTool/tool-parameter coverage (24 tests) and clean-checkout build repair - #5

Merged
kochj23 merged 2 commits into
mainfrom
test/coverage-improvements
Aug 18, 2026
Merged

test + project hygiene: EditTool/tool-parameter coverage (24 tests) and clean-checkout build repair#5
kochj23 merged 2 commits into
mainfrom
test/coverage-improvements

Conversation

@kochj23

@kochj23 kochj23 commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

Two related improvements so the project both has meaningful test coverage and builds cleanly from a fresh checkout.

Test coverage

  • EditToolTests (10 tests) and ToolParameterParsingTests (14 tests) — 24 tests total, all passing.

Xcode project hygiene (new)

The .xcodeproj had non-portable references and orphaned sources that broke fresh clones.

  • Non-portable reference fixed: NovaAPIServer.swift was referenced via a dead absolute path /Volumes/Data/xcode/MLX Code/MLX Code/Services/NovaAPIServer.swift (sourceTree = "<absolute>"). Repointed to the repo-relative MLX Code/Services/NovaAPIServer.swift (sourceTree = "<group>"), matching sibling Services files. Also removed the resulting duplicate file reference and 4 stale nil build-file entries.
  • Orphaned sources re-attached to the app target (present on disk, missing from the Sources phase): NovaAPIServer.swift, UndoManager.swift, DiffView.swift, CommandPalette.swift, OnboardingView.swift.
  • Left orphaned on purpose — these do not compile against the current codebase (duplicate type declarations, API drift, or dependency on an excluded file), so re-adding them would break the build:
    • ToolUseProtocol.swift — actor-isolation violation + GitStatusString API mismatch
    • KeyboardShortcuts.swift — redeclares ChatViewModel.regenerateLastResponse()
    • AppLogger.swift — redefines the global logInfo/logError/... already provided by SecureLogger.swift, plus actor-isolation error
    • LogViewerView.swift — depends on the excluded AppLogger type
    • MLXPythonSettings.swift — redeclares enum AppTheme (conflicts with AppSettings.swift)
    • MLXPythonToolkitSettings.swift — drop-in template redeclaring enum MLXPythonStatus
    • MLXPythonSettingsView.swift — depends on the excluded MLXPythonSettings

Verification (from a fresh clone)

  • xcodebuild build ... -scheme "MLX Code" -destination platform=macOSBUILD SUCCEEDED
  • xcodebuild test (EditToolTests + ToolParameterParsingTests) → TEST SUCCEEDED, 24 tests, 0 failures.

🤖 Generated with Claude Code

kochj23 and others added 2 commits August 18, 2026 14:53
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
@kochj23 kochj23 changed the title test: EditTool + tool-parameter parsing coverage (24 tests) test + project hygiene: EditTool/tool-parameter coverage (24 tests) and clean-checkout build repair Aug 18, 2026
@kochj23
kochj23 merged commit 51fab7e into main Aug 18, 2026
1 check passed
@kochj23
kochj23 deleted the test/coverage-improvements branch August 18, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant