feat(platform): macOS Intel support via graph-only mode (PR-MI1..MI4)#382
Merged
Conversation
…-MI1) torch >=2.3 and lancedb >=0.26 dropped macOS x86_64 wheels, so the full vector stack is uninstallable on Intel Mac. Gate cocoindex[lancedb], lancedb, and sentence-transformers behind `sys_platform != 'darwin' or platform_machine != 'x86_64'` so `pip install java-codebase-rag` resolves graph-only there. Apple Silicon / Linux / Windows are unchanged (every other dep ships an Intel wheel or is pure-Python). Co-Authored-By: Claude <noreply@anthropic.com>
The MCP server eagerly imported lancedb/torch (via search_lancedb and sentence_transformers) at module load, so it could not start on a graph-only install. Make those imports optional: - mcp_v2: SentenceTransformer imported lazily in _get_sentence_transformer (TYPE_CHECKING guard); search_lancedb via a guarded module-level try/except so mcp_v2.run_search/TABLES stay as attributes (tests monkeypatch them) and become None sentinels when the stack is absent; search_v2 returns a clean SearchOutput(success=False, "vector search unavailable") on graph-only. - server: TABLES imported lazily in list_code_index_tables_payload() (CLI-only) with an empty-tables fallback. - pipeline: centralize is_cocoindex_preflight_blocker / is_graph_preflight_blocker next to the stub CompletedProcess shapes they match (fixes the prior "must stay aligned" duplication hazard); cli/installer consume them in PR-MI3. The 4 graph tools (find/describe/neighbors/resolve) and ScopeManager keep working; only `search` degrades. No tool signatures change. Co-Authored-By: Claude <noreply@anthropic.com>
…all (PR-MI3) init/increment/install/update previously hard-failed when cocoindex was absent (the graph-only reality on macOS Intel). Treat a cocoindex preflight blocker (returncode 126/127 stub from pipeline) as "skip the vectors phase, proceed to the graph build" rather than failure — mirroring the existing erase lancedb guard and reprocess --graph-only patterns. A genuine non-zero cocoindex exit still fails. Graph-only installs now build/refresh the graph and exit 0. Co-Authored-By: Claude <noreply@anthropic.com>
… (PR-MI4) - tests: importorskip the two files that import the vector stack at module scope (test_search_lancedb, test_search_lancedb_capability) so they skip cleanly instead of erroring at collection on a graph-only runner; @needs_vectors skipif on the 10 search tests in test_mcp_v2 that load the SentenceTransformer model. Graph tests run unconditionally. - CI: add macos-13 (Intel x86_64) to the OS matrix (continue-on-error, like the other non-ubuntu legs) so the graph-only install/boot path is exercised on real Intel hardware; skip the HuggingFace cache step there. - README: correct the false "every native dependency ships a wheel" claim — document Intel Mac graph-only mode (auto via PEP 508 markers); replace the dead `pip install -r requirements.txt` with the editable install. Co-Authored-By: Claude <noreply@anthropic.com>
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
java-codebase-ragwas uninstallable on Intel Mac by accident of its dependency tree: torch ≥2.3 and lancedb ≥0.26 dropped macOS x86_64 wheels (the former permanently). cocoindex, ladybug/kuzu, pyarrow, numpy all still ship Intel wheels — so the graph layer works; only vector/semantic search is unavailable.This PR makes Intel Mac install graph-only automatically —
pip install java-codebase-ragjust works, the graph layer (find/describe/neighbors/resolve) is fully usable, and thesearchtool reports it is unavailable rather than failing. Apple Silicon, Linux, and Windows are unchanged (full semantic + graph search).Mechanism: PEP 508 environment markers (
sys_platform != 'darwin' or platform_machine != 'x86_64') exclude the vector trio only on Intel Mac — non-breaking for every other platform.This is not purely a deps change:
server.py/mcp_v2.pyeagerly imported the vector stack at module load, andinithard-failed when cocoindex was absent — so small refactors were needed so the graph-only install actually boots and builds.Commits (PR-MI1..MI4)
pyproject.toml— PEP 508 markers gatecocoindex[lancedb],lancedb,sentence-transformers.mcp_v2.py/server.py/pipeline.py— lazy/optional vector imports so the MCP server boots graph-only;searchdegrades cleanly. Centralized the preflight-blocker detector inpipeline.py.cli.py/installer.py—init/increment/install/updatetreat a cocoindex preflight blocker as skip-vectors-and-build-graph instead of failure (mirrors the existingerase/reprocess --graph-onlydegrade patterns).importorskip/@needs_vectorsguards;macos-13(Intel) added to the CI matrix; README corrected.Verification
searchreturns the unavailable envelope. CLI--helprenders. Collection: 1075 tests, 0 errors.test_mcp_v2: 96 passed, 11 skipped (search tests skip cleanly).test_mcp_v2106 passed; full suite 1065 passed, 15 skipped, no regressions.Out of scope / follow-ups
test_lancedb_ignore_file_reduces_indexed_java_filesfails locally because a.java-codebase-ragdir is committed insidetests/fixtures/lancedb_ignore_smoke/(AGENTS.md says never commit those). It's skipped in CI (HEAVY=0) and unrelated to this change. Worth a separate cleanup PR.🤖 Generated with Claude Code