Skip to content

fix(core): treat LadybugDB as available only when its native engine loads (#1731) - #1737

Open
Shashankss1205 wants to merge 3 commits into
mainfrom
fix-1731-ladybug-native-probe
Open

Shashankss1205 wants to merge 3 commits into
mainfrom
fix-1731-ladybug-native-probe

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

Fixes #1731.

Problem

LadybugDB availability was checked with find_spec("ladybug"). On Windows the ladybug wheel installs but ships neither the pybind extension nor the lbug C-API shared library, so the package imports and the first Database() dies with "Could not find lbug C API shared library".

That kept test (windows-latest) permanently red on every PR. It also means a real Windows user with ladybug installed could be routed to it (explicit selection or fallback) and fail at first use with an opaque error.

Fix

  • core.ladybugdb_unavailable_reason() (cached) returns None when the engine can run. It tries the pybind extension first, then the C-API library, and otherwise returns the concrete reason. _is_ladybugdb_available() now delegates to it.
  • If ladybugdb is selected explicitly and the engine can't load, the error now names the real reason and suggests another backend, instead of saying "not installed".
  • cgc doctor prints the same reason.
  • The parity e2e test skips the ladybug leg, printing the reason, when the engine can't load. Linux and macOS still run all four backends, so the bug(ladybugdb): intermittent ~51 File-[:CONTAINS] edge deficit in the parity fixture #1730 signal is unaffected.

Tests

  • New tests/unit/core/test_ladybug_native_probe.py covers five cases: missing engine, pybind-only, C-API-only, not installed, and the explicit-selection message.
  • tests/unit/core + tests/unit/cli: 484 passed.
  • On Linux the real probe reports ladybug as available.

🤖 Generated with Claude Code

…oads (#1731)

Availability was `find_spec("ladybug")`, but some ladybug wheels (Windows)
ship neither the pybind extension nor the lbug C-API shared library. The
package imports, then the first Database() dies with "Could not find lbug C
API shared library" — which kept `test (windows-latest)` permanently red and
would let fallback/explicit selection land users on a dead backend.

- core: `ladybugdb_unavailable_reason()` (cached) probes pybind, then C-API;
  `_is_ladybugdb_available()` uses it; explicit selection names the reason.
- cli doctor reports the real reason instead of "installed".
- parity e2e skips ladybug with the reason when the engine can't load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
code-graph-context-pack Ready Ready Preview Sep 27, 2026 11:07am UTC

@github-actions

Copy link
Copy Markdown
Contributor

Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Code Graph Analysis

fix(core): treat LadybugDB as available only when its native engine loads (#1731) (#1737)

📊 Interactive Visualization

View the blast radius graph: PR Reviewer Dashboard

📦 Artifacts

The graph JSON has been uploaded as a build artifact: pr-code-graph-1737


Generated by CodeGraphContext using FalkorDB Lite

Next layer of #1731 on Windows: the falkordb client imports, Lite does not
run, and the leg fell back to an absent Neo4j.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…obe reason

ladybug swallows the pybind ImportError and falls back to the C-API lib, so
'Could not find lbug C API shared library' hid the real Windows cause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 82092042 Deployed Sep 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog tasks

Development

Successfully merging this pull request may close these issues.

ci: test (windows-latest) is permanently red on main — ladybug C-API shared lib unavailable on Windows runners

1 participant