kodit 0.3.2__tar.gz → 0.3.3__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.
Potentially problematic release.
This version of kodit might be problematic. Click here for more details.
- {kodit-0.3.2 → kodit-0.3.3}/.dockerignore +1 -1
- {kodit-0.3.2 → kodit-0.3.3}/.github/workflows/docker.yaml +22 -0
- {kodit-0.3.2 → kodit-0.3.3}/CLAUDE.md +2 -1
- {kodit-0.3.2 → kodit-0.3.3}/Dockerfile +5 -1
- {kodit-0.3.2 → kodit-0.3.3}/PKG-INFO +1 -1
- kodit-0.3.3/docs/MIGRATION_TO_INDEX_AGGREGATE.md +222 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/_version.py +2 -2
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/application/factories/code_indexing_factory.py +77 -28
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/application/services/code_indexing_application_service.py +142 -116
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/cli.py +14 -41
- kodit-0.3.3/src/kodit/domain/entities.py +271 -0
- kodit-0.3.3/src/kodit/domain/protocols.py +61 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/domain/services/embedding_service.py +1 -1
- kodit-0.3.3/src/kodit/domain/services/index_query_service.py +66 -0
- kodit-0.3.3/src/kodit/domain/services/index_service.py +323 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/domain/value_objects.py +150 -60
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/cloning/git/working_copy.py +17 -8
- kodit-0.3.3/src/kodit/infrastructure/cloning/metadata.py +98 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/embedding_factory.py +1 -1
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/local_vector_search_repository.py +1 -1
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/vectorchord_vector_search_repository.py +1 -1
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/enrichment/null_enrichment_provider.py +4 -10
- kodit-0.3.3/src/kodit/infrastructure/git/git_utils.py +25 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/ignore/ignore_pattern_provider.py +1 -2
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/indexing/auto_indexing_service.py +2 -12
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/indexing/fusion_service.py +1 -1
- kodit-0.3.3/src/kodit/infrastructure/mappers/__init__.py +1 -0
- kodit-0.3.3/src/kodit/infrastructure/mappers/index_mapper.py +344 -0
- kodit-0.3.3/src/kodit/infrastructure/snippet_extraction/factories.py +13 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/language_detection_service.py +1 -1
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/snippet_query_provider.py +0 -1
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/tree_sitter_snippet_extractor.py +1 -1
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/sqlalchemy/embedding_repository.py +1 -1
- {kodit-0.3.2/src/kodit/domain → kodit-0.3.3/src/kodit/infrastructure/sqlalchemy}/entities.py +3 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/sqlalchemy/file_repository.py +1 -1
- kodit-0.3.3/src/kodit/infrastructure/sqlalchemy/index_repository.py +550 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/mcp.py +0 -7
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/env.py +1 -1
- kodit-0.3.3/src/kodit/migrations/versions/4073b33f9436_add_file_processing_flag.py +34 -0
- kodit-0.3.3/src/kodit/utils/__init__.py +1 -0
- kodit-0.3.3/src/kodit/utils/path_utils.py +54 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/conftest.py +10 -2
- kodit-0.3.3/tests/kodit/application/test_code_indexing_application_service.py +292 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/domain/enrichment_domain_service_test.py +1 -1
- kodit-0.3.2/tests/kodit/infrastructure/git/test_git_utils.py → kodit-0.3.3/tests/kodit/domain/entities_test.py +25 -25
- kodit-0.3.3/tests/kodit/domain/services/__init__.py +1 -0
- kodit-0.3.3/tests/kodit/domain/services/index_service_test.py +186 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/domain/test_embedding_service.py +1 -1
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/domain/test_multi_search_result.py +0 -18
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/bm25/vectorchord_bm25_repository_test.py +10 -1
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/cloning/git_cloning/working_copy_test.py +3 -3
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/test_embedding_integration.py +15 -8
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/test_local_vector_search_repository.py +10 -8
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/test_vectorchord_vector_search_repository.py +10 -1
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_null_enrichment_provider.py +11 -7
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/indexing/test_auto_indexing_service.py +21 -59
- kodit-0.3.3/tests/kodit/infrastructure/mappers/__init__.py +1 -0
- kodit-0.3.3/tests/kodit/infrastructure/mappers/test_index_mapper.py +184 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/sqlalchemy/test_embedding_repository.py +1 -1
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/mcp_test.py +9 -1
- {kodit-0.3.2 → kodit-0.3.3}/tests/performance/similarity.py +4 -4
- kodit-0.3.3/tests/utils/__init__.py +1 -0
- kodit-0.3.3/tests/utils/test_path_utils.py +42 -0
- kodit-0.3.2/src/kodit/domain/enums.py +0 -9
- kodit-0.3.2/src/kodit/domain/repositories.py +0 -128
- kodit-0.3.2/src/kodit/domain/services/ignore_service.py +0 -45
- kodit-0.3.2/src/kodit/domain/services/indexing_service.py +0 -204
- kodit-0.3.2/src/kodit/domain/services/snippet_extraction_service.py +0 -89
- kodit-0.3.2/src/kodit/domain/services/snippet_service.py +0 -215
- kodit-0.3.2/src/kodit/domain/services/source_service.py +0 -85
- kodit-0.3.2/src/kodit/infrastructure/cloning/folder/__init__.py +0 -1
- kodit-0.3.2/src/kodit/infrastructure/cloning/folder/factory.py +0 -128
- kodit-0.3.2/src/kodit/infrastructure/cloning/folder/working_copy.py +0 -38
- kodit-0.3.2/src/kodit/infrastructure/cloning/git/factory.py +0 -153
- kodit-0.3.2/src/kodit/infrastructure/cloning/metadata.py +0 -128
- kodit-0.3.2/src/kodit/infrastructure/git/git_utils.py +0 -87
- kodit-0.3.2/src/kodit/infrastructure/indexing/index_repository.py +0 -286
- kodit-0.3.2/src/kodit/infrastructure/indexing/snippet_domain_service_factory.py +0 -37
- kodit-0.3.2/src/kodit/infrastructure/sqlalchemy/repository.py +0 -133
- kodit-0.3.2/src/kodit/infrastructure/sqlalchemy/snippet_repository.py +0 -259
- kodit-0.3.2/tests/kodit/application/test_code_indexing_application_service.py +0 -496
- kodit-0.3.2/tests/kodit/domain/snippet_domain_service_test.py +0 -314
- kodit-0.3.2/tests/kodit/domain/snippet_extraction_domain_service_test.py +0 -185
- kodit-0.3.2/tests/kodit/infrastructure/cloning/git_cloning/factory_test.py +0 -221
- kodit-0.3.2/tests/kodit/infrastructure/git/__init__.py +0 -1
- kodit-0.3.2/tests/kodit/infrastructure/indexing/indexing_repository_test.py +0 -129
- kodit-0.3.2/tests/kodit/infrastructure/source/__init__.py +0 -1
- kodit-0.3.2/tests/kodit/infrastructure/source/source_service_test.py +0 -192
- kodit-0.3.2/tests/kodit/infrastructure/sqlalchemy/test_snippet_repository.py +0 -373
- {kodit-0.3.2 → kodit-0.3.3}/.claude/commands/debug.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.claude/commands/new-requirement.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.claude/commands/refactor.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.claude/settings.json +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.cursor/rules/kodit.mdc +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.cursor/rules/style.mdc +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/CODE_OF_CONDUCT.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/CONTRIBUTING.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/dependabot.yml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/workflows/docs.yaml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/workflows/pull_request.yaml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/workflows/pypi-test.yaml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/workflows/pypi.yaml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.github/workflows/test.yaml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.gitignore +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.python-version +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.vscode/launch.json +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/.vscode/settings.json +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/LICENSE +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/README.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/alembic.ini +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/_index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/demos/_index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/demos/go-simple-microservice/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/demos/knock-knock-auth/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/developer/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/getting-started/_index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/getting-started/installation/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/getting-started/integration/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/getting-started/quick-start/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/reference/_index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/reference/configuration/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/reference/deployment/docker-compose.yaml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/reference/deployment/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/reference/deployment/kubernetes.yaml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/reference/indexing/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/reference/mcp/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/docs/reference/telemetry/index.md +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/pyproject.toml +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/.gitignore +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/app.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/application/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/application/factories/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/application/services/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/config.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/database.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/domain/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/domain/errors.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/domain/interfaces.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/domain/services/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/domain/services/bm25_service.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/domain/services/enrichment_service.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/bm25/bm25_factory.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/bm25/local_bm25_repository.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/bm25/vectorchord_bm25_repository.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/cloning/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/cloning/git/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/embedding_providers/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/embedding_providers/batching.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/embedding_providers/hash_embedding_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/embedding_providers/local_embedding_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/embedding/embedding_providers/openai_embedding_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/enrichment/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/enrichment/enrichment_factory.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/enrichment/local_enrichment_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/enrichment/openai_enrichment_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/git/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/ignore/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/indexing/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/indexing/indexing_factory.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/languages/csharp.scm +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/languages/go.scm +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/languages/java.scm +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/languages/javascript.scm +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/languages/python.scm +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/languages/typescript.scm +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/snippet_extraction/snippet_extraction_factory.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/ui/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/ui/progress.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/infrastructure/ui/spinner.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/log.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/middleware.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/README +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/script.py.mako +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/versions/4552eb3f23ce_add_summary.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/versions/85155663351e_initial.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/versions/9e53ea8bb3b0_add_authors.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/versions/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/src/kodit/reporting.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/docker-smoke.sh +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/experiments/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/experiments/cline_prompt_tests/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/experiments/cline_prompt_tests/cline_prompt.txt +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/experiments/cline_prompt_tests/cline_prompt_test.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/application/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/cli_test.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/config_test.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/domain/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/domain/bm25_domain_service_test.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/domain/test_language_mapping.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/e2e.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/bm25/local_bm25_repository_test.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/cloning/git_cloning/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/embedding_factory_test.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/embedding_provider/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/embedding_provider/test_hash_embedding_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/embedding_provider/test_local_embedding_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/embedding_provider/test_openai_embedding_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/embedding/test_batching.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/enrichment/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/enrichment/enrichment_provider/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_local_enrichment_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_openai_enrichment_provider.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/enrichment/test_enrichment_factory.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/indexing/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/snippets/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/snippets/csharp.cs +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/snippets/golang.go +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/snippets/javascript.js +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/snippets/knock_knock_server.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/snippets/python.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/snippets/typescript.tsx +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/kodit/log_test.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/performance/__init__.py +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/smoke.sh +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/tests/vectorchord-smoke.sh +0 -0
- {kodit-0.3.2 → kodit-0.3.3}/uv.lock +0 -0
|
@@ -45,6 +45,9 @@ jobs:
|
|
|
45
45
|
needs: test-build
|
|
46
46
|
# Only run on main branch or when explicitly triggered
|
|
47
47
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
|
|
48
|
+
strategy:
|
|
49
|
+
matrix:
|
|
50
|
+
python-version: ["3.12.8", "3.13.5"]
|
|
48
51
|
steps:
|
|
49
52
|
- name: Free up disk space
|
|
50
53
|
run: sudo rm -rf /usr/local/lib/android /usr/share/dotnet || true
|
|
@@ -65,11 +68,28 @@ jobs:
|
|
|
65
68
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
66
69
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
67
70
|
|
|
71
|
+
- name: Set short Python version
|
|
72
|
+
id: pyver
|
|
73
|
+
run: |
|
|
74
|
+
echo "SHORT_PY=$(echo '${{ matrix.python-version }}' | cut -d. -f1,2)" >> $GITHUB_OUTPUT
|
|
75
|
+
echo "ENABLE_DEFAULT=$([ \"$(echo '${{ matrix.python-version }}' | cut -d. -f1,2)\" = \"3.13\" ] && echo true || echo false)" >> $GITHUB_OUTPUT
|
|
76
|
+
|
|
68
77
|
- name: Extract metadata (tags, labels) for Docker
|
|
69
78
|
id: meta
|
|
70
79
|
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
|
71
80
|
with:
|
|
72
81
|
images: ${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/${{ github.event.repository.name }}
|
|
82
|
+
tags: |
|
|
83
|
+
type=semver,pattern={{version}},enable=${{ steps.pyver.outputs.ENABLE_DEFAULT }}
|
|
84
|
+
type=semver,pattern={{version}},suffix=-py${{ steps.pyver.outputs.SHORT_PY }}
|
|
85
|
+
type=semver,pattern={{major}}.{{minor}},enable=${{ steps.pyver.outputs.ENABLE_DEFAULT }}
|
|
86
|
+
type=semver,pattern={{major}}.{{minor}},suffix=-py${{ steps.pyver.outputs.SHORT_PY }}
|
|
87
|
+
type=ref,event=branch,enable=${{ steps.pyver.outputs.ENABLE_DEFAULT }}
|
|
88
|
+
type=ref,event=branch,suffix=-py${{ steps.pyver.outputs.SHORT_PY }}
|
|
89
|
+
type=ref,event=pr,enable=${{ steps.pyver.outputs.ENABLE_DEFAULT }}
|
|
90
|
+
type=ref,event=pr,suffix=-py${{ steps.pyver.outputs.SHORT_PY }}
|
|
91
|
+
type=sha,enable=${{ steps.pyver.outputs.ENABLE_DEFAULT }}
|
|
92
|
+
type=sha,suffix=-py${{ steps.pyver.outputs.SHORT_PY }}
|
|
73
93
|
|
|
74
94
|
- name: Build and push Docker image
|
|
75
95
|
id: push
|
|
@@ -81,6 +101,8 @@ jobs:
|
|
|
81
101
|
push: true
|
|
82
102
|
tags: ${{ steps.meta.outputs.tags }}
|
|
83
103
|
labels: ${{ steps.meta.outputs.labels }}
|
|
104
|
+
build-args: |
|
|
105
|
+
PYTHON_VERSION=${{ matrix.python-version }}
|
|
84
106
|
|
|
85
107
|
- name: Generate artifact attestation
|
|
86
108
|
uses: actions/attest-build-provenance@v2
|
|
@@ -96,4 +96,5 @@ Migrations managed with Alembic in `migrations/` directory. DO NOT EDIT THESE FI
|
|
|
96
96
|
- Smoke tests for deployment validation
|
|
97
97
|
- Performance tests for similarity search
|
|
98
98
|
|
|
99
|
-
Test
|
|
99
|
+
Test file names should mirror the source structure under `tests/` directory and end in
|
|
100
|
+
the name `_test.py`.
|
|
@@ -30,9 +30,11 @@ COPY --from=ghcr.io/astral-sh/uv:0.7.2 /uv /usr/local/bin/uv
|
|
|
30
30
|
ENV UV_LINK_MODE=copy \
|
|
31
31
|
UV_COMPILE_BYTECODE=1 \
|
|
32
32
|
UV_PYTHON_DOWNLOADS=never \
|
|
33
|
-
UV_PYTHON=python3.13 \
|
|
34
33
|
UV_PROJECT_ENVIRONMENT=/app
|
|
35
34
|
|
|
35
|
+
# Write the PYTHON_VERSION to a .python-version
|
|
36
|
+
RUN echo ${PYTHON_VERSION} > .python-version
|
|
37
|
+
|
|
36
38
|
# Synchronize DEPENDENCIES without the application itself.
|
|
37
39
|
# This layer is cached until uv.lock or pyproject.toml change, which are
|
|
38
40
|
# only temporarily mounted into the build container since we don't need
|
|
@@ -43,6 +45,7 @@ ENV UV_LINK_MODE=copy \
|
|
|
43
45
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
44
46
|
--mount=type=bind,source=uv.lock,target=uv.lock \
|
|
45
47
|
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
|
48
|
+
UV_PYTHON="python$(echo ${PYTHON_VERSION} | cut -d. -f1-2)" \
|
|
46
49
|
uv sync \
|
|
47
50
|
--locked \
|
|
48
51
|
--no-dev \
|
|
@@ -54,6 +57,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|
|
54
57
|
COPY . /src
|
|
55
58
|
WORKDIR /src
|
|
56
59
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
60
|
+
UV_PYTHON="python$(echo ${PYTHON_VERSION} | cut -d. -f1-2)" \
|
|
57
61
|
uv sync \
|
|
58
62
|
--locked \
|
|
59
63
|
--no-dev \
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Migration to Index Aggregate Architecture
|
|
2
|
+
|
|
3
|
+
This document outlines the strategy for migrating from the current multiple-service architecture to the new Index aggregate root design.
|
|
4
|
+
|
|
5
|
+
## Current Architecture Issues
|
|
6
|
+
|
|
7
|
+
### Code Analysis of `CodeIndexingApplicationService`
|
|
8
|
+
|
|
9
|
+
The current application service has several problems:
|
|
10
|
+
|
|
11
|
+
1. **Service Proliferation**: 7+ domain services injected
|
|
12
|
+
2. **Manual Orchestration**: Application layer contains complex business logic
|
|
13
|
+
3. **Leaky Abstractions**: SQLAlchemy session management at application level
|
|
14
|
+
4. **Scattered State**: Snippet state tracked across multiple services
|
|
15
|
+
|
|
16
|
+
### Current Workflow Complexity
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
# Current approach - complex orchestration
|
|
20
|
+
async def run_index(self, index_id: int) -> None:
|
|
21
|
+
# 1. Get index from indexing service
|
|
22
|
+
index = await self.indexing_domain_service.get_index(index_id)
|
|
23
|
+
|
|
24
|
+
# 2. Delete old snippets via snippet service
|
|
25
|
+
await self.snippet_domain_service.delete_snippets_for_index(index.id)
|
|
26
|
+
|
|
27
|
+
# 3. Extract snippets via snippet service
|
|
28
|
+
snippets = await self.snippet_domain_service.extract_and_create_snippets(...)
|
|
29
|
+
|
|
30
|
+
# 4. Manual transaction management
|
|
31
|
+
await self.session.commit()
|
|
32
|
+
|
|
33
|
+
# 5. Create BM25 index via separate service
|
|
34
|
+
await self._create_bm25_index(snippets, progress_callback)
|
|
35
|
+
|
|
36
|
+
# 6. Create embeddings via separate service
|
|
37
|
+
await self._create_code_embeddings(snippets, progress_callback)
|
|
38
|
+
|
|
39
|
+
# 7. Enrich snippets via separate service
|
|
40
|
+
await self._enrich_snippets(snippets, progress_callback)
|
|
41
|
+
|
|
42
|
+
# 8. More embeddings via separate service
|
|
43
|
+
await self._create_text_embeddings(snippets, progress_callback)
|
|
44
|
+
|
|
45
|
+
# 9. Update timestamp via indexing service
|
|
46
|
+
await self.indexing_domain_service.update_index_timestamp(index.id)
|
|
47
|
+
|
|
48
|
+
# 10. Final commit
|
|
49
|
+
await self.session.commit()
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## New Architecture Benefits
|
|
53
|
+
|
|
54
|
+
### Simplified Application Service
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
# New approach - aggregate root handles complexity
|
|
58
|
+
async def run_complete_indexing_workflow(
|
|
59
|
+
self, uri: AnyUrl, local_path: Path
|
|
60
|
+
) -> domain_entities.Index:
|
|
61
|
+
# 1. Create index (aggregate root)
|
|
62
|
+
index = await self._index_domain_service.create_index(uri)
|
|
63
|
+
|
|
64
|
+
# 2. Populate working copy (aggregate method)
|
|
65
|
+
index = await self._index_domain_service.clone_and_populate_working_copy(
|
|
66
|
+
index, local_path, SourceType.GIT
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
# 3. Extract snippets (aggregate method)
|
|
70
|
+
index = await self._index_domain_service.extract_snippets(index)
|
|
71
|
+
|
|
72
|
+
# 4. Simple transaction management
|
|
73
|
+
await self._session.commit()
|
|
74
|
+
|
|
75
|
+
return index
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Migration Strategy
|
|
79
|
+
|
|
80
|
+
### Phase 1: Parallel Implementation ✅
|
|
81
|
+
|
|
82
|
+
- [x] Create new domain entities (`domain/models/entities.py`)
|
|
83
|
+
- [x] Create repository protocol (`domain/models/protocols.py`)
|
|
84
|
+
- [x] Create mapping layer (`infrastructure/mappers/index_mapper.py`)
|
|
85
|
+
- [x] Create repository implementation (`infrastructure/sqlalchemy/index_repository.py`)
|
|
86
|
+
- [x] Create domain service (`domain/services/index_service.py`)
|
|
87
|
+
- [x] Create simplified application service (`application/services/simplified_indexing_service.py`)
|
|
88
|
+
|
|
89
|
+
### Phase 2: Feature Parity (Next Steps)
|
|
90
|
+
|
|
91
|
+
#### 2.1 Complete Index Domain Service
|
|
92
|
+
- [ ] Implement actual cloning logic in `clone_and_populate_working_copy`
|
|
93
|
+
- [ ] Complete snippet enrichment in `enrich_snippets_with_summaries`
|
|
94
|
+
- [ ] Add snippet search capabilities to Index aggregate
|
|
95
|
+
- [ ] Add BM25/embedding integration
|
|
96
|
+
|
|
97
|
+
#### 2.2 Application Service Integration
|
|
98
|
+
- [ ] Update application factories to create new services
|
|
99
|
+
- [ ] Add legacy compatibility methods
|
|
100
|
+
- [ ] Implement search functionality migration
|
|
101
|
+
|
|
102
|
+
#### 2.3 CLI Integration
|
|
103
|
+
- [ ] Update CLI commands to use new application service
|
|
104
|
+
- [ ] Maintain backward compatibility for existing commands
|
|
105
|
+
|
|
106
|
+
### Phase 3: Gradual Migration
|
|
107
|
+
|
|
108
|
+
#### 3.1 New Endpoints First
|
|
109
|
+
- [ ] Create new CLI commands using Index aggregate
|
|
110
|
+
- [ ] Add new MCP tools using simplified service
|
|
111
|
+
- [ ] Implement new features with aggregate root
|
|
112
|
+
|
|
113
|
+
#### 3.2 Legacy Adaptation
|
|
114
|
+
- [ ] Wrap old API calls to use new domain service
|
|
115
|
+
- [ ] Provide compatibility layer for existing integrations
|
|
116
|
+
- [ ] Migrate tests gradually
|
|
117
|
+
|
|
118
|
+
#### 3.3 Search Migration
|
|
119
|
+
- [ ] Move search logic into Index aggregate
|
|
120
|
+
- [ ] Create search value objects in domain
|
|
121
|
+
- [ ] Simplify search application service
|
|
122
|
+
|
|
123
|
+
### Phase 4: Complete Migration
|
|
124
|
+
|
|
125
|
+
#### 4.1 Remove Old Services
|
|
126
|
+
- [ ] Remove `IndexingDomainService`
|
|
127
|
+
- [ ] Remove `SnippetDomainService`
|
|
128
|
+
- [ ] Remove `SourceService`
|
|
129
|
+
- [ ] Clean up old value objects
|
|
130
|
+
|
|
131
|
+
#### 4.2 Final Cleanup
|
|
132
|
+
- [ ] Remove legacy compatibility methods
|
|
133
|
+
- [ ] Update all tests to use new architecture
|
|
134
|
+
- [ ] Remove old application service
|
|
135
|
+
|
|
136
|
+
## Code Examples
|
|
137
|
+
|
|
138
|
+
### Before: Current Complexity
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
class CodeIndexingApplicationService:
|
|
142
|
+
def __init__(self,
|
|
143
|
+
indexing_domain_service: IndexingDomainService,
|
|
144
|
+
snippet_domain_service: SnippetDomainService,
|
|
145
|
+
source_service: SourceService,
|
|
146
|
+
bm25_service: BM25DomainService,
|
|
147
|
+
code_search_service: EmbeddingDomainService,
|
|
148
|
+
text_search_service: EmbeddingDomainService,
|
|
149
|
+
enrichment_service: EnrichmentDomainService,
|
|
150
|
+
session: AsyncSession, # Leaky abstraction!
|
|
151
|
+
):
|
|
152
|
+
# 7+ services to coordinate
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### After: Aggregate Root Simplicity
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
class SimplifiedIndexingApplicationService:
|
|
159
|
+
def __init__(self,
|
|
160
|
+
index_domain_service: IndexDomainService,
|
|
161
|
+
session: AsyncSession,
|
|
162
|
+
):
|
|
163
|
+
# Single domain service + session
|
|
164
|
+
# All business logic in domain
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Benefits of Migration
|
|
168
|
+
|
|
169
|
+
### 1. **Reduced Complexity**
|
|
170
|
+
- Single domain service instead of 7+
|
|
171
|
+
- Business logic moves to domain layer
|
|
172
|
+
- Application layer focuses on coordination
|
|
173
|
+
|
|
174
|
+
### 2. **Better Domain Modeling**
|
|
175
|
+
- Index as true aggregate root
|
|
176
|
+
- Rich domain objects with behavior
|
|
177
|
+
- Proper encapsulation of business rules
|
|
178
|
+
|
|
179
|
+
### 3. **Improved Testability**
|
|
180
|
+
- Domain service can be tested in isolation
|
|
181
|
+
- No SQLAlchemy dependencies in domain tests
|
|
182
|
+
- Cleaner mocking for application tests
|
|
183
|
+
|
|
184
|
+
### 4. **Enhanced Maintainability**
|
|
185
|
+
- Clear boundaries between layers
|
|
186
|
+
- Easier to add new features
|
|
187
|
+
- Reduced coupling between services
|
|
188
|
+
|
|
189
|
+
### 5. **Better Performance**
|
|
190
|
+
- Fewer repository round trips
|
|
191
|
+
- Optimized aggregate loading
|
|
192
|
+
- Reduced object mapping overhead
|
|
193
|
+
|
|
194
|
+
## Risks and Mitigation
|
|
195
|
+
|
|
196
|
+
### Risk: Breaking Changes
|
|
197
|
+
**Mitigation**: Implement compatibility layer during transition
|
|
198
|
+
|
|
199
|
+
### Risk: Feature Regression
|
|
200
|
+
**Mitigation**: Comprehensive test coverage for both old and new
|
|
201
|
+
|
|
202
|
+
### Risk: Performance Impact
|
|
203
|
+
**Mitigation**: Benchmark and optimize aggregate loading
|
|
204
|
+
|
|
205
|
+
### Risk: Complex Migration
|
|
206
|
+
**Mitigation**: Gradual, phase-by-phase approach
|
|
207
|
+
|
|
208
|
+
## Success Metrics
|
|
209
|
+
|
|
210
|
+
- [ ] Reduced lines of code in application service (target: 50% reduction)
|
|
211
|
+
- [ ] Improved test coverage for domain logic
|
|
212
|
+
- [ ] Faster indexing workflow execution
|
|
213
|
+
- [ ] Fewer bugs related to state management
|
|
214
|
+
- [ ] Easier onboarding for new developers
|
|
215
|
+
|
|
216
|
+
## Next Immediate Steps
|
|
217
|
+
|
|
218
|
+
1. **Complete Domain Service**: Finish implementing cloning and enrichment
|
|
219
|
+
2. **Factory Integration**: Update application factories
|
|
220
|
+
3. **Simple CLI Command**: Create one new command using aggregate
|
|
221
|
+
4. **Performance Test**: Benchmark against current implementation
|
|
222
|
+
5. **Migration Plan**: Detail specific steps for first legacy endpoint
|
|
@@ -6,17 +6,20 @@ from kodit.application.services.code_indexing_application_service import (
|
|
|
6
6
|
CodeIndexingApplicationService,
|
|
7
7
|
)
|
|
8
8
|
from kodit.config import AppContext
|
|
9
|
-
from kodit.domain.entities import EmbeddingType
|
|
10
9
|
from kodit.domain.services.bm25_service import BM25DomainService
|
|
11
10
|
from kodit.domain.services.embedding_service import EmbeddingDomainService
|
|
12
11
|
from kodit.domain.services.enrichment_service import EnrichmentDomainService
|
|
13
|
-
from kodit.domain.services.
|
|
12
|
+
from kodit.domain.services.index_query_service import IndexQueryService
|
|
13
|
+
from kodit.domain.services.index_service import (
|
|
14
|
+
IndexDomainService,
|
|
15
|
+
)
|
|
16
|
+
from kodit.domain.value_objects import LanguageMapping, SnippetExtractionStrategy
|
|
14
17
|
from kodit.infrastructure.bm25.bm25_factory import bm25_repository_factory
|
|
15
18
|
from kodit.infrastructure.embedding.embedding_factory import (
|
|
16
19
|
embedding_domain_service_factory,
|
|
17
20
|
)
|
|
18
|
-
from kodit.infrastructure.embedding.embedding_providers import (
|
|
19
|
-
|
|
21
|
+
from kodit.infrastructure.embedding.embedding_providers.hash_embedding_provider import (
|
|
22
|
+
HashEmbeddingProvider,
|
|
20
23
|
)
|
|
21
24
|
from kodit.infrastructure.embedding.local_vector_search_repository import (
|
|
22
25
|
LocalVectorSearchRepository,
|
|
@@ -27,36 +30,63 @@ from kodit.infrastructure.enrichment.enrichment_factory import (
|
|
|
27
30
|
from kodit.infrastructure.enrichment.null_enrichment_provider import (
|
|
28
31
|
NullEnrichmentProvider,
|
|
29
32
|
)
|
|
30
|
-
from kodit.infrastructure.indexing.
|
|
31
|
-
|
|
33
|
+
from kodit.infrastructure.indexing.fusion_service import ReciprocalRankFusionService
|
|
34
|
+
from kodit.infrastructure.snippet_extraction.factories import (
|
|
35
|
+
create_snippet_query_provider,
|
|
36
|
+
)
|
|
37
|
+
from kodit.infrastructure.snippet_extraction.language_detection_service import (
|
|
38
|
+
FileSystemLanguageDetectionService,
|
|
32
39
|
)
|
|
33
|
-
from kodit.infrastructure.
|
|
34
|
-
|
|
40
|
+
from kodit.infrastructure.snippet_extraction.tree_sitter_snippet_extractor import (
|
|
41
|
+
TreeSitterSnippetExtractor,
|
|
35
42
|
)
|
|
36
43
|
from kodit.infrastructure.sqlalchemy.embedding_repository import (
|
|
37
44
|
SqlAlchemyEmbeddingRepository,
|
|
38
45
|
)
|
|
46
|
+
from kodit.infrastructure.sqlalchemy.entities import EmbeddingType
|
|
47
|
+
from kodit.infrastructure.sqlalchemy.index_repository import SqlAlchemyIndexRepository
|
|
39
48
|
|
|
40
49
|
|
|
41
50
|
def create_code_indexing_application_service(
|
|
42
51
|
app_context: AppContext,
|
|
43
52
|
session: AsyncSession,
|
|
44
|
-
source_service: SourceService,
|
|
45
53
|
) -> CodeIndexingApplicationService:
|
|
46
54
|
"""Create a unified code indexing application service with all dependencies."""
|
|
47
55
|
# Create domain services
|
|
48
|
-
indexing_domain_service = indexing_domain_service_factory(session)
|
|
49
|
-
snippet_domain_service = snippet_domain_service_factory(session)
|
|
50
56
|
bm25_service = BM25DomainService(bm25_repository_factory(app_context, session))
|
|
51
57
|
code_search_service = embedding_domain_service_factory("code", app_context, session)
|
|
52
58
|
text_search_service = embedding_domain_service_factory("text", app_context, session)
|
|
53
59
|
enrichment_service = enrichment_domain_service_factory(app_context)
|
|
60
|
+
index_repository = SqlAlchemyIndexRepository(session=session)
|
|
61
|
+
# Use the unified language mapping from the domain layer
|
|
62
|
+
language_map = LanguageMapping.get_extension_to_language_map()
|
|
63
|
+
|
|
64
|
+
# Create infrastructure services
|
|
65
|
+
language_detector = FileSystemLanguageDetectionService(language_map)
|
|
66
|
+
query_provider = create_snippet_query_provider()
|
|
67
|
+
|
|
68
|
+
# Create snippet extractors
|
|
69
|
+
method_extractor = TreeSitterSnippetExtractor(query_provider)
|
|
70
|
+
|
|
71
|
+
snippet_extractors = {
|
|
72
|
+
SnippetExtractionStrategy.METHOD_BASED: method_extractor,
|
|
73
|
+
}
|
|
74
|
+
index_domain_service = IndexDomainService(
|
|
75
|
+
language_detector=language_detector,
|
|
76
|
+
snippet_extractors=snippet_extractors,
|
|
77
|
+
enrichment_service=enrichment_service,
|
|
78
|
+
clone_dir=app_context.get_clone_dir(),
|
|
79
|
+
)
|
|
80
|
+
index_query_service = IndexQueryService(
|
|
81
|
+
index_repository=index_repository,
|
|
82
|
+
fusion_service=ReciprocalRankFusionService(),
|
|
83
|
+
)
|
|
54
84
|
|
|
55
85
|
# Create and return the unified application service
|
|
56
86
|
return CodeIndexingApplicationService(
|
|
57
|
-
indexing_domain_service=
|
|
58
|
-
|
|
59
|
-
|
|
87
|
+
indexing_domain_service=index_domain_service,
|
|
88
|
+
index_repository=index_repository,
|
|
89
|
+
index_query_service=index_query_service,
|
|
60
90
|
bm25_service=bm25_service,
|
|
61
91
|
code_search_service=code_search_service,
|
|
62
92
|
text_search_service=text_search_service,
|
|
@@ -68,36 +98,30 @@ def create_code_indexing_application_service(
|
|
|
68
98
|
def create_fast_test_code_indexing_application_service(
|
|
69
99
|
app_context: AppContext,
|
|
70
100
|
session: AsyncSession,
|
|
71
|
-
source_service: SourceService,
|
|
72
101
|
) -> CodeIndexingApplicationService:
|
|
73
|
-
"""Create a fast test
|
|
102
|
+
"""Create a fast test code indexing application service."""
|
|
74
103
|
# Create domain services
|
|
75
|
-
indexing_domain_service = indexing_domain_service_factory(session)
|
|
76
|
-
snippet_domain_service = snippet_domain_service_factory(session)
|
|
77
104
|
bm25_service = BM25DomainService(bm25_repository_factory(app_context, session))
|
|
78
|
-
|
|
79
|
-
# Create fast embedding services using HashEmbeddingProvider
|
|
80
105
|
embedding_repository = SqlAlchemyEmbeddingRepository(session=session)
|
|
81
106
|
|
|
82
|
-
# Fast code search service
|
|
83
107
|
code_search_repository = LocalVectorSearchRepository(
|
|
84
108
|
embedding_repository=embedding_repository,
|
|
85
|
-
embedding_provider=
|
|
109
|
+
embedding_provider=HashEmbeddingProvider(),
|
|
86
110
|
embedding_type=EmbeddingType.CODE,
|
|
87
111
|
)
|
|
88
112
|
code_search_service = EmbeddingDomainService(
|
|
89
|
-
embedding_provider=
|
|
113
|
+
embedding_provider=HashEmbeddingProvider(),
|
|
90
114
|
vector_search_repository=code_search_repository,
|
|
91
115
|
)
|
|
92
116
|
|
|
93
117
|
# Fast text search service
|
|
94
118
|
text_search_repository = LocalVectorSearchRepository(
|
|
95
119
|
embedding_repository=embedding_repository,
|
|
96
|
-
embedding_provider=
|
|
120
|
+
embedding_provider=HashEmbeddingProvider(),
|
|
97
121
|
embedding_type=EmbeddingType.TEXT,
|
|
98
122
|
)
|
|
99
123
|
text_search_service = EmbeddingDomainService(
|
|
100
|
-
embedding_provider=
|
|
124
|
+
embedding_provider=HashEmbeddingProvider(),
|
|
101
125
|
vector_search_repository=text_search_repository,
|
|
102
126
|
)
|
|
103
127
|
|
|
@@ -106,11 +130,36 @@ def create_fast_test_code_indexing_application_service(
|
|
|
106
130
|
enrichment_provider=NullEnrichmentProvider()
|
|
107
131
|
)
|
|
108
132
|
|
|
133
|
+
index_repository = SqlAlchemyIndexRepository(session=session)
|
|
134
|
+
# Use the unified language mapping from the domain layer
|
|
135
|
+
language_map = LanguageMapping.get_extension_to_language_map()
|
|
136
|
+
|
|
137
|
+
# Create infrastructure services
|
|
138
|
+
language_detector = FileSystemLanguageDetectionService(language_map)
|
|
139
|
+
query_provider = create_snippet_query_provider()
|
|
140
|
+
|
|
141
|
+
# Create snippet extractors
|
|
142
|
+
method_extractor = TreeSitterSnippetExtractor(query_provider)
|
|
143
|
+
|
|
144
|
+
snippet_extractors = {
|
|
145
|
+
SnippetExtractionStrategy.METHOD_BASED: method_extractor,
|
|
146
|
+
}
|
|
147
|
+
index_domain_service = IndexDomainService(
|
|
148
|
+
language_detector=language_detector,
|
|
149
|
+
snippet_extractors=snippet_extractors,
|
|
150
|
+
enrichment_service=enrichment_service,
|
|
151
|
+
clone_dir=app_context.get_clone_dir(),
|
|
152
|
+
)
|
|
153
|
+
index_query_service = IndexQueryService(
|
|
154
|
+
index_repository=index_repository,
|
|
155
|
+
fusion_service=ReciprocalRankFusionService(),
|
|
156
|
+
)
|
|
157
|
+
|
|
109
158
|
# Create and return the unified application service
|
|
110
159
|
return CodeIndexingApplicationService(
|
|
111
|
-
indexing_domain_service=
|
|
112
|
-
|
|
113
|
-
|
|
160
|
+
indexing_domain_service=index_domain_service,
|
|
161
|
+
index_repository=index_repository,
|
|
162
|
+
index_query_service=index_query_service,
|
|
114
163
|
bm25_service=bm25_service,
|
|
115
164
|
code_search_service=code_search_service,
|
|
116
165
|
text_search_service=text_search_service,
|