codegraphcontext-rust 0.9.21__tar.gz → 0.9.23__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/PKG-INFO +24 -19
  2. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/pyproject.toml +21 -9
  3. codegraphcontext_rust-0.9.23/src/codegraphcontext/cli/entry.py +21 -0
  4. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/persistence/duckdb_writer.py +115 -63
  5. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/rationale_extraction.py +11 -3
  6. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/LICENSE +0 -0
  7. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/README.md +0 -0
  8. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/Cargo.lock +0 -0
  9. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/Cargo.toml +0 -0
  10. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/Cargo.toml +0 -0
  11. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/c_lang.rs +0 -0
  12. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/cpp.rs +0 -0
  13. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/csharp.rs +0 -0
  14. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/dart.rs +0 -0
  15. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/elixir.rs +0 -0
  16. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/go.rs +0 -0
  17. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/haskell.rs +0 -0
  18. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/java.rs +0 -0
  19. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/javascript.rs +0 -0
  20. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/kotlin.rs +0 -0
  21. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/mod.rs +0 -0
  22. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/perl.rs +0 -0
  23. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/php.rs +0 -0
  24. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/python.rs +0 -0
  25. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/ruby.rs +0 -0
  26. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/rust_lang.rs +0 -0
  27. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/scala.rs +0 -0
  28. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/swift.rs +0 -0
  29. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/ts_common.rs +0 -0
  30. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/tsx.rs +0 -0
  31. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lang/typescript.rs +0 -0
  32. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/lib.rs +0 -0
  33. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/parser.rs +0 -0
  34. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/resolution/calls.rs +0 -0
  35. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/resolution/inheritance.rs +0 -0
  36. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/resolution/mod.rs +0 -0
  37. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/sanitize.rs +0 -0
  38. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-core/src/types.rs +0 -0
  39. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-python/Cargo.toml +0 -0
  40. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-python/src/conversions.rs +0 -0
  41. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/cgc-python/src/lib.rs +0 -0
  42. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/Cargo.toml +0 -0
  43. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/build.rs +0 -0
  44. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/src/grammar/alloc.h +0 -0
  45. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/src/grammar/array.h +0 -0
  46. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/src/grammar/parser.c +0 -0
  47. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/src/grammar/parser.h +0 -0
  48. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/src/grammar/scanner.c +0 -0
  49. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/src/grammar/tree_sitter/parser.h +0 -0
  50. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/rust/tree-sitter-perl-vendor/src/lib.rs +0 -0
  51. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/__init__.py +0 -0
  52. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/__main__.py +0 -0
  53. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/cli/__init__.py +0 -0
  54. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/cli/cli_helpers.py +0 -0
  55. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/cli/config_manager.py +0 -0
  56. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/cli/main.py +0 -0
  57. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/cli/registry_commands.py +0 -0
  58. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/cli/setup_macos.py +0 -0
  59. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/cli/setup_wizard.py +0 -0
  60. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/cli/visualizer.py +0 -0
  61. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/__init__.py +0 -0
  62. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/bundle_registry.py +0 -0
  63. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/cgc_bundle.py +0 -0
  64. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/cgcignore.py +0 -0
  65. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/database.py +0 -0
  66. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/database_falkordb.py +0 -0
  67. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
  68. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/database_kuzu.py +0 -0
  69. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/falkor_worker.py +0 -0
  70. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/jobs.py +0 -0
  71. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/core/watcher.py +0 -0
  72. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/prompts.py +0 -0
  73. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/server.py +0 -0
  74. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tool_definitions.py +0 -0
  75. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/__init__.py +0 -0
  76. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
  77. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/code_finder.py +0 -0
  78. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/graph_builder.py +0 -0
  79. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/handlers/analysis_handlers.py +0 -0
  80. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
  81. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
  82. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
  83. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
  84. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
  85. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/angular_routes.py +0 -0
  86. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/cgc_wiki_cli.py +0 -0
  87. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/constants.py +0 -0
  88. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/context_generator.py +0 -0
  89. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
  90. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/engine.py +0 -0
  91. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/execution_flows.py +0 -0
  92. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/module_grouping.py +0 -0
  93. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/noise_filter.py +0 -0
  94. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/op_param_extraction.py +0 -0
  95. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
  96. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/persistence/parquet_loader.py +0 -0
  97. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/persistence/writer.py +0 -0
  98. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/pipeline.py +0 -0
  99. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
  100. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
  101. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/resolution/calls.py +0 -0
  102. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +0 -0
  103. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/route_extraction.py +0 -0
  104. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
  105. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/schema.py +0 -0
  106. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
  107. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/indexing/scip_pipeline.py +0 -0
  108. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/c.py +0 -0
  109. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/cpp.py +0 -0
  110. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/csharp.py +0 -0
  111. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/dart.py +0 -0
  112. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/elixir.py +0 -0
  113. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/go.py +0 -0
  114. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/haskell.py +0 -0
  115. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/java.py +0 -0
  116. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/javascript.py +0 -0
  117. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
  118. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/perl.py +0 -0
  119. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/php.py +0 -0
  120. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/python.py +0 -0
  121. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/ruby.py +0 -0
  122. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/rust.py +0 -0
  123. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/scala.py +0 -0
  124. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/swift.py +0 -0
  125. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/typescript.py +0 -0
  126. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
  127. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/package_resolver.py +0 -0
  128. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
  129. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
  130. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
  131. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
  132. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
  133. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
  134. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
  135. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
  136. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
  137. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
  138. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
  139. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
  140. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
  141. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
  142. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
  143. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/scip_indexer.py +0 -0
  144. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/scip_pb2.py +0 -0
  145. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/system.py +0 -0
  146. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
  147. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/utils/debug_log.py +0 -0
  148. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/utils/path_ignore.py +0 -0
  149. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/utils/repo_path.py +0 -0
  150. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
  151. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/utils/visualize_graph.py +0 -0
  152. {codegraphcontext_rust-0.9.21 → codegraphcontext_rust-0.9.23}/src/codegraphcontext/viz/server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codegraphcontext-rust
3
- Version: 0.9.21
3
+ Version: 0.9.23
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.10
6
6
  Classifier: Programming Language :: Python :: 3.11
@@ -12,33 +12,38 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
15
- Requires-Dist: neo4j>=5.15.0
16
- Requires-Dist: watchdog>=3.0.0
17
- Requires-Dist: stdlibs>=2023.11.18
18
- Requires-Dist: typer[all]>=0.9.0
15
+ Requires-Dist: duckdb>=1.0
16
+ Requires-Dist: pathspec>=0.12.1
19
17
  Requires-Dist: rich>=13.7.0
20
- Requires-Dist: inquirerpy>=0.3.4
21
- Requires-Dist: python-dotenv>=1.0.0
22
- Requires-Dist: tree-sitter>=0.21.0
23
- Requires-Dist: tree-sitter-language-pack>=0.6.0
24
- Requires-Dist: tree-sitter-c-sharp>=0.21.0
25
18
  Requires-Dist: pyyaml
26
- Requires-Dist: nbformat
27
- Requires-Dist: nbconvert>=7.16.6
28
- Requires-Dist: pathspec>=0.12.1
29
- Requires-Dist: falkordb>=0.1.0
30
- Requires-Dist: requests>=2.28.0
31
- Requires-Dist: falkordblite>=0.1.0 ; python_full_version >= '3.12' and sys_platform != 'win32'
32
- Requires-Dist: kuzu>=0.4.0 ; (python_full_version < '3.10' and sys_platform == 'win32') or (python_full_version >= '3.12' and sys_platform == 'win32') or (python_full_version >= '3.10' and python_full_version < '3.12')
33
- Requires-Dist: fastapi>=0.100.0
34
- Requires-Dist: uvicorn>=0.22.0
35
19
  Requires-Dist: pytest>=7.4.0 ; extra == 'dev'
36
20
  Requires-Dist: black>=23.11.0 ; extra == 'dev'
37
21
  Requires-Dist: pytest-asyncio>=0.21.0 ; extra == 'dev'
22
+ Requires-Dist: pyarrow>=14.0 ; extra == 'fast'
23
+ Requires-Dist: neo4j>=5.15.0 ; extra == 'full'
24
+ Requires-Dist: watchdog>=3.0.0 ; extra == 'full'
25
+ Requires-Dist: stdlibs>=2023.11.18 ; extra == 'full'
26
+ Requires-Dist: typer[all]>=0.9.0 ; extra == 'full'
27
+ Requires-Dist: inquirerpy>=0.3.4 ; extra == 'full'
28
+ Requires-Dist: python-dotenv>=1.0.0 ; extra == 'full'
29
+ Requires-Dist: tree-sitter>=0.21.0 ; extra == 'full'
30
+ Requires-Dist: tree-sitter-language-pack>=0.6.0 ; extra == 'full'
31
+ Requires-Dist: tree-sitter-c-sharp>=0.21.0 ; extra == 'full'
32
+ Requires-Dist: nbformat ; extra == 'full'
33
+ Requires-Dist: nbconvert>=7.16.6 ; extra == 'full'
34
+ Requires-Dist: falkordb>=0.1.0 ; extra == 'full'
35
+ Requires-Dist: requests>=2.28.0 ; extra == 'full'
36
+ Requires-Dist: falkordblite>=0.1.0 ; python_full_version >= '3.12' and sys_platform != 'win32' and extra == 'full'
37
+ Requires-Dist: kuzu>=0.4.0 ; (python_full_version < '3.10' and sys_platform == 'win32' and extra == 'full') or (python_full_version >= '3.12' and sys_platform == 'win32' and extra == 'full') or (python_full_version >= '3.10' and python_full_version < '3.12' and extra == 'full')
38
+ Requires-Dist: fastapi>=0.100.0 ; extra == 'full'
39
+ Requires-Dist: uvicorn>=0.22.0 ; extra == 'full'
40
+ Requires-Dist: pyarrow>=14.0 ; extra == 'full'
38
41
  Requires-Dist: tree-sitter>=0.21.0 ; extra == 'parsing'
39
42
  Requires-Dist: tree-sitter-language-pack>=0.6.0 ; extra == 'parsing'
40
43
  Requires-Dist: tree-sitter-c-sharp>=0.21.0 ; extra == 'parsing'
41
44
  Provides-Extra: dev
45
+ Provides-Extra: fast
46
+ Provides-Extra: full
42
47
  Provides-Extra: parsing
43
48
  License-File: LICENSE
44
49
  Summary: Rust-accelerated code indexing engine for CodeGraphContext. 19 languages, 5-18x faster parsing via tree-sitter + rayon.
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "codegraphcontext-rust"
7
- version = "0.9.21"
7
+ version = "0.9.23"
8
8
  description = "Rust-accelerated code indexing engine for CodeGraphContext. 19 languages, 5-18x faster parsing via tree-sitter + rayon."
9
9
  authors = [
10
10
  { name = "Shashank Shekhar Singh", email = "shashankshekharsingh1205@gmail.com" },
@@ -26,30 +26,42 @@ classifiers = [
26
26
  "Intended Audience :: Developers",
27
27
  "Topic :: Software Development :: Libraries :: Application Frameworks",
28
28
  ]
29
+ # Core: what the Rust engine + DuckDB pipeline (cgc-wiki index, wiki-forge)
30
+ # imports. The rest of the original CodeGraphContext stack (cgc CLI, MCP
31
+ # server, Neo4j/FalkorDB/Kuzu backends, watchers) is in the `full` extra.
29
32
  dependencies = [
33
+ "duckdb>=1.0",
34
+ "pathspec>=0.12.1",
35
+ "rich>=13.7.0",
36
+ "pyyaml",
37
+ ]
38
+
39
+ [project.optional-dependencies]
40
+ # Faster bulk loads (Parquet/Arrow staging instead of CSV). Output is identical.
41
+ fast = ["pyarrow>=14.0"]
42
+ # Original CodeGraphContext features: `cgc` CLI, MCP server, graph-DB backends.
43
+ # pip install "codegraphcontext-rust[full]"
44
+ full = [
30
45
  "neo4j>=5.15.0",
31
46
  "watchdog>=3.0.0",
32
47
  "stdlibs>=2023.11.18",
33
48
  "typer[all]>=0.9.0",
34
- "rich>=13.7.0",
35
49
  "inquirerpy>=0.3.4",
36
50
  "python-dotenv>=1.0.0",
37
51
  "tree-sitter>=0.21.0",
38
52
  "tree-sitter-language-pack>=0.6.0",
39
53
  "tree-sitter-c-sharp>=0.21.0",
40
- "pyyaml",
41
54
  "nbformat",
42
55
  "nbconvert>=7.16.6",
43
- "pathspec>=0.12.1",
44
56
  "falkordb>=0.1.0",
45
57
  "requests>=2.28.0",
46
58
  "falkordblite>=0.1.0; sys_platform != 'win32' and python_version >= '3.12'",
47
59
  "kuzu>=0.4.0; sys_platform == 'win32' or (sys_platform != 'win32' and python_version >= '3.10' and python_version < '3.12')",
48
60
  "fastapi>=0.100.0",
49
- "uvicorn>=0.22.0"
61
+ "uvicorn>=0.22.0",
62
+ # Parquet bulk loader of the Kuzu backend (tools/indexing/persistence/parquet_loader.py)
63
+ "pyarrow>=14.0",
50
64
  ]
51
-
52
- [project.optional-dependencies]
53
65
  parsing = [
54
66
  "tree-sitter>=0.21.0",
55
67
  "tree-sitter-language-pack>=0.6.0",
@@ -68,8 +80,8 @@ dev = [
68
80
  "Upstream" = "https://github.com/CodeGraphContext/CodeGraphContext"
69
81
 
70
82
  [project.scripts]
71
- cgc = "codegraphcontext.cli.main:app"
72
- codegraphcontext = "codegraphcontext.cli.main:app"
83
+ cgc = "codegraphcontext.cli.entry:main"
84
+ codegraphcontext = "codegraphcontext.cli.entry:main"
73
85
  cgc-wiki = "codegraphcontext.tools.indexing.cgc_wiki_cli:main"
74
86
 
75
87
  [tool.maturin]
@@ -0,0 +1,21 @@
1
+ """Entry point for the `cgc` / `codegraphcontext` commands.
2
+
3
+ The original CodeGraphContext CLI (typer, graph-DB backends, MCP server) is an
4
+ optional extra; give a clear hint instead of a bare ModuleNotFoundError when it
5
+ isn't installed. `cgc-wiki` works with the core install.
6
+ """
7
+
8
+ import sys
9
+
10
+
11
+ def main() -> None:
12
+ try:
13
+ from codegraphcontext.cli.main import app
14
+ except ModuleNotFoundError as exc:
15
+ sys.stderr.write(
16
+ f"The `cgc` CLI needs optional dependencies ({exc.name} is missing).\n"
17
+ 'Install them with: pip install "codegraphcontext-rust[full]"\n'
18
+ "Code indexing for wiki-forge only needs `cgc-wiki`, which works without them.\n"
19
+ )
20
+ sys.exit(1)
21
+ app()
@@ -177,8 +177,6 @@ class DuckDBGraphWriter:
177
177
 
178
178
  Returns dict of counts: {files, functions, classes, variables, calls, ...}
179
179
  """
180
- import pyarrow as pa
181
- import pyarrow.parquet as pq
182
180
 
183
181
  repo_path_obj = Path(repo_path).resolve()
184
182
  total = len(parsed_results)
@@ -382,78 +380,78 @@ class DuckDBGraphWriter:
382
380
  inh_cn.append(child_name); inh_pn.append(parent_name)
383
381
  inh_cp.append(child_path); inh_pp.append(parent_path)
384
382
 
385
- # ── Write Parquet ────────────────────────────────────────────
383
+ # ── Stage tables for bulk load (Parquet via pyarrow if installed, else CSV)
386
384
  _t_pq = time.perf_counter()
387
385
  pq_dir = tempfile.mkdtemp(prefix="cgc_pq_")
388
386
 
389
- pq.write_table(pa.table({
387
+ _stage({
390
388
  "path": f_path, "name": f_name, "relative_path": f_rel, "is_dependency": f_dep,
391
- }), f"{pq_dir}/files.parquet")
389
+ }, f"{pq_dir}/files")
392
390
 
393
391
  if dir_set:
394
392
  d_paths = list(dir_set.keys())
395
393
  d_names = [dir_set[p][0] for p in d_paths]
396
394
  d_parents = [dir_set[p][1] for p in d_paths]
397
- pq.write_table(pa.table({
395
+ _stage({
398
396
  "path": d_paths, "name": d_names, "parent_path": d_parents,
399
- }), f"{pq_dir}/directories.parquet")
397
+ }, f"{pq_dir}/directories")
400
398
 
401
- pq.write_table(pa.table({
399
+ _stage({
402
400
  "uid": fn_uid, "name": fn_name, "path": fn_path, "line_number": fn_line,
403
401
  "complexity": fn_cx, "return_type": fn_rt, "docstring": fn_doc,
404
402
  "class_context": fn_cc, "is_async": fn_async,
405
403
  "body_start_line": fn_bstart, "body_end_line": fn_bend,
406
404
  "decorators": fn_dec,
407
- }), f"{pq_dir}/functions.parquet")
405
+ }, f"{pq_dir}/functions")
408
406
 
409
- pq.write_table(pa.table({
407
+ _stage({
410
408
  "uid": cl_uid, "name": cl_name, "path": cl_path,
411
409
  "line_number": cl_line, "docstring": cl_doc, "bases": cl_bases,
412
410
  "decorators": cl_dec, "kind": cl_kind,
413
- }), f"{pq_dir}/classes.parquet")
411
+ }, f"{pq_dir}/classes")
414
412
 
415
- pq.write_table(pa.table({
413
+ _stage({
416
414
  "uid": v_uid, "name": v_name, "path": v_path,
417
415
  "line_number": v_line, "type": v_type,
418
- }), f"{pq_dir}/variables.parquet")
416
+ }, f"{pq_dir}/variables")
419
417
 
420
418
  if p_uid:
421
- pq.write_table(pa.table({
419
+ _stage({
422
420
  "uid": p_uid, "name": p_name, "path": p_path,
423
421
  "function_uid": p_func_uid, "function_line_number": p_func_line,
424
- }), f"{pq_dir}/parameters.parquet")
422
+ }, f"{pq_dir}/parameters")
425
423
 
426
- pq.write_table(pa.table({
424
+ _stage({
427
425
  "file_path": im_fp, "module_name": im_mod, "imported_name": im_name,
428
426
  "alias": im_alias, "full_import_name": im_full, "line_number": im_line,
429
- }), f"{pq_dir}/imports.parquet")
427
+ }, f"{pq_dir}/imports")
430
428
 
431
- pq.write_table(pa.table({
429
+ _stage({
432
430
  "file_path": fc_fp, "symbol_uid": fc_uid, "symbol_type": fc_type,
433
- }), f"{pq_dir}/file_contains.parquet")
431
+ }, f"{pq_dir}/file_contains")
434
432
 
435
- pq.write_table(pa.table({
433
+ _stage({
436
434
  "caller_uid": c_caller, "called_uid": c_called,
437
435
  "caller_type": c_ct, "called_type": c_cdt,
438
436
  "caller_name": c_cn, "called_name": c_dn,
439
437
  "caller_path": c_cp, "called_path": c_dp,
440
438
  "line_number": c_ln, "full_call_name": c_fcn,
441
439
  "confidence": c_conf,
442
- "resolution_tier": pa.array(c_tier, type=pa.int32()),
440
+ "resolution_tier": c_tier,
443
441
  "receiver_type": c_recv,
444
- }), f"{pq_dir}/calls.parquet")
442
+ }, f"{pq_dir}/calls")
445
443
 
446
444
  if inh_child:
447
- pq.write_table(pa.table({
445
+ _stage({
448
446
  "child_uid": inh_child, "parent_uid": inh_parent,
449
447
  "child_name": inh_cn, "parent_name": inh_pn,
450
448
  "child_path": inh_cp, "parent_path": inh_pp,
451
- }), f"{pq_dir}/inheritance.parquet")
449
+ }, f"{pq_dir}/inheritance")
452
450
 
453
451
  if on_progress:
454
452
  on_progress(total * 2 // 3, total, "Loading into DuckDB...")
455
453
 
456
- logger.info(" [timing] parquet_write: %.1fs", time.perf_counter() - _t_pq)
454
+ logger.info(" [timing] stage_write: %.1fs", time.perf_counter() - _t_pq)
457
455
 
458
456
  # ── DROP + COPY FROM ─────────────────────────────────────────
459
457
  _t_db = time.perf_counter()
@@ -472,28 +470,28 @@ class DuckDBGraphWriter:
472
470
  [str(repo_path_obj), repo_path_obj.name])
473
471
 
474
472
  # Bulk load from Parquet
475
- c.execute(f"INSERT INTO files SELECT * FROM read_parquet('{pq_dir}/files.parquet')")
473
+ _load(c, "files", f"{pq_dir}/files")
476
474
 
477
- if os.path.exists(f"{pq_dir}/directories.parquet"):
478
- c.execute(f"INSERT INTO directories SELECT * FROM read_parquet('{pq_dir}/directories.parquet')")
475
+ if _staged(f"{pq_dir}/directories"):
476
+ _load(c, "directories", f"{pq_dir}/directories")
479
477
 
480
- c.execute(f"INSERT INTO functions SELECT * FROM read_parquet('{pq_dir}/functions.parquet')")
481
- c.execute(f"INSERT INTO classes SELECT * FROM read_parquet('{pq_dir}/classes.parquet')")
482
- c.execute(f"INSERT INTO variables SELECT * FROM read_parquet('{pq_dir}/variables.parquet')")
478
+ _load(c, "functions", f"{pq_dir}/functions")
479
+ _load(c, "classes", f"{pq_dir}/classes")
480
+ _load(c, "variables", f"{pq_dir}/variables")
483
481
 
484
- if os.path.exists(f"{pq_dir}/parameters.parquet"):
485
- c.execute(f"INSERT INTO parameters SELECT * FROM read_parquet('{pq_dir}/parameters.parquet')")
482
+ if _staged(f"{pq_dir}/parameters"):
483
+ _load(c, "parameters", f"{pq_dir}/parameters")
486
484
 
487
485
  # Modules (deduplicated)
488
486
  if mod_set:
489
487
  _insert_rows(c, "modules", [(m,) for m in mod_set])
490
488
 
491
- c.execute(f"INSERT INTO imports SELECT * FROM read_parquet('{pq_dir}/imports.parquet')")
492
- c.execute(f"INSERT INTO file_contains SELECT * FROM read_parquet('{pq_dir}/file_contains.parquet')")
493
- c.execute(f"INSERT INTO calls SELECT * FROM read_parquet('{pq_dir}/calls.parquet')")
489
+ _load(c, "imports", f"{pq_dir}/imports")
490
+ _load(c, "file_contains", f"{pq_dir}/file_contains")
491
+ _load(c, "calls", f"{pq_dir}/calls")
494
492
 
495
- if os.path.exists(f"{pq_dir}/inheritance.parquet"):
496
- c.execute(f"INSERT INTO inheritance SELECT * FROM read_parquet('{pq_dir}/inheritance.parquet')")
493
+ if _staged(f"{pq_dir}/inheritance"):
494
+ _load(c, "inheritance", f"{pq_dir}/inheritance")
497
495
 
498
496
  if inj_rows:
499
497
  _insert_rows(c, "injections", _resolve_injection_targets(inj_rows, cl_name, cl_path),
@@ -508,20 +506,12 @@ class DuckDBGraphWriter:
508
506
  return str(Path(p).relative_to(repo_path_obj)) if p else ""
509
507
  except ValueError:
510
508
  return p
511
- # Bulk load via Arrow: executemany is ~1 row per call in DuckDB
512
- # and tens of thousands of rows are normal here.
513
- unresolved_tbl = pa.table({
514
- "caller_name": [u.get("caller_name") or "" for u in unresolved],
515
- "caller_path": [_rel_path(u.get("caller_file_path", "")) for u in unresolved],
516
- "line_number": pa.array([u.get("line_number", 0) for u in unresolved], type=pa.int32()),
517
- "called_name": [u.get("called_name", "") for u in unresolved],
518
- "full_call_name": [(u.get("full_call_name") or "")[:300] for u in unresolved],
519
- "receiver_type": [u.get("receiver_type") or "" for u in unresolved],
520
- "reason": [u.get("reason", "") for u in unresolved],
521
- })
522
- c.register("_unresolved_tbl", unresolved_tbl)
523
- c.execute("INSERT INTO unresolved_calls SELECT * FROM _unresolved_tbl")
524
- c.unregister("_unresolved_tbl")
509
+ _insert_rows(c, "unresolved_calls", [
510
+ (u.get("caller_name") or "", _rel_path(u.get("caller_file_path", "")),
511
+ u.get("line_number", 0), u.get("called_name", ""),
512
+ (u.get("full_call_name") or "")[:300], u.get("receiver_type") or "", u.get("reason", ""))
513
+ for u in unresolved
514
+ ])
525
515
 
526
516
  # Indexes for query performance
527
517
  c.execute("CREATE INDEX IF NOT EXISTS idx_fn_name ON functions(name)")
@@ -663,7 +653,7 @@ class DuckDBGraphWriter:
663
653
  except Exception as exc:
664
654
  logger.debug("Inheritance post-process failed: %s", exc)
665
655
 
666
- # Cleanup temp parquet
656
+ # Cleanup staged files
667
657
  import shutil
668
658
  shutil.rmtree(pq_dir, ignore_errors=True)
669
659
 
@@ -1043,22 +1033,84 @@ def _write_orm(c, orm_rows) -> None:
1043
1033
  _insert_rows(c, "db_access", list(dict.fromkeys(access)))
1044
1034
 
1045
1035
 
1036
+ # Bulk-load staging. pyarrow is optional:
1037
+ # - installed (wiki-forge declares it; extra `fast`): Parquet + read_parquet
1038
+ # / registered Arrow tables, the fastest path (C++ conversion);
1039
+ # - not installed (core install, e.g. slim Docker images): quoted CSV +
1040
+ # COPY into the declared column types. Identical table contents, ~3-4x
1041
+ # slower staging (≈0.3 s on a 1.5k-file repo).
1042
+ # Every CSV field is quoted, NULL is a sentinel no real value uses, and COPY
1043
+ # doesn't sniff types, so values round-trip exactly ('' stays '', "007"
1044
+ # stays a string, newlines/quotes survive).
1045
+ try:
1046
+ import pyarrow as _pa
1047
+ import pyarrow.parquet as _pq
1048
+ except ImportError: # core install without the `fast` extra
1049
+ _pa = _pq = None
1050
+
1051
+ _CSV_NULL = "__CGC_NULL__"
1052
+
1053
+
1054
+ def _write_csv(columns: Dict[str, list], path: str) -> None:
1055
+ """Write column lists (in table column order) as a quoted CSV."""
1056
+ import csv
1057
+
1058
+ cols = list(columns.values())
1059
+ with open(path, "w", newline="", encoding="utf-8") as fh:
1060
+ w = csv.writer(fh, quoting=csv.QUOTE_ALL, lineterminator="\n")
1061
+ w.writerows([_CSV_NULL if v is None else v for v in row] for row in zip(*cols))
1062
+
1063
+
1064
+ def _copy_csv(c, table: str, path: str, columns: Optional[List[str]] = None) -> None:
1065
+ target = f"{table} ({', '.join(columns)})" if columns else table
1066
+ c.execute(
1067
+ f"COPY {target} FROM '{path}' (FORMAT csv, HEADER false, DELIMITER ',', "
1068
+ f"QUOTE '\"', ESCAPE '\"', NULLSTR '{_CSV_NULL}', AUTO_DETECT false)"
1069
+ )
1070
+
1071
+
1072
+ def _stage(columns: Dict[str, list], base: str) -> None:
1073
+ """Stage one table (column lists in table order) at `base` (+ extension)."""
1074
+ if _pa is not None:
1075
+ _pq.write_table(_pa.table(columns), base + ".parquet")
1076
+ else:
1077
+ _write_csv(columns, base + ".csv")
1078
+
1079
+
1080
+ def _staged(base: str) -> bool:
1081
+ return os.path.exists(base + ".parquet") or os.path.exists(base + ".csv")
1082
+
1083
+
1084
+ def _load(c, table: str, base: str) -> None:
1085
+ """Bulk-load a table staged by _stage()."""
1086
+ if os.path.exists(base + ".parquet"):
1087
+ c.execute(f"INSERT INTO {table} SELECT * FROM read_parquet('{base}.parquet')")
1088
+ else:
1089
+ _copy_csv(c, table, base + ".csv")
1090
+
1091
+
1046
1092
  def _insert_rows(c, table: str, rows) -> None:
1047
- """Bulk-insert row tuples (in table column order) via an Arrow table.
1093
+ """Bulk-insert row tuples (in table column order) via a staged CSV + COPY.
1048
1094
 
1049
1095
  DuckDB's executemany runs one INSERT per row (~0.5 ms each, worse with a
1050
- large Python heap); a registered Arrow table is a single columnar insert.
1096
+ large Python heap); COPY is a single columnar load.
1051
1097
  """
1052
- import pyarrow as pa
1053
-
1054
1098
  rows = list(rows)
1055
1099
  if not rows:
1056
1100
  return
1057
- cols = [r[1] for r in c.execute(f"PRAGMA table_info('{table}')").fetchall()]
1058
- data = {name: [row[i] for row in rows] for i, name in enumerate(cols[: len(rows[0])])}
1059
- tbl = pa.table(data)
1060
- c.register("_bulk_rows", tbl)
1101
+ cols = [r[1] for r in c.execute(f"PRAGMA table_info('{table}')").fetchall()][: len(rows[0])]
1102
+ if _pa is not None:
1103
+ tbl = _pa.table({name: [row[i] for row in rows] for i, name in enumerate(cols)})
1104
+ c.register("_bulk_rows", tbl)
1105
+ try:
1106
+ c.execute(f"INSERT INTO {table} ({', '.join(cols)}) SELECT * FROM _bulk_rows")
1107
+ finally:
1108
+ c.unregister("_bulk_rows")
1109
+ return
1110
+ fd, path = tempfile.mkstemp(prefix=f"cgc_{table}_", suffix=".csv")
1111
+ os.close(fd)
1061
1112
  try:
1062
- c.execute(f"INSERT INTO {table} ({', '.join(tbl.column_names)}) SELECT * FROM _bulk_rows")
1113
+ _write_csv({name: [row[i] for row in rows] for i, name in enumerate(cols)}, path)
1114
+ _copy_csv(c, table, path, cols)
1063
1115
  finally:
1064
- c.unregister("_bulk_rows")
1116
+ os.remove(path)
@@ -72,14 +72,22 @@ def extract_rationales(
72
72
  rel_path = Path(file_path).name
73
73
 
74
74
  # Build line → function context map
75
+ # Functions are applied outermost-first (by start line, then longest
76
+ # span first), so a nested function overrides its enclosing one and
77
+ # the result doesn't depend on the order the parser listed them in.
78
+ # The parser reports `end_line` (not `body_end_line`); without it every
79
+ # function spanned 50 lines and overlapping ranges were won by
80
+ # whichever came last.
75
81
  func_context: Dict[int, str] = {}
82
+ spans = []
76
83
  for fn in file_data.get("functions", []):
77
84
  start = fn.get("line_number", 0)
78
- end = fn.get("body_end_line", start + 50) or start + 50
85
+ end = fn.get("end_line") or fn.get("body_end_line") or start + 50
79
86
  name = fn.get("name", "")
80
87
  ctx = fn.get("class_context", "")
81
- full_name = f"{ctx}.{name}" if ctx else name
82
- for line in range(start, end + 1):
88
+ spans.append((start, -end, f"{ctx}.{name}" if ctx else name))
89
+ for start, neg_end, full_name in sorted(spans):
90
+ for line in range(start, -neg_end + 1):
83
91
  func_context[line] = full_name
84
92
 
85
93
  # Scan source for rationale comments