kodit 0.5.1__tar.gz → 0.5.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.5.1 → kodit-0.5.3}/.github/workflows/test.yaml +1 -0
- {kodit-0.5.1 → kodit-0.5.3}/PKG-INFO +1 -1
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/api/index.md +37 -1
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/api/openapi.json +103 -1
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/configuration/index.md +6 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/_version.py +2 -2
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/factories/server_factory.py +25 -5
- kodit-0.5.3/src/kodit/application/services/enrichment_query_service.py +95 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/config.py +12 -0
- kodit-0.5.3/src/kodit/domain/tracking/__init__.py +1 -0
- kodit-0.5.3/src/kodit/domain/tracking/resolution_service.py +81 -0
- kodit-0.5.3/src/kodit/domain/tracking/trackable.py +21 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/dependencies.py +15 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/routers/repositories.py +99 -0
- kodit-0.5.3/src/kodit/infrastructure/embedding/embedding_providers/litellm_embedding_provider.py +107 -0
- kodit-0.5.3/src/kodit/infrastructure/enricher/litellm_enricher.py +83 -0
- kodit-0.5.3/src/kodit/infrastructure/providers/__init__.py +1 -0
- kodit-0.5.3/src/kodit/infrastructure/providers/async_batch_processor.py +51 -0
- kodit-0.5.3/src/kodit/infrastructure/providers/litellm_provider.py +132 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/log.py +10 -1
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/embedding/embedding_provider/litellm_embedding_provider_test.py +72 -156
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/embedding/test_litellm_socket_providers.py +4 -4
- kodit-0.5.1/src/kodit/domain/services/enrichment_service.py +0 -27
- kodit-0.5.1/src/kodit/infrastructure/embedding/embedding_providers/litellm_embedding_provider.py +0 -156
- kodit-0.5.1/src/kodit/infrastructure/enricher/litellm_enricher.py +0 -153
- kodit-0.5.1/tests/kodit/domain/enrichment_service_test.py +0 -120
- {kodit-0.5.1 → kodit-0.5.3}/.claude/commands/debug.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.claude/commands/new-requirement.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.claude/commands/refactor.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.claude/commands/update-docs.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.claude/settings.json +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.cursor/rules/kodit.mdc +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.cursor/rules/style.mdc +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.dockerignore +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/CODE_OF_CONDUCT.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/CONTRIBUTING.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/dependabot.yml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/workflows/docker.yaml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/workflows/docs.yaml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/workflows/pull_request.yaml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/workflows/pypi-test.yaml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.github/workflows/pypi.yaml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.gitignore +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.python-version +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.vscode/launch.json +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/.vscode/settings.json +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/CLAUDE.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/Dockerfile +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/LICENSE +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/Makefile +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/README.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/alembic.ini +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/_index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/demos/_index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/demos/go-simple-microservice/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/demos/knock-knock-auth/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/developer/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/getting-started/_index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/getting-started/installation/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/getting-started/integration/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/getting-started/quick-start/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/_index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/api/templates/_content.md.j2 +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/api/templates/_example.md.j2 +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/api/templates/_object_schema.md.j2 +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/api/templates/_security_scheme.md.j2 +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/api/templates/api_doc_template.md.j2 +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/configuration/templates/template.j2 +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/deployment/docker-compose.yaml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/deployment/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/deployment/kubernetes.yaml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/hosted-kodit/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/indexing/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/mcp/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/sync/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/telemetry/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/docs/reference/troubleshooting/index.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/pyproject.toml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/.gitignore +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/app.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/factories/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/factories/reporting_factory.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/services/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/services/code_search_application_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/services/commit_indexing_application_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/services/indexing_worker_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/services/queue_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/services/reporting.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/application/services/sync_scheduler.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/cli.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/cli_utils.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/database.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/architecture/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/architecture/architecture.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/architecture/physical/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/architecture/physical/discovery_notes.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/architecture/physical/formatter.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/architecture/physical/physical.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/development/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/development/development.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/development/snippet/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/development/snippet/snippet.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/enricher.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/enrichment.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/request.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/response.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/usage/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/usage/api_docs.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/enrichments/usage/usage.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/entities/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/entities/git.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/errors.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/factories/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/factories/git_repo_factory.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/protocols.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/services/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/services/bm25_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/services/embedding_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/services/git_repository_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/services/git_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/services/physical_architecture_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/services/task_status_query_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/domain/value_objects.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/client/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/client/base.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/client/exceptions.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/client/generated_endpoints.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/client/search_client.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/middleware/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/middleware/auth.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/routers/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/routers/commits.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/routers/queue.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/routers/search.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/commit.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/context.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/enrichment.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/queue.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/search.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/snippet.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/tag.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/api/v1/schemas/task_status.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/bm25/local_bm25_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/bm25/vectorchord_bm25_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/cloning/git/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/cloning/git/git_python_adaptor.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/cloning/git/working_copy.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/embedding/embedding_factory.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/embedding/embedding_providers/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/embedding/embedding_providers/batching.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/embedding/embedding_providers/hash_embedding_provider.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/embedding/embedding_providers/local_embedding_provider.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/embedding/local_vector_search_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/embedding/vectorchord_vector_search_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/enricher/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/enricher/enricher_factory.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/enricher/local_enricher.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/enricher/null_enricher.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/enricher/utils.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/git/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/git/git_utils.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/ignore/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/ignore/ignore_pattern_provider.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/indexing/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/indexing/fusion_service.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/mappers/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/mappers/enrichment_mapper.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/mappers/git_mapper.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/mappers/snippet_mapper.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/mappers/task_mapper.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/mappers/task_status_mapper.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/physical_architecture/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/physical_architecture/detectors/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/physical_architecture/detectors/docker_compose_detector.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/physical_architecture/formatters/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/physical_architecture/formatters/narrative_formatter.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/reporting/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/reporting/db_progress.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/reporting/log_progress.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/reporting/telemetry_progress.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/slicing/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/slicing/api_doc_extractor.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/slicing/ast_analyzer.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/slicing/slicer.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/embedding_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/enrichment_v2_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/entities.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/git_branch_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/git_commit_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/git_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/git_tag_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/snippet_v2_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/task_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/task_status_repository.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/infrastructure/sqlalchemy/unit_of_work.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/mcp.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/middleware.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/README +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/env.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/script.py.mako +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/04b80f802e0c_foreign_key_review.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/19f8c7faf8b9_add_generic_enrichment_type.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/4073b33f9436_add_file_processing_flag.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/4552eb3f23ce_add_summary.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/7f15f878c3a1_add_new_git_entities.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/85155663351e_initial.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/9cf0e87de578_add_queue.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/9e53ea8bb3b0_add_authors.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/b9cd1c3fd762_add_task_status.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/migrations/versions/f9e5ef5e688f_add_git_commits_number.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/py.typed +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/utils/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/utils/dump_config.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/utils/dump_openapi.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/utils/generate_api_paths.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/src/kodit/utils/path_utils.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/conftest.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/docker-smoke.sh +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/application/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/application/services/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/application/services/commit_indexing_application_service_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/application/services/queue_service_get_task_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/application/services/queue_service_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/application/services/reporting_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/cli_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/domain/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/domain/bm25_service_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/domain/embedding_service_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/domain/entities_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/domain/language_detection_service_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/domain/services/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/domain/services/git_repository_service_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/e2e.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/bm25/local_bm25_repository_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/cloning/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/cloning/git/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/cloning/git/git_python_adaptor_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/cloning/git_cloning/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/cloning/git_cloning/working_copy_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/embedding/batching_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/embedding/embedding_factory_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/embedding/embedding_provider/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/embedding/embedding_provider/hash_embedding_provider_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/embedding/embedding_provider/local_embedding_provider_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/enricher/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/enricher/null_enricher_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/mappers/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/mappers/git_mapper_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/physical_architecture/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/physical_architecture/detectors/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/physical_architecture/detectors/docker_compose_detector_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/physical_architecture/end_to_end_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/physical_architecture/fixtures/simple_web_app/docker-compose.yml +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/physical_architecture/formatters/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/physical_architecture/formatters/narrative_formatter_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/api_doc_extractor_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/ast_analyzer_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/c/main.c +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/c/models.c +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/c/models.h +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/c/utils.c +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/c/utils.h +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/cpp/main.cpp +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/cpp/models.cpp +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/cpp/models.hpp +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/cpp/utils.cpp +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/cpp/utils.hpp +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/csharp/Main.cs +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/csharp/Models.cs +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/csharp/Utils.cs +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/css/components.css +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/css/main.css +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/css/utilities.css +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/go/api/pkg/controller/filestore.go +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/go/api/pkg/controller/filestore_test.go +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/go/main.go +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/go/models.go +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/go/utils.go +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/html/components.html +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/html/forms.html +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/html/main.html +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/java/Main.java +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/java/Models.java +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/java/Utils.java +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/javascript/main.js +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/javascript/models.js +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/javascript/utils.js +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/python/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/python/main.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/python/models.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/python/submodule/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/python/submodule/main.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/python/utils.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/rust/main.rs +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/rust/models.rs +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/data/rust/utils.rs +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/slicing/slicer_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/snippets/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/snippets/csharp.cs +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/snippets/golang.go +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/snippets/javascript.js +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/snippets/knock_knock_server.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/snippets/python.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/snippets/typescript.tsx +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/sqlalchemy/embedding_repository_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/sqlalchemy/enrichment_v2_repository_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/sqlalchemy/git_branch_repository_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/sqlalchemy/git_commit_repository_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/sqlalchemy/git_repository_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/sqlalchemy/git_tag_repository_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/infrastructure/sqlalchemy/snippet_v2_repository_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/log_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/kodit/mcp_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/smoke.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/utils/__init__.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/utils/path_utils_test.py +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/tests/vectorchord-smoke.sh +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/understanding_architecture.md +0 -0
- {kodit-0.5.1 → kodit-0.5.3}/uv.lock +0 -0
|
@@ -12,7 +12,7 @@ look at the [hosted version](https://kodit.helix.ml/docs).
|
|
|
12
12
|
This is the REST API for the Kodit server. Please refer to the
|
|
13
13
|
[Kodit documentation](https://docs.helix.ml/kodit/) for more information.
|
|
14
14
|
|
|
15
|
-
Current version: 0.5.
|
|
15
|
+
Current version: 0.5.2
|
|
16
16
|
|
|
17
17
|
## Authentication
|
|
18
18
|
|
|
@@ -516,6 +516,42 @@ Get a specific tag for a repository.
|
|
|
516
516
|
|
|
517
517
|
- 404: Repository or tag not found
|
|
518
518
|
|
|
519
|
+
### GET /api/v1/repositories/{repo_id}/enrichments
|
|
520
|
+
|
|
521
|
+
List the most recent enrichments for a repository.
|
|
522
|
+
|
|
523
|
+
Query parameters:
|
|
524
|
+
- ref_type: Type of reference (branch, tag, or commit_sha). Defaults to "branch".
|
|
525
|
+
- ref_name: Name of the reference. For branches, defaults to the tracking branch.
|
|
526
|
+
- enrichment_type: Optional filter for specific enrichment type.
|
|
527
|
+
- limit: Maximum number of enrichments to return. Defaults to 10.
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
#### Parameters
|
|
531
|
+
|
|
532
|
+
| Name | Type | Required | Description |
|
|
533
|
+
|------|------|----------|-------------|
|
|
534
|
+
| repo_id | string | True | |
|
|
535
|
+
| ref_type | string | False | |
|
|
536
|
+
| ref_name | | False | |
|
|
537
|
+
| enrichment_type | | False | |
|
|
538
|
+
| limit | integer | False | |
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
#### Responses
|
|
542
|
+
|
|
543
|
+
- 200: Successful Response
|
|
544
|
+
|
|
545
|
+
[EnrichmentListResponse](#enrichmentlistresponse)
|
|
546
|
+
|
|
547
|
+
- 500: Internal server error
|
|
548
|
+
|
|
549
|
+
- 401: Unauthorized
|
|
550
|
+
|
|
551
|
+
- 422: Invalid request
|
|
552
|
+
|
|
553
|
+
- 404: Repository not found
|
|
554
|
+
|
|
519
555
|
## Components
|
|
520
556
|
|
|
521
557
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "kodit API",
|
|
5
5
|
"description": "\nThis is the REST API for the Kodit server. Please refer to the\n[Kodit documentation](https://docs.helix.ml/kodit/) for more information.\n ",
|
|
6
|
-
"version": "0.5.
|
|
6
|
+
"version": "0.5.2"
|
|
7
7
|
},
|
|
8
8
|
"paths": {
|
|
9
9
|
"/healthz": {
|
|
@@ -1034,6 +1034,108 @@
|
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
1037
|
+
},
|
|
1038
|
+
"/api/v1/repositories/{repo_id}/enrichments": {
|
|
1039
|
+
"get": {
|
|
1040
|
+
"tags": [
|
|
1041
|
+
"repositories"
|
|
1042
|
+
],
|
|
1043
|
+
"summary": "List latest repository enrichments",
|
|
1044
|
+
"description": "List the most recent enrichments for a repository.\n\nQuery parameters:\n- ref_type: Type of reference (branch, tag, or commit_sha). Defaults to \"branch\".\n- ref_name: Name of the reference. For branches, defaults to the tracking branch.\n- enrichment_type: Optional filter for specific enrichment type.\n- limit: Maximum number of enrichments to return. Defaults to 10.",
|
|
1045
|
+
"operationId": "list_repository_enrichments_api_v1_repositories__repo_id__enrichments_get",
|
|
1046
|
+
"security": [
|
|
1047
|
+
{
|
|
1048
|
+
"Header (X-API-KEY)": []
|
|
1049
|
+
}
|
|
1050
|
+
],
|
|
1051
|
+
"parameters": [
|
|
1052
|
+
{
|
|
1053
|
+
"name": "repo_id",
|
|
1054
|
+
"in": "path",
|
|
1055
|
+
"required": true,
|
|
1056
|
+
"schema": {
|
|
1057
|
+
"type": "string",
|
|
1058
|
+
"title": "Repo Id"
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"name": "ref_type",
|
|
1063
|
+
"in": "query",
|
|
1064
|
+
"required": false,
|
|
1065
|
+
"schema": {
|
|
1066
|
+
"type": "string",
|
|
1067
|
+
"default": "branch",
|
|
1068
|
+
"title": "Ref Type"
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
"name": "ref_name",
|
|
1073
|
+
"in": "query",
|
|
1074
|
+
"required": false,
|
|
1075
|
+
"schema": {
|
|
1076
|
+
"anyOf": [
|
|
1077
|
+
{
|
|
1078
|
+
"type": "string"
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
"type": "null"
|
|
1082
|
+
}
|
|
1083
|
+
],
|
|
1084
|
+
"title": "Ref Name"
|
|
1085
|
+
}
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
"name": "enrichment_type",
|
|
1089
|
+
"in": "query",
|
|
1090
|
+
"required": false,
|
|
1091
|
+
"schema": {
|
|
1092
|
+
"anyOf": [
|
|
1093
|
+
{
|
|
1094
|
+
"type": "string"
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
"type": "null"
|
|
1098
|
+
}
|
|
1099
|
+
],
|
|
1100
|
+
"title": "Enrichment Type"
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"name": "limit",
|
|
1105
|
+
"in": "query",
|
|
1106
|
+
"required": false,
|
|
1107
|
+
"schema": {
|
|
1108
|
+
"type": "integer",
|
|
1109
|
+
"default": 10,
|
|
1110
|
+
"title": "Limit"
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
],
|
|
1114
|
+
"responses": {
|
|
1115
|
+
"200": {
|
|
1116
|
+
"description": "Successful Response",
|
|
1117
|
+
"content": {
|
|
1118
|
+
"application/json": {
|
|
1119
|
+
"schema": {
|
|
1120
|
+
"$ref": "#/components/schemas/EnrichmentListResponse"
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
},
|
|
1125
|
+
"500": {
|
|
1126
|
+
"description": "Internal server error"
|
|
1127
|
+
},
|
|
1128
|
+
"401": {
|
|
1129
|
+
"description": "Unauthorized"
|
|
1130
|
+
},
|
|
1131
|
+
"422": {
|
|
1132
|
+
"description": "Invalid request"
|
|
1133
|
+
},
|
|
1134
|
+
"404": {
|
|
1135
|
+
"description": "Repository not found"
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1037
1139
|
}
|
|
1038
1140
|
},
|
|
1039
1141
|
"components": {
|
|
@@ -24,6 +24,9 @@ Global context for the kodit project. Provides a shared state for the app.
|
|
|
24
24
|
| `EMBEDDING_ENDPOINT_NUM_PARALLEL_TASKS` | int | `10` | Number of parallel tasks to use for the endpoint |
|
|
25
25
|
| `EMBEDDING_ENDPOINT_SOCKET_PATH` | `str | None` | `None` | Unix socket path for local communication (e.g., /tmp/openai.sock) |
|
|
26
26
|
| `EMBEDDING_ENDPOINT_TIMEOUT` | float | `60` | Request timeout in seconds |
|
|
27
|
+
| `EMBEDDING_ENDPOINT_MAX_RETRIES` | int | `5` | Maximum number of retries for the endpoint |
|
|
28
|
+
| `EMBEDDING_ENDPOINT_INITIAL_DELAY` | float | `2.0` | Initial delay in seconds for the endpoint |
|
|
29
|
+
| `EMBEDDING_ENDPOINT_BACKOFF_FACTOR` | float | `2.0` | Backoff factor for the endpoint |
|
|
27
30
|
| `EMBEDDING_ENDPOINT_EXTRA_PARAMS` | `dict | None` | `None` | Extra provider-specific non-secret parameters for LiteLLM |
|
|
28
31
|
| `EMBEDDING_ENDPOINT_MAX_TOKENS` | int | `8000` | Conservative token limit for the embedding model |
|
|
29
32
|
| `ENRICHMENT_ENDPOINT` | `Endpoint | None` | `None` | Endpoint to use for enrichment. |
|
|
@@ -33,6 +36,9 @@ Global context for the kodit project. Provides a shared state for the app.
|
|
|
33
36
|
| `ENRICHMENT_ENDPOINT_NUM_PARALLEL_TASKS` | int | `10` | Number of parallel tasks to use for the endpoint |
|
|
34
37
|
| `ENRICHMENT_ENDPOINT_SOCKET_PATH` | `str | None` | `None` | Unix socket path for local communication (e.g., /tmp/openai.sock) |
|
|
35
38
|
| `ENRICHMENT_ENDPOINT_TIMEOUT` | float | `60` | Request timeout in seconds |
|
|
39
|
+
| `ENRICHMENT_ENDPOINT_MAX_RETRIES` | int | `5` | Maximum number of retries for the endpoint |
|
|
40
|
+
| `ENRICHMENT_ENDPOINT_INITIAL_DELAY` | float | `2.0` | Initial delay in seconds for the endpoint |
|
|
41
|
+
| `ENRICHMENT_ENDPOINT_BACKOFF_FACTOR` | float | `2.0` | Backoff factor for the endpoint |
|
|
36
42
|
| `ENRICHMENT_ENDPOINT_EXTRA_PARAMS` | `dict | None` | `None` | Extra provider-specific non-secret parameters for LiteLLM |
|
|
37
43
|
| `ENRICHMENT_ENDPOINT_MAX_TOKENS` | int | `8000` | Conservative token limit for the embedding model |
|
|
38
44
|
| `DEFAULT_SEARCH` | Search | `provider='sqlite'` | |
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.5.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 5,
|
|
31
|
+
__version__ = version = '0.5.3'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 5, 3)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Create a big object that contains all the application services."""
|
|
2
2
|
|
|
3
3
|
from collections.abc import Callable
|
|
4
|
-
from typing import TYPE_CHECKING
|
|
5
4
|
|
|
6
5
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
7
6
|
|
|
@@ -12,6 +11,9 @@ from kodit.application.services.code_search_application_service import (
|
|
|
12
11
|
from kodit.application.services.commit_indexing_application_service import (
|
|
13
12
|
CommitIndexingApplicationService,
|
|
14
13
|
)
|
|
14
|
+
from kodit.application.services.enrichment_query_service import (
|
|
15
|
+
EnrichmentQueryService,
|
|
16
|
+
)
|
|
15
17
|
from kodit.application.services.queue_service import QueueService
|
|
16
18
|
from kodit.application.services.reporting import ProgressTracker
|
|
17
19
|
from kodit.application.services.sync_scheduler import SyncSchedulerService
|
|
@@ -39,6 +41,7 @@ from kodit.domain.services.git_repository_service import (
|
|
|
39
41
|
from kodit.domain.services.physical_architecture_service import (
|
|
40
42
|
PhysicalArchitectureService,
|
|
41
43
|
)
|
|
44
|
+
from kodit.domain.tracking.resolution_service import TrackableResolutionService
|
|
42
45
|
from kodit.infrastructure.bm25.local_bm25_repository import LocalBM25Repository
|
|
43
46
|
from kodit.infrastructure.bm25.vectorchord_bm25_repository import (
|
|
44
47
|
VectorChordBM25Repository,
|
|
@@ -82,9 +85,6 @@ from kodit.infrastructure.sqlalchemy.task_status_repository import (
|
|
|
82
85
|
)
|
|
83
86
|
from kodit.infrastructure.sqlalchemy.unit_of_work import SqlAlchemyUnitOfWork
|
|
84
87
|
|
|
85
|
-
if TYPE_CHECKING:
|
|
86
|
-
from kodit.domain.services.enrichment_service import EnrichmentDomainService
|
|
87
|
-
|
|
88
88
|
|
|
89
89
|
class ServerFactory:
|
|
90
90
|
"""Factory for creating server application services."""
|
|
@@ -105,7 +105,6 @@ class ServerFactory:
|
|
|
105
105
|
self._commit_indexing_application_service: (
|
|
106
106
|
CommitIndexingApplicationService | None
|
|
107
107
|
) = None
|
|
108
|
-
self._enrichment_service: EnrichmentDomainService | None = None
|
|
109
108
|
self._enricher_service: Enricher | None = None
|
|
110
109
|
self._task_status_repository: TaskStatusRepository | None = None
|
|
111
110
|
self._operation: ProgressTracker | None = None
|
|
@@ -127,6 +126,8 @@ class ServerFactory:
|
|
|
127
126
|
self._architecture_service: PhysicalArchitectureService | None = None
|
|
128
127
|
self._enrichment_v2_repository: EnrichmentV2Repository | None = None
|
|
129
128
|
self._architecture_formatter: PhysicalArchitectureFormatter | None = None
|
|
129
|
+
self._trackable_resolution_service: TrackableResolutionService | None = None
|
|
130
|
+
self._enrichment_query_service: EnrichmentQueryService | None = None
|
|
130
131
|
|
|
131
132
|
def architecture_formatter(self) -> PhysicalArchitectureFormatter:
|
|
132
133
|
"""Create a PhysicalArchitectureFormatter instance."""
|
|
@@ -351,3 +352,22 @@ class ServerFactory:
|
|
|
351
352
|
session_factory=self.session_factory
|
|
352
353
|
)
|
|
353
354
|
return self._git_tag_repository
|
|
355
|
+
|
|
356
|
+
def trackable_resolution_service(self) -> TrackableResolutionService:
|
|
357
|
+
"""Create a TrackableResolutionService instance."""
|
|
358
|
+
if not self._trackable_resolution_service:
|
|
359
|
+
self._trackable_resolution_service = TrackableResolutionService(
|
|
360
|
+
commit_repo=self.git_commit_repository(),
|
|
361
|
+
branch_repo=self.git_branch_repository(),
|
|
362
|
+
tag_repo=self.git_tag_repository(),
|
|
363
|
+
)
|
|
364
|
+
return self._trackable_resolution_service
|
|
365
|
+
|
|
366
|
+
def enrichment_query_service(self) -> EnrichmentQueryService:
|
|
367
|
+
"""Create a EnrichmentQueryService instance."""
|
|
368
|
+
if not self._enrichment_query_service:
|
|
369
|
+
self._enrichment_query_service = EnrichmentQueryService(
|
|
370
|
+
trackable_resolution=self.trackable_resolution_service(),
|
|
371
|
+
enrichment_repo=self.enrichment_v2_repository(),
|
|
372
|
+
)
|
|
373
|
+
return self._enrichment_query_service
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""Application service for querying enrichments."""
|
|
2
|
+
|
|
3
|
+
import structlog
|
|
4
|
+
|
|
5
|
+
from kodit.domain.enrichments.enrichment import EnrichmentV2
|
|
6
|
+
from kodit.domain.tracking.resolution_service import TrackableResolutionService
|
|
7
|
+
from kodit.domain.tracking.trackable import Trackable
|
|
8
|
+
from kodit.infrastructure.sqlalchemy.enrichment_v2_repository import (
|
|
9
|
+
EnrichmentV2Repository,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class EnrichmentQueryService:
|
|
14
|
+
"""Finds the latest commit with enrichments for a trackable.
|
|
15
|
+
|
|
16
|
+
Orchestrates domain services and repositories to fulfill the use case.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
trackable_resolution: TrackableResolutionService,
|
|
22
|
+
enrichment_repo: EnrichmentV2Repository,
|
|
23
|
+
) -> None:
|
|
24
|
+
"""Initialize the enrichment query service."""
|
|
25
|
+
self.trackable_resolution = trackable_resolution
|
|
26
|
+
self.enrichment_repo = enrichment_repo
|
|
27
|
+
self.log = structlog.get_logger(__name__)
|
|
28
|
+
|
|
29
|
+
async def find_latest_enriched_commit(
|
|
30
|
+
self,
|
|
31
|
+
trackable: Trackable,
|
|
32
|
+
enrichment_type: str | None = None,
|
|
33
|
+
max_commits_to_check: int = 100,
|
|
34
|
+
) -> str | None:
|
|
35
|
+
"""Find the most recent commit with enrichments.
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
trackable: What to track (branch, tag, or commit)
|
|
39
|
+
enrichment_type: Optional filter for specific enrichment type
|
|
40
|
+
max_commits_to_check: How far back in history to search
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
Commit SHA of the most recent commit with enrichments, or None
|
|
44
|
+
|
|
45
|
+
"""
|
|
46
|
+
# Get candidate commits from the trackable
|
|
47
|
+
candidate_commits = await self.trackable_resolution.resolve_to_commits(
|
|
48
|
+
trackable, max_commits_to_check
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
if not candidate_commits:
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
# Check which commits have enrichments
|
|
55
|
+
enrichments = await self.enrichment_repo.enrichments_for_entity_type(
|
|
56
|
+
entity_type="git_commit",
|
|
57
|
+
entity_ids=candidate_commits,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# Filter by type if specified
|
|
61
|
+
if enrichment_type:
|
|
62
|
+
enrichments = [e for e in enrichments if e.type == enrichment_type]
|
|
63
|
+
|
|
64
|
+
# Find the first commit (newest) that has enrichments
|
|
65
|
+
for commit_sha in candidate_commits:
|
|
66
|
+
if any(e.entity_id == commit_sha for e in enrichments):
|
|
67
|
+
return commit_sha
|
|
68
|
+
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
async def get_enrichments_for_commit(
|
|
72
|
+
self,
|
|
73
|
+
commit_sha: str,
|
|
74
|
+
enrichment_type: str | None = None,
|
|
75
|
+
) -> list[EnrichmentV2]:
|
|
76
|
+
"""Get all enrichments for a specific commit.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
commit_sha: The commit SHA to get enrichments for
|
|
80
|
+
enrichment_type: Optional filter for specific enrichment type
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
List of enrichments for the commit
|
|
84
|
+
|
|
85
|
+
"""
|
|
86
|
+
enrichments = await self.enrichment_repo.enrichments_for_entity_type(
|
|
87
|
+
entity_type="git_commit",
|
|
88
|
+
entity_ids=[commit_sha],
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
# Filter by type if specified
|
|
92
|
+
if enrichment_type:
|
|
93
|
+
enrichments = [e for e in enrichments if e.type == enrichment_type]
|
|
94
|
+
|
|
95
|
+
return enrichments
|
|
@@ -70,6 +70,18 @@ class Endpoint(BaseModel):
|
|
|
70
70
|
default=60,
|
|
71
71
|
description="Request timeout in seconds",
|
|
72
72
|
)
|
|
73
|
+
max_retries: int = Field(
|
|
74
|
+
default=5,
|
|
75
|
+
description="Maximum number of retries for the endpoint",
|
|
76
|
+
)
|
|
77
|
+
initial_delay: float = Field(
|
|
78
|
+
default=2.0,
|
|
79
|
+
description="Initial delay in seconds for the endpoint",
|
|
80
|
+
)
|
|
81
|
+
backoff_factor: float = Field(
|
|
82
|
+
default=2.0,
|
|
83
|
+
description="Backoff factor for the endpoint",
|
|
84
|
+
)
|
|
73
85
|
extra_params: dict[str, Any] | None = Field(
|
|
74
86
|
default=None,
|
|
75
87
|
description="Extra provider-specific non-secret parameters for LiteLLM",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Tracking domain module."""
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""Domain service for resolving trackables to commits."""
|
|
2
|
+
|
|
3
|
+
import structlog
|
|
4
|
+
|
|
5
|
+
from kodit.domain.protocols import (
|
|
6
|
+
GitBranchRepository,
|
|
7
|
+
GitCommitRepository,
|
|
8
|
+
GitTagRepository,
|
|
9
|
+
)
|
|
10
|
+
from kodit.domain.tracking.trackable import Trackable, TrackableReferenceType
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TrackableResolutionService:
|
|
14
|
+
"""Resolves trackables to ordered lists of commits.
|
|
15
|
+
|
|
16
|
+
This is a domain service because it orchestrates multiple aggregates
|
|
17
|
+
(branches, tags, commits) without belonging to any single entity.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
commit_repo: GitCommitRepository,
|
|
23
|
+
branch_repo: GitBranchRepository,
|
|
24
|
+
tag_repo: GitTagRepository,
|
|
25
|
+
) -> None:
|
|
26
|
+
"""Initialize the trackable resolution service."""
|
|
27
|
+
self.commit_repo = commit_repo
|
|
28
|
+
self.branch_repo = branch_repo
|
|
29
|
+
self.tag_repo = tag_repo
|
|
30
|
+
self.log = structlog.get_logger(__name__)
|
|
31
|
+
|
|
32
|
+
async def resolve_to_commits(
|
|
33
|
+
self, trackable: Trackable, limit: int = 100
|
|
34
|
+
) -> list[str]:
|
|
35
|
+
"""Resolve a trackable to an ordered list of commit SHAs.
|
|
36
|
+
|
|
37
|
+
Returns commits from newest to oldest based on git history.
|
|
38
|
+
"""
|
|
39
|
+
if trackable.type == TrackableReferenceType.BRANCH:
|
|
40
|
+
return await self._resolve_branch(trackable, limit)
|
|
41
|
+
if trackable.type == TrackableReferenceType.TAG:
|
|
42
|
+
return await self._resolve_tag(trackable, limit)
|
|
43
|
+
# COMMIT_SHA
|
|
44
|
+
return [trackable.identifier]
|
|
45
|
+
|
|
46
|
+
async def _resolve_branch(
|
|
47
|
+
self, trackable: Trackable, limit: int
|
|
48
|
+
) -> list[str]:
|
|
49
|
+
"""Get commits from branch HEAD backwards through history."""
|
|
50
|
+
branch = await self.branch_repo.get_by_name(
|
|
51
|
+
trackable.identifier, trackable.repo_id
|
|
52
|
+
)
|
|
53
|
+
# Walk commit history from head_commit backwards
|
|
54
|
+
return await self._walk_commit_history(
|
|
55
|
+
branch.head_commit.commit_sha, limit
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
async def _resolve_tag(self, trackable: Trackable, limit: int) -> list[str]:
|
|
59
|
+
"""Get commits from tag target backwards through history."""
|
|
60
|
+
tag = await self.tag_repo.get_by_name(
|
|
61
|
+
trackable.identifier, trackable.repo_id
|
|
62
|
+
)
|
|
63
|
+
return await self._walk_commit_history(
|
|
64
|
+
tag.target_commit.commit_sha, limit
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
async def _walk_commit_history(
|
|
68
|
+
self, start_sha: str, limit: int
|
|
69
|
+
) -> list[str]:
|
|
70
|
+
"""Walk commit history backwards from start_sha."""
|
|
71
|
+
result = []
|
|
72
|
+
current_sha: str | None = start_sha
|
|
73
|
+
|
|
74
|
+
for _ in range(limit):
|
|
75
|
+
if not current_sha:
|
|
76
|
+
break
|
|
77
|
+
result.append(current_sha)
|
|
78
|
+
commit = await self.commit_repo.get_by_sha(current_sha)
|
|
79
|
+
current_sha = commit.parent_commit_sha or None
|
|
80
|
+
|
|
81
|
+
return result
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Trackable value objects."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from enum import StrEnum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TrackableReferenceType(StrEnum):
|
|
8
|
+
"""Types of git references that can be tracked."""
|
|
9
|
+
|
|
10
|
+
BRANCH = "branch"
|
|
11
|
+
TAG = "tag"
|
|
12
|
+
COMMIT_SHA = "commit_sha"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(frozen=True)
|
|
16
|
+
class Trackable:
|
|
17
|
+
"""Represents a trackable reference point in a git repository."""
|
|
18
|
+
|
|
19
|
+
type: TrackableReferenceType
|
|
20
|
+
identifier: str # e.g., "main", "v1.0.0", "abc123..."
|
|
21
|
+
repo_id: int
|
|
@@ -13,6 +13,9 @@ from kodit.application.services.code_search_application_service import (
|
|
|
13
13
|
from kodit.application.services.commit_indexing_application_service import (
|
|
14
14
|
CommitIndexingApplicationService,
|
|
15
15
|
)
|
|
16
|
+
from kodit.application.services.enrichment_query_service import (
|
|
17
|
+
EnrichmentQueryService,
|
|
18
|
+
)
|
|
16
19
|
from kodit.application.services.queue_service import QueueService
|
|
17
20
|
from kodit.config import AppContext
|
|
18
21
|
from kodit.domain.protocols import (
|
|
@@ -155,3 +158,15 @@ async def get_code_search_app_service(
|
|
|
155
158
|
CodeSearchAppServiceDep = Annotated[
|
|
156
159
|
CodeSearchApplicationService, Depends(get_code_search_app_service)
|
|
157
160
|
]
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
async def get_enrichment_query_service(
|
|
164
|
+
server_factory: ServerFactoryDep,
|
|
165
|
+
) -> EnrichmentQueryService:
|
|
166
|
+
"""Get enrichment query service dependency."""
|
|
167
|
+
return server_factory.enrichment_query_service()
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
EnrichmentQueryServiceDep = Annotated[
|
|
171
|
+
EnrichmentQueryService, Depends(get_enrichment_query_service)
|
|
172
|
+
]
|
|
@@ -2,15 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
from fastapi import APIRouter, Depends, HTTPException
|
|
4
4
|
|
|
5
|
+
from kodit.domain.tracking.trackable import Trackable, TrackableReferenceType
|
|
5
6
|
from kodit.infrastructure.api.middleware.auth import api_key_auth
|
|
6
7
|
from kodit.infrastructure.api.v1.dependencies import (
|
|
7
8
|
CommitIndexingAppServiceDep,
|
|
9
|
+
EnrichmentQueryServiceDep,
|
|
8
10
|
GitBranchRepositoryDep,
|
|
9
11
|
GitCommitRepositoryDep,
|
|
10
12
|
GitRepositoryDep,
|
|
11
13
|
GitTagRepositoryDep,
|
|
12
14
|
TaskStatusQueryServiceDep,
|
|
13
15
|
)
|
|
16
|
+
from kodit.infrastructure.api.v1.schemas.enrichment import (
|
|
17
|
+
EnrichmentAttributes,
|
|
18
|
+
EnrichmentData,
|
|
19
|
+
EnrichmentListResponse,
|
|
20
|
+
)
|
|
14
21
|
from kodit.infrastructure.api.v1.schemas.repository import (
|
|
15
22
|
RepositoryBranchData,
|
|
16
23
|
RepositoryCommitData,
|
|
@@ -259,6 +266,98 @@ async def get_repository_tag(
|
|
|
259
266
|
)
|
|
260
267
|
|
|
261
268
|
|
|
269
|
+
@router.get(
|
|
270
|
+
"/{repo_id}/enrichments",
|
|
271
|
+
summary="List latest repository enrichments",
|
|
272
|
+
responses={404: {"description": "Repository not found"}},
|
|
273
|
+
)
|
|
274
|
+
async def list_repository_enrichments( # noqa: PLR0913
|
|
275
|
+
repo_id: str,
|
|
276
|
+
git_repository: GitRepositoryDep,
|
|
277
|
+
enrichment_query_service: EnrichmentQueryServiceDep,
|
|
278
|
+
ref_type: str = "branch",
|
|
279
|
+
ref_name: str | None = None,
|
|
280
|
+
enrichment_type: str | None = None,
|
|
281
|
+
limit: int = 10,
|
|
282
|
+
) -> EnrichmentListResponse:
|
|
283
|
+
"""List the most recent enrichments for a repository.
|
|
284
|
+
|
|
285
|
+
Query parameters:
|
|
286
|
+
- ref_type: Type of reference (branch, tag, or commit_sha). Defaults to "branch".
|
|
287
|
+
- ref_name: Name of the reference. For branches, defaults to the tracking branch.
|
|
288
|
+
- enrichment_type: Optional filter for specific enrichment type.
|
|
289
|
+
- limit: Maximum number of enrichments to return. Defaults to 10.
|
|
290
|
+
"""
|
|
291
|
+
# Get repository
|
|
292
|
+
repo = await git_repository.get_by_id(int(repo_id))
|
|
293
|
+
if not repo:
|
|
294
|
+
raise HTTPException(status_code=404, detail="Repository not found")
|
|
295
|
+
|
|
296
|
+
# Determine the reference to track
|
|
297
|
+
if ref_name is None:
|
|
298
|
+
if ref_type == "branch":
|
|
299
|
+
# Default to tracking branch
|
|
300
|
+
if not repo.tracking_branch:
|
|
301
|
+
raise HTTPException(
|
|
302
|
+
status_code=400, detail="No tracking branch configured"
|
|
303
|
+
)
|
|
304
|
+
ref_name = repo.tracking_branch.name
|
|
305
|
+
else:
|
|
306
|
+
raise HTTPException(
|
|
307
|
+
status_code=400,
|
|
308
|
+
detail="ref_name is required for tag and commit_sha references",
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
# Parse ref_type
|
|
312
|
+
try:
|
|
313
|
+
trackable_type = TrackableReferenceType(ref_type)
|
|
314
|
+
except ValueError:
|
|
315
|
+
raise HTTPException(
|
|
316
|
+
status_code=400,
|
|
317
|
+
detail=f"Invalid ref_type: {ref_type}. Must be branch, tag, or commit_sha",
|
|
318
|
+
) from None
|
|
319
|
+
|
|
320
|
+
# Create trackable
|
|
321
|
+
trackable = Trackable(
|
|
322
|
+
type=trackable_type, identifier=ref_name, repo_id=int(repo_id)
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
# Find the latest enriched commit
|
|
326
|
+
enriched_commit = await enrichment_query_service.find_latest_enriched_commit(
|
|
327
|
+
trackable=trackable,
|
|
328
|
+
enrichment_type=enrichment_type,
|
|
329
|
+
max_commits_to_check=limit * 10, # Check more commits to find enriched ones
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
# If no enriched commit found, return empty list
|
|
333
|
+
if not enriched_commit:
|
|
334
|
+
return EnrichmentListResponse(data=[])
|
|
335
|
+
|
|
336
|
+
# Get enrichments for the commit
|
|
337
|
+
enrichments = await enrichment_query_service.get_enrichments_for_commit(
|
|
338
|
+
commit_sha=enriched_commit,
|
|
339
|
+
enrichment_type=enrichment_type,
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
# Map enrichments to API response format
|
|
343
|
+
enrichment_data = [
|
|
344
|
+
EnrichmentData(
|
|
345
|
+
type="enrichment",
|
|
346
|
+
id=str(enrichment.id) if enrichment.id else "0",
|
|
347
|
+
attributes=EnrichmentAttributes(
|
|
348
|
+
type=enrichment.type,
|
|
349
|
+
subtype=enrichment.subtype,
|
|
350
|
+
content=enrichment.content,
|
|
351
|
+
created_at=enrichment.created_at,
|
|
352
|
+
updated_at=enrichment.updated_at,
|
|
353
|
+
),
|
|
354
|
+
)
|
|
355
|
+
for enrichment in enrichments
|
|
356
|
+
]
|
|
357
|
+
|
|
358
|
+
return EnrichmentListResponse(data=enrichment_data)
|
|
359
|
+
|
|
360
|
+
|
|
262
361
|
@router.delete(
|
|
263
362
|
"/{repo_id}",
|
|
264
363
|
status_code=204,
|