Skip to content

fix(reprocess): build graph on graph-only installs (macOS Intel)#401

Merged
HumanBean17 merged 1 commit into
masterfrom
bugfix/reprocess-graph-only-intel-mac
Jul 7, 2026
Merged

fix(reprocess): build graph on graph-only installs (macOS Intel)#401
HumanBean17 merged 1 commit into
masterfrom
bugfix/reprocess-graph-only-intel-mac

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

Problem

On Intel Macs (darwin + x86_64), cocoindex[lancedb] / lancedb / sentence-transformers are intentionally gated off by PEP 508 markers in pyproject.toml (torch/lancedb dropped macOS x86_64 wheels), so the install is graph-only by design.

The default java-codebase-rag reprocess went through server.run_refresh_pipeline, which only checked for the cocoindex binary and hard-failed:

{"message": "cocoindex not found next to Python: …/.venv/bin/cocoindex", "success": false, …}
✗ java-codebase-rag reprocess · finished in 1.80s (exit=2)

It never built the graph — inconsistent with init / increment, which already skip vectors and build the graph on graph-only installs.

Fix

run_refresh_pipeline now detects graph-only installs via pipeline.vector_stack_installed() and skips the vectors phase, builds the graph, and returns success with a clear message — mirroring init / increment.

  • Extracted the graph-build block into a shared _run_graph_phase() helper (no duplication between the normal vectors→graph path and the new graph-only path). Normal-path semantics are preserved exactly (phases_run, success, exit-code mapping).
  • Centralized the operator-facing skip line as VECTORS_SKIPPED_GRAPH_ONLY in pipeline.py (single source of truth; cli.py now imports it as an alias).
  • No vectors progress event is emitted on graph-only, so the renderer's vectors task stays invisible (its "never spawned" invariant) rather than hanging at running.

Before → after (Intel Mac)

before after
message cocoindex not found next to Python: … vectors skipped — … (graph-only mode) + reprocess completed (graph-only; …)
graph built ❌ no ✅ yes
exit code 2 0

Verification

  • New regression test test_refresh_pipeline_skips_vectors_and_builds_graph_on_graph_only in tests/test_graph_only_boot.py (the cross-platform graph-only home; the macos-13 CI leg is temporarily disabled, so this in-process coverage is what guards the path on the gate).
  • Patched vector_stack_installed in the existing vectors-path baseline test (test_refresh_pipeline_quiet_stderr_baseline) since it fakes a full install.
  • Ran the user's exact command on this Intel Mac: now builds the graph and exits 0.
  • Full suite: 1112 passed, 0 new failures. The 16 failures observed locally are all pre-existing graph-only/vector-stack-absent tests (Lance/search/tables/increment-Lance-message) — they require lancedb/cocoindex, absent on Intel Mac by design; none touch the code changed here, and they pass on the Ubuntu CI gate where the vector stack is installed.

Out of scope

reprocess --vectors-only still surfaces "cocoindex not found" on graph-only (different sync code path in cli.py). Since --vectors-only is an explicit opt-in where vectors are genuinely impossible, failing there is honest — left as-is here; can extend the clear messaging in a follow-up if desired.

🤖 Generated with Claude Code

server.run_refresh_pipeline (the default `reprocess` path) hard-failed on
graph-only installs — macOS Intel, where cocoindex[lancedb]/lancedb/
sentence-transformers are gated off by PEP 508 markers — with a cryptic
"cocoindex not found next to Python" message and exit 2, never building the
graph. init/increment already skip vectors and build the graph there; reprocess
now does the same, so the Intel Mac experience is consistent across commands.

- Detect graph-only via pipeline.vector_stack_installed(); skip the vectors
  phase, run the graph builder, and return success with a clear message
  (the renderer's vectors task stays invisible — its "never spawned" invariant).
- Extract the graph-build block into _run_graph_phase(), shared by the normal
  vectors->graph path and the new graph-only path (no duplication).
- Centralize the operator-facing skip line as VECTORS_SKIPPED_GRAPH_ONLY in
  pipeline.py — single source for cli.py (init/increment) and server.py
  (reprocess).
- Tests: regression test for graph-only reprocess in test_graph_only_boot.py;
  patch vector_stack_installed in the existing vectors-path baseline test.

Co-Authored-By: Claude <noreply@anthropic.com>
@HumanBean17 HumanBean17 merged commit 8331446 into master Jul 7, 2026
3 checks passed
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