Skip to content

Fix LadybugDB migration issues and JSON parsing#304

Closed
HumanBean17 wants to merge 1 commit into
masterfrom
fix-ladybug-migration-issues
Closed

Fix LadybugDB migration issues and JSON parsing#304
HumanBean17 wants to merge 1 commit into
masterfrom
fix-ladybug-migration-issues

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

Summary

Fix remaining issues from the KuzuDB → LadybugDB migration that were causing CI failures (exit code 139 segfaults) and test failures.

Root Causes Fixed

  1. Segfault (exit code 139): tests/test_ladybug_queries.py still used kuzu.Connection and created .kuzu databases, which crashed when opened with LadybugDB code
  2. JSON parsing failures: LadybugDB returns JSON without quotes around keys ({key: value}), but code used json.loads which expects standard JSON
  3. Incomplete migration: Various references still used old kuzu naming (constants, error messages, CLI arguments)

Changes

Core fixes:

  • Add _parse_ladybug_json helper to handle LadybugDB's non-standard JSON format
  • Update meta() method to use helper for all JSON fields
  • Fix _open_stale_ontology_graph to use ladybug.Connection and .lbug extension
  • Fix fixture names (kuzu_db_path_cross_service_smokeladybug_db_path_cross_service_smoke)
  • Fix helper functions in _builders.py (build_kuzu_tobuild_ladybug_to)

Test updates:

  • Add _parse_ladybug_json to test_ast_graph_build.py
  • Fix constant references (KUZU_INCREMENTAL_TRACKING_ISSUE_URLLADYBUG_INCREMENTAL_TRACKING_ISSUE_URL)
  • Fix assertions for LadybugDB warning messages
  • Fix attribute references (lbug_pathladybug_path)

Documentation/CLI:

  • Update error messages from "Kuzu graph" to "Ladybug graph"
  • Update CLI argument --kuzu-path to --ladybug-path
  • Update verbose logging message

Test Results

  • All 741 tests pass
  • Previously failing tests now pass:
    • test_ladybug_graph_refuses_ontology_version_below_required
    • test_find_route_callers_includes_producer_callers
    • test_find_route_callers_returns_route_caller_client_node
    • test_trace_request_flow_inbound_includes_caller_node_id
    • test_meta
    • test_graph_meta_present_and_versioned
    • test_ladybug_path_derived_as_index_dir_code_graph_kuzu
    • test_increment_emits_kuzu_stale_warning_block
    • test_increment_vectors_only_skips_graph

🤖 Generated with Claude Code

- Fix test file references from kuzu to ladybug (kuzu_db_path_cross_service_smoke → ladybug_db_path_cross_service_smoke)
- Fix stale ontology tests to use ladybug.Connection instead of kuzu.Connection
- Fix database file extension (.kuzu → .lbug)
- Fix helper functions in _builders.py (build_kuzu_to → build_ladybug_to)
- Add _parse_ladybug_json helper to handle LadybugDB's non-standard JSON format (unquoted keys)
- Update meta() method to use _parse_ladybug_json for all JSON fields
- Update error messages and CLI arguments from kuzu to ladybug
- Fix test assertions to use ladybug_path instead of lbug_path
- Fix test constant references (KUZU_INCREMENTAL_TRACKING_ISSUE_URL → LADYBUG_INCREMENTAL_TRACKING_ISSUE_URL)
- Fix test assertions for LadybugDB warning messages
- Add _parse_ladybug_json helper to test_ast_graph_build.py

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

Copy link
Copy Markdown
Owner Author

Closing in favor of #303 — fixes pushed directly to that branch.

@HumanBean17 HumanBean17 closed this Jun 9, 2026
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